Defacto Invoice API

The Invoice API from Defacto — 4 operation(s) for invoice.

OpenAPI Specification

defacto-invoice-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Defacto Accounting Invoice API
  version: v1.0.0
  description: Defacto provides instant, embedded financing for SMBs across Europe. This REST API lets partners onboard borrowers, test eligibility and credit limits, upload business/bank data, create invoices, request and manage loans, handle repayments and recollection, issue and manage credit cards, bill fees, and subscribe to webhooks. Reconstructed by API Evangelist from the per-operation OpenAPI fragments published on Defacto's ReadMe developer portal (developers.getdefacto.com/llms.txt). operationId values are the provider's ReadMe reference slugs; summaries are the reference page titles.
  contact:
    email: contact@getdefacto.com
    url: https://developers.getdefacto.com/
servers:
- url: https://api.getdefacto.com
  description: Production
- url: https://api-sandbox.getdefacto.com
  description: Sandbox
security:
- Bearer: []
tags:
- name: Invoice
paths:
  /invoice/{invoice_id}:
    delete:
      description: Delete an invoice by id
      parameters:
      - in: path
        name: invoice_id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/APIInvoice'
      security:
      - Bearer: []
      tags:
      - Invoice
      operationId: delete_invoice-invoice-id
      summary: /invoice/{invoice_id}
    get:
      description: Get an invoice by id
      parameters:
      - in: path
        name: invoice_id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/APIInvoice'
      security:
      - Bearer: []
      tags:
      - Invoice
      operationId: get_invoice-invoice-id
      summary: /invoice/{invoice_id}
    patch:
      description: Updates an invoice (with status TO_SUBMIT or TO_EDIT only)
      parameters:
      - in: path
        name: invoice_id
        required: true
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/APIPatchInvoice'
      responses:
        '200':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/APIInvoice'
      security:
      - Bearer: []
      tags:
      - Invoice
      operationId: patch_invoice-invoice-id
      summary: /invoice/{invoice_id}
  /invoices:
    get:
      description: Get your invoices
      parameters:
      - description: Business buying a product or service from the seller.
        in: query
        name: buyer
        required: false
        explode: true
        schema:
          type: array
          items:
            type: string
      - description: Pagination cursor from the previous response's next_page field. Omit to get the first page.
        in: query
        name: cursor
        required: false
        x-nullable: true
        schema:
          type: string
          default: null
      - in: query
        name: invoice_id
        required: false
        explode: true
        schema:
          type: array
          items:
            format: uuid
            type: string
      - description: If false, the invoice is not linked to any loan and has not been submitted for a loan.
        in: query
        name: linked_to_loan
        required: false
        x-nullable: true
        schema:
          type: boolean
          default: null
      - description: Filters invoices linked to a loan that was paid after the specified date (based on the loan's paid_at field). This filter is only effective when `linked_to_loan` is set to true.
        in: query
        name: linked_to_loan_paid_after
        required: false
        x-nullable: true
        schema:
          type: string
          format: date-time
          default: null
      - description: Filters invoices linked to a loan that was paid before the specified date (based on the loan's paid_at field). This filter is only effective when `linked_to_loan` is set to true.
        in: query
        name: linked_to_loan_paid_before
        required: false
        x-nullable: true
        schema:
          type: string
          format: date-time
          default: null
      - description: Maximum number of items to return per page.
        in: query
        name: page_size
        required: false
        schema:
          type: integer
          default: 100
      - description: Query to filter invoices
        in: query
        name: query
        required: false
        x-nullable: true
        schema:
          type: string
          default: null
      - description: Business selling a product or service to the buyer.
        in: query
        name: seller
        required: false
        explode: true
        schema:
          type: array
          items:
            type: string
      - description: '<b>TO_SUBMIT, SUBMITTED, TO_EDIT or VERIFIED</b><ul><li>TO_SUBMIT: the invoice is a draft, you can correct it and submit it when correct</li><li>SUBMITTED: the invoice has been submitted and Defacto is verifying it</li><li>TO_EDIT: the invoice has not been validated by Defacto. It should be edited before you can submit it again</li><li>VERIFIED: the invoice has been verified by Defacto. A loan can now be requested for the invoice.</li></ul>'
        in: query
        name: status
        required: false
        explode: true
        schema:
          type: array
          items:
            enum:
            - DECLINED
            - DELETED
            - PAID
            - SUBMITTED
            - TO_EDIT
            - TO_SUBMIT
            - VERIFIED
            type: string
      responses:
        '200':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TypedApiPage'
      security:
      - Bearer: []
      tags:
      - Invoice
      operationId: get_invoices
      summary: /invoices
    post:
      description: '

        Create an invoice.

        - If you create an invoice that will need to be edited afterwards, create a draft invoice with the <code>is_draft</code> parameter. Otherwise set <code>is_draft</code> to false.

        - This endpoint requires the base64-encoded value of the PDF of the invoice. You can for example use [base64guru](https://base64.guru/converter/encode/pdf).

        '
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APIDraftableInvoiceCreation'
      responses:
        '201':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/APIInvoice'
      security:
      - Bearer: []
      tags:
      - Invoice
      operationId: post_invoices
      summary: /invoices
  /invoice/{invoice_id}/submit:
    post:
      description: '

        Submit an invoice for validation by Defacto (with status TO_SUBMIT or TO_EDIT).

        If some data is missing prior to validating the invoice, a 422 error will be returned with the list of the missing fields.

        '
      parameters:
      - in: path
        name: invoice_id
        required: true
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/APIPatchInvoice'
      responses:
        '200':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/APIInvoice'
      security:
      - Bearer: []
      tags:
      - Invoice
      operationId: post_invoice-invoice-id-submit
      summary: /invoice/{invoice_id}/submit
  /invoices/upload:
    post:
      description: Create an invoice entity from the PDF of an invoice. Send the file within a formData. The endpoint will automatically extract the invoice information and create an invoice entity from them.
      parameters:
      - description: Business identifier of the buyer, must be in the form <business_identifier_type>-<business_identifier> such as SIREN-899021021 for a french company.
        in: query
        name: buyer
        required: false
        x-nullable: true
        schema:
          type: string
          default: null
      - description: Business identifier of the seller, must be in the form <business_identifier_type>-<business_identifier> such as SIREN-899021021 for a french company.
        in: query
        name: seller
        required: false
        x-nullable: true
        schema:
          type: string
          default: null
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                metadata:
                  type: string
                  default: null
                  x-nullable: true
      responses:
        '201':
          description: ''
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/APIInvoice'
      security:
      - Bearer: []
      tags:
      - Invoice
      operationId: post_invoices-upload
      summary: /invoices/upload
components:
  schemas:
    APICounterpartyCreation:
      properties:
        address:
          allOf:
          - $ref: '#/components/schemas/Address'
          default: null
          nullable: true
        contact:
          allOf:
          - $ref: '#/components/schemas/APICounterpartyContact'
          default: null
          nullable: true
        identifier:
          default: null
          description: Legal identifier of the business, such as its SIRET or SIREN in France. Must not contain spaces.
          type: string
          nullable: true
        identifier_type:
          default: null
          description: Type of legal business identifier of the business, such as the SIRET in France.
          enum:
          - belgium_registration_number
          - bsn
          - cif
          - hr_nummer
          - kvk
          - name
          - nif
          - siren
          - siret
          - steuernummer
          - vat_number
          - null
          type: string
          nullable: true
        name:
          default: null
          description: Legal name of the business.
          type: string
          nullable: true
        vat_number:
          default: null
          description: VatNumber
          type: string
          nullable: true
      type: object
    APILightAccountDetails:
      properties:
        account_number:
          description: The account identifier. Only IBANs are supported at the moment.
          type: string
        account_number_type:
          description: The type of account number (e.g. IBAN).
          enum:
          - account_number
          - iban
          - internal_id
          type: string
        bank_identifier:
          description: The identifier of the bank.
          type: string
        bank_identifier_type:
          description: The type of bank identifier (e.g. BIC).
          enum:
          - bic
          - name
          - routing_number
          - undefined
          type: string
      required:
      - account_number
      - account_number_type
      - bank_identifier
      - bank_identifier_type
      type: object
    APIInvoice:
      properties:
        buyer:
          allOf:
          - $ref: '#/components/schemas/APIBusinessCounterparty'
          default: null
          nullable: true
        currency:
          default: EUR
          description: Currency of the invoice. Use ISO 4217 currency code.
          enum:
          - EUR
          - GBP
          type: string
        document_url:
          default: null
          type: string
          nullable: true
        due_at:
          default: null
          format: date-time
          type: string
          nullable: true
        id:
          default: null
          nullable: true
        invoice_number:
          description: Invoice number as displayed on the invoice
          type: string
        is_draft:
          default: null
          description: True by default, set to false if you want to create and validate invoice in one API call.
          type: boolean
          nullable: true
        issued_at:
          default: null
          format: date-time
          type: string
          nullable: true
        loan_ids:
          items:
            format: uuid
            type: string
          type: array
        metadata:
          additionalProperties:
            nullable: true
          default: null
          description: This object is yours, it enables you to add custom data.
          type: object
          nullable: true
        net_amount:
          description: Amount before tax, in cents
          type: integer
        seller:
          allOf:
          - $ref: '#/components/schemas/APIBusinessCounterparty'
          default: null
          nullable: true
        status:
          default: TO_SUBMIT
          description: '<b>TO_SUBMIT, SUBMITTED, TO_EDIT or VERIFIED</b><ul><li>TO_SUBMIT: the invoice is a draft, you can correct it and submit it when correct</li><li>SUBMITTED: the invoice has been submitted and Defacto is verifying it</li><li>TO_EDIT: the invoice has not been validated by Defacto. It should be edited before you can submit it again</li><li>VERIFIED: the invoice has been verified by Defacto. A loan can now be requested for the invoice.</li></ul>'
          enum:
          - DECLINED
          - DELETED
          - PAID
          - SUBMITTED
          - TO_EDIT
          - TO_SUBMIT
          - VERIFIED
          type: string
        status_reason:
          default: null
          enum:
          - ACTIVITY_DOCUMENTS_REQUIRED
          - ACTIVITY_NOT_ELIGIBLE_BORROWER
          - ALREADY_USING_FACTORING_OR_DAILLY
          - AMOUNT_SUPERIOR_TO_AVAILABLE_BALANCE
          - AVERAGE_INVOICE_SIZE_TOO_HIGH
          - BLACKLISTED_FACTORED_COUNTERPARTY
          - BORROWER_AND_COUNTERPARTY_HAVE_COMMON_DIRECTOR
          - BORROWER_CHURNED
          - BORROWER_DEFAULTED
          - BORROWER_STATUS
          - BORROWER_TO_SIGN
          - BUSINESS_AGE_BELOW_THRESHOLD
          - BUSINESS_AML_EXTREME_RISK
          - BUSINESS_COMPLIANCE_ISSUE_DETECTED
          - BUSINESS_HARD_COLLECTION
          - BUSINESS_HAS_NO_PROFESSIONAL_EMAIL
          - BUSINESS_INSOLVENCY_PROCEDURE_EXISTS
          - BUSINESS_INSOLVENCY_PROCEDURE_UNKNOWN_STATUS
          - BUSINESS_LEGAL_FORM_NOT_ELIGIBLE
          - BUSINESS_MISSING_INFORMATION
          - BUSINESS_NOT_DIFFUSIBLE
          - BUSINESS_NOT_REGISTERED
          - BUSINESS_NOT_REGISTERED_TO_RCS
          - BUSINESS_NOT_REGISTERED_TO_RCS_OR_RNE
          - BUSINESS_RADIATED
          - BUSINESS_REGION_NOT_COVERED
          - BUSINESS_UNKNOWN
          - BUSINESS_UNKNOWN_BUYER
          - BUSINESS_UNKNOWN_SELLER
          - CAPPING_EXCEEDED
          - CASHED_IN_NOT_REPAID
          - CCSF_TRANSACTION_DETECTED
          - CCSF_TRANSACTION_PENDING_DATA_REQUEST
          - CCSF_TRANSACTION_WAITING_END_INSTALLMENT_PLAN
          - COUNTERPARTY_DATA_MISSING
          - COUNTERPARTY_INSOLVENCY_PROCEDURE_EXISTS
          - COUNTERPARTY_INSOLVENCY_PROCEDURE_UNKNOWN_STATUS
          - COUNTERPARTY_KPI_MISSING
          - COUNTERPARTY_NOT_REGISTERED
          - COUNTERPARTY_NOT_SELECTED_FOR_FINANCING
          - COUNTRY_CAPPING_EXCEEDED
          - COUNTRY_NOT_ELIGIBLE_BORROWER
          - COUNTRY_NOT_ELIGIBLE_COUNTERPARTY
          - CREDIT_RISK_NOT_ELIGIBLE
          - CREDIT_RISK_NOT_ELIGIBLE_COUNTERPARTY
          - DATA_STILL_REFRESHING
          - DEBT_ARREARS_PENDING_GRACE_PERIOD
          - DEPRECATED_LATE_REPAYMENT
          - DOES_NOT_MATCH_ELIGIBILITY_CRITERIA
          - DOUBLE_MOBILIZATION
          - DPD_15_LATE_REPAYMENT_BORROWER
          - DPD_15_LATE_REPAYMENT_BUYER
          - DPD_15_LATE_REPAYMENT_SELLER
          - ELLISPHERE_RISK_INDEX
          - EXCEEDED_PARTNER_CREDIT_LINE
          - EXCESSIVE_AMOUNT_LOAN_REQUEST
          - EXCESSIVE_DURATION_LOAN_REQUEST
          - EXPOSURE_TOO_OLD
          - FILL_INVOICE_BUYER_INFORMATION
          - FILL_INVOICE_SELLER_INFORMATION
          - FINANCIAL_PRODUCT_DEACTIVATED
          - FINANCIAL_PRODUCT_NOT_IN_RELEASE
          - FINANCIAL_STATEMENT_BAD_KPI
          - FINANCIAL_STATEMENT_PARSING_ISSUE
          - HIGH_BUSINESS_RISK_INDEX
          - HIGH_LOAN_DEFAULT_INDEX
          - HIGH_LYSTA_RISK_INDEX
          - INDUSTRY_CODE_NOT_ELIGIBLE_BORROWER
          - INDUSTRY_CODE_NOT_ELIGIBLE_COUNTERPARTY
          - INSOLVENCY_EARLY_SIGNAL_DETECTED
          - INSOLVENCY_PROCEDURE_EXISTS_BORROWER
          - INSOLVENCY_PROCEDURE_EXISTS_BUYER
          - INSOLVENCY_PROCEDURE_EXISTS_SELLER
          - INSTALLMENT_PLAN_DETECTED_FOR_TAX
          - INSTALLMENT_PLAN_DETECTED_FOR_URSSAF
          - INSURANCE_QUOTE_EXPIRED
          - INVOICE_ALREADY_FINANCED
          - INVOICE_AUTO_LIQUIDATION
          - INVOICE_BLACKLIST_WORDS
          - INVOICE_COMPLIANCE_ISSUE_DETECTED
          - INVOICE_DOES_NOT_MATCH_ELIGIBILITY_CRITERIA
          - INVOICE_LME_NON_COMPLIANT
          - INVOICE_MISSING_ACCOUNT_NUMBER
          - INVOICE_MISSING_LEGAL_MENTION
          - INVOICE_MULTIPLE_STAGE
          - INVOICE_NON_ELIGIBLE_USE_CASE
          - INVOICE_NOT_ELIGIBLE_TO_CREDIT_INSURANCE
          - INVOICE_NOT_ISSUED_YET
          - INVOICE_NOT_RELATED_TO_WCR
          - INVOICE_OVERDUE
          - INVOICE_PAYABLE_BORROWER_IS_ACCOUNT_HOLDER
          - INVOICE_RECEIVABLE_ACCOUNT_MISSING_LIVE_CONNECTION
          - INVOICE_RECEIVABLE_ACCOUNT_MISSING_MANDATE
          - INVOICE_RECEIVABLE_BORROWER_IS_NOT_ACCOUNT_HOLDER
          - INVOICE_REPAYMENT_DATE_TOO_FAR_60D
          - KPI_MISSING
          - KPI_SCREENING_NOT_ELIGIBLE_BORROWER
          - KYB_PENDING
          - KYB_PENDING_USER_ACTION
          - KYC_PENDING
          - KYC_PENDING_USER_ACTION
          - LATE_REPAYMENT_BORROWER
          - LEGAL_FORM_NOT_ELIGIBLE_BORROWER
          - LEGAL_FORM_NOT_ELIGIBLE_BUYER
          - LEGAL_FORM_NOT_ELIGIBLE_COUNTERPARTY
          - LINKED_BUSINESS_IS_BLOCKED
          - LOAN_REQUEST_EXPIRED
          - LOW_CASH_BALANCE
          - LOW_FREE_CASH_FLOW
          - MAX_AMOUNT_EXCEEDED
          - MAX_AMOUNT_EXCEEDED_BORROWER
          - MAX_AMOUNT_EXCEEDED_BUYER
          - MAX_AMOUNT_EXCEEDED_SELLER
          - MISSING_COUNTERPARTY_CONTACT_INFORMATION
          - MISSING_PUBLIC_PROCUREMENT_DOCUMENT
          - NEED_BANKING_INTEGRATION
          - NOT_AN_INVOICE
          - NOT_DIFFUSIBLE_BUYER
          - NOT_DIFFUSIBLE_SELLER
          - NOT_ENOUGH_DATA
          - NOT_PRE_ELIGIBLE_SPV
          - NOT_REGISTERED_BUYER
          - NOT_REGISTERED_SELLER
          - NO_TAX_PAYMENT_FOUND
          - NO_URSSAF_PAYMENTS_FOUND
          - NO_URSSAF_PAYMENT_FOUND
          - OFFBOARDED
          - ORANGE_FLAG_TRANSACTIONS
          - OTHER_BUSINESS_FROM_DIRECTOR_HAS_INSOLVENCY_PROCEDURE
          - OUTDATED_DATA
          - OUTDATED_INVOICE
          - OUTDATED_INVOICE_2WEEKS
          - OUTDATED_INVOICE_3WEEKS
          - OVERDRAFT_REQUIRED
          - PLEASE_RECONNECT_BANK_ACCOUNTS
          - POSTAL_CODE_NOT_ELIGIBLE_BORROWER
          - POSTAL_CODE_NOT_ELIGIBLE_COUNTERPARTY
          - PROACTIVE_RECOLLECTION
          - PRUDENTIAL_EXPOSURE_EXCEEDED
          - QONTO_INTEGRATION_GERMAN_USER_DOES_NOT_HAVE_4_MONTHS_OF_HISTORY
          - QONTO_INTEGRATION_USER_DOES_NOT_HAVE_6_MONTHS_OF_HISTORY
          - QONTO_INTEGRATION_USER_DOES_NOT_MEET_MINIMUM_REQUIREMENT_FOR_CREDIT_LINE
          - RECENT_DEBT_ARREARS_KO
          - RECENT_DEBT_ARREARS_PENDING_DATA_REQUEST
          - RECENT_REVENUE_DROP
          - RECENT_SEIZURE_DETECTED
          - RECENT_TAX_ARREARS_PENDING_DATA_REQUEST
          - RECENT_UNPAID_PRIVILEGED_TRANSACTIONS
          - RECENT_UNPAID_PRIVILEGED_TRANSACTIONS_PENDING_DATA_REQUEST
          - RECENT_URSSAF_ARREARS_PENDING_DATA_REQUEST
          - RED_FLAG_TRANSACTIONS
          - RELATED_COUNTERPARTY_HAS_FLAG
          - RELATED_COUNTERPARTY_IS_LATE
          - REMOVED_FROM_COMMERCIAL_REGISTER_BORROWER
          - REMOVED_FROM_COMMERCIAL_REGISTER_BUSINESS
          - REMOVED_FROM_COMMERCIAL_REGISTER_BUYER
          - REMOVED_FROM_COMMERCIAL_REGISTER_SELLER
          - REPAYMENT_CONCENTRATION_IS_TOO_HIGH
          - REQUIRED_FINANCIAL_STATEMENT
          - RISK_SCORE_DOWNGRADING
          - SMALL_RECURRING_AMOUNT_DETECTED_FOR_URSSAF
          - TOO_LONG
          - UNAUTHORIZED_LOAN_PAYMENT_ACCOUNT
          - UNAUTHORIZED_LOAN_PAYMENT_ACCOUNT_BANK_IDENTIFIER
          - UNAUTHORIZED_LOAN_PAYMENT_BENEFICIARY
          - URSSAF_PAYMENTS_STOPPED
          - USER_DOES_NOT_MEET_MINIMUM_MAX_AMOUNT_SIZE
          - USER_DOES_NOT_MEET_MINIMUM_REQUIREMENT_FOR_CREDIT_LINE
          - WAITING_FOR_THIRD_PARTY_PROVIDER
          - WAIT_FOR_REPAYMENT
          - null
          type: string
          nullable: true
        tax_amount:
          default: null
          description: Amount of tax, in cents
          type: integer
          nullable: true
        to_account_details:
          allOf:
          - $ref: '#/components/schemas/APILightAccountDetails'
          default: null
          nullable: true
        to_pay_amount:
          default: null
          description: Remaining amount due by buyer to seller, in cents. Set at 0 for fully paid invoices.
          type: integer
          nullable: true
        total_amount:
          default: null
          description: Sum of net amount and tax amount, in cents
          type: integer
          nullable: true
      required:
      - invoice_number
      - net_amount
      type: object
    Address:
      properties:
        address_line_1:
          type: string
          nullable: true
        address_line_2:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        postal_code:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
      type: object
    APIBusinessIdentifier:
      properties:
        identifier:
          description: Legal identifier of the business, such as its SIRET or SIREN in France. Must not contain spaces.
          type: string
        identifier_type:
          description: Type of legal business identifier of the business, such as the SIRET in France.
          enum:
          - belgium_registration_number
          - bsn
          - cif
          - hr_nummer
          - kvk
          - name
          - nif
          - siren
          - siret
          - steuernummer
          - vat_number
          type: string
      required:
      - identifier
      - identifier_type
      type: object
    APIAccountCreation:
      properties:
        account_holder:
          allOf:
          - $ref: '#/components/schemas/APIBusinessIdentifier'
          default: null
          description: The business owning the account.
          nullable: true
        account_number:
          description: The account identifier. Only IBANs are supported at the moment.
          type: string
        account_number_type:
          default: iban
          description: The type of account number (e.g. IBAN).
          enum:
          - account_number
          - iban
          - internal_id
          type: string
        bank_identifier:
          default: null
          description: The identifier of the bank.
          type: string
          nullable: true
        bank_identifier_type:
          default: bic
          description: The type of bank identifier (e.g. BIC).
          enum:
          - bic
          - name
          - routing_number
          - undefined
          type: string
      required:
      - account_number
      type: object
    APIBusinessCounterparty:
      properties:
        business_id:
          default: null
          format: uuid
          type: string
          nullable: true
        id:
          default: null
          format: uuid
          type: string
          nullable: true
        identifier:
          description: Legal identifier of the business, such as its SIRET or SIREN in France. Must not contain spaces.
          type: string
        identifier_type:
          default: null
          description: Type of legal business identifier of the business, such as the SIRET in France.
          enum:
          - belgium_registration_number
          - bsn
          - cif
          - hr_nummer
          - kvk
          - name
          - nif
          - siren
          - siret
          - steuernummer
          - vat_number
          - null
          type: string
          nullable: true
        name:
          default: null
          description: Legal name of the business.
          type: string
          nullable: true
        vat_number:
          default: null
          description: VatNumber
          type: string
          nullable: true
      required:
      - identifier
      type: object
    TypedApiPage:
      properties:
        count:
          type: integer
        data:
          items:
            $ref: '#/components/schemas/APIInvoice'
          type: array
        next_page:
          default: null
          type: string
          nullable: true
        page_size:
          type: integer
        previous_page:
          default: null
          type: string
          nullable: true
        total:
          default: null
          type: integer
          nullable: true
      required:
      - count
      - page_size
      type: object
    APICounterpartyContact:
      properties:
        email:
          format: email
          type: string
        first_name:
          type: string
        last_name:
          type: string
        phone_number:
          type: string
      required:
      - email
      - first_name
      - last_name
      - phone_number
      type: object
    APIDraftableInvoiceCreation:
      properties:
        buyer:
          allOf:
          - $ref: '#/components/schemas/APICounterpartyCreation'
          default: null
          nullable: true
        currency:
          default: EUR
          description: Currency of the invoice. Use ISO 4217 currency code.
          enum:
          - EUR
          - GBP
          type: string
          nullable: true
        document:
          description: PDF binary (format base64 string)
          type: string
        due_at:
          default: null
          format: date-time
          type: string
          nullable: true
        invoice_number:
          default: null
          description: Invoice number as displayed on the invoice
          type: string
          nullable: true
        is_draft:
          default: false
          description: True by default, set to false if you want to create and validate invoice in one API call.
          type: boolean
          nullable: true
        issued_at:
          default: null
          format: date-time
          type: string
          nullable: true
        metadata:
          additionalProperties:
            nullable: true
          default: null
          description: This object is yours, it enables you to add custom data.
          type: object
          nullable: true
        net_amount:
          default: null
          description: Amount before tax, in cents
          type: integer
          nullable: true
        seller:
          allOf:
          - $ref: '#/components/schemas/APICounterpartyCreation'
          default: null
          nullable: true
        tax_amount:
          default: null
          description: Amount of tax, in cents
          type: integer
          nullable: true
        to_account:
          allOf:
          - $ref: '#/components/schemas/APIAccountCreation'
          default: null
          description: Beneficiary account as mentioned on the invoice. Note that this does not determine the account where the loan payment will be made.That is done separately when calling the POST /loans endpoint.
          nullable: true
        to_pay_amount:
          default: null
          description: Remaining amount due by buyer to seller, in cents. Set at 0 for fully paid invoices.
          type: integer
          nullable: true
        total_amount:
          default: null
          description: Sum of net amount and tax amount, in cents
          type: integer
          nullable: true
      required:
      - document
      type: object
  securitySchemes:
    Bearer:
      in: header
      name: Authorization
      type: apiKey