> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperline.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create transaction

> Create a transaction linked to an existing invoice. This may update the invoice status to paid/partially paid.



## OpenAPI

````yaml post /v1/invoices/{id}/transactions
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/invoices/{id}/transactions:
    post:
      tags:
        - Invoices > Transactions
      summary: Create transaction
      description: >-
        Create a transaction linked to an existing invoice. This may update the
        invoice status to paid/partially paid.
      operationId: createInvoiceTransaction
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        description: Create invoice transaction payload
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    amount:
                      type: number
                      minimum: 0
                      description: Transaction amount.
                      example: 31500
                    process_at:
                      type: string
                      format: date-time
                      description: >-
                        Date corresponding to the processing of the transaction.
                        If in the future, the transaction is scheduled to be
                        processed.
                      example: '2024-11-12T07:38:39.222Z'
                    payment_method_id:
                      type: string
                      description: >-
                        Payment method used to execute the transaction. Only
                        applies to scheduled transactions with a process_at date
                        in the future.
                      example: pm_1xMpj5bwRqN7LM
                  required:
                    - amount
                    - process_at
                    - payment_method_id
                - type: object
                  properties:
                    amount:
                      type: number
                      minimum: 0
                      description: Transaction amount.
                      example: 31500
                    process_at:
                      type: string
                      format: date-time
                      description: >-
                        Date corresponding to the processing of the transaction.
                        If in the future, the transaction is scheduled to be
                        processed.
                      example: '2024-11-12T07:38:39.222Z'
                    payment_method_type:
                      type: string
                      enum:
                        - transfer
                    bank_account_id:
                      type: string
                      description: Bank account linked to the transaction.
                      example: bac_KJyPrMA1toAqRG
                  required:
                    - amount
                    - process_at
                    - payment_method_type
                - type: object
                  properties:
                    amount:
                      type: number
                      minimum: 0
                      description: Transaction amount.
                      example: 31500
                    process_at:
                      type: string
                      format: date-time
                      description: >-
                        Date corresponding to the processing of the transaction.
                        If in the future, the transaction is scheduled to be
                        processed.
                      example: '2024-11-12T07:38:39.222Z'
                    provider_name:
                      type: string
                      enum:
                        - airwallex
                        - gocardless
                        - mollie
                        - stripe
                      description: Provider name.
                    provider_id:
                      type: string
                      description: >-
                        Provider ID. Required if multiple instances of the same
                        provider are connected in Hyperline.
                    provider_transaction_id:
                      type: string
                      description: >-
                        ID of the transaction on the provider's side. If the
                        transaction is pending, Hyperline will automatically
                        refresh it with the latest details until it is settled.
                        Note that the `amount` and `process_at` fields may be
                        overridden by the transaction data.
                  required:
                    - provider_name
                    - provider_transaction_id
                - type: object
                  properties:
                    amount:
                      type: number
                      minimum: 0
                      description: Transaction amount.
                      example: 31500
                    process_at:
                      type: string
                      format: date-time
                      description: >-
                        Date corresponding to the processing of the transaction.
                        If in the future, the transaction is scheduled to be
                        processed.
                      example: '2024-11-12T07:38:39.222Z'
                    payment_method_type:
                      type: string
                      enum:
                        - external
                  required:
                    - amount
                    - process_at
      responses:
        '201':
          description: The invoice with the newly created transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceDetailsV1'
        '404':
          description: Invoice not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
      security:
        - bearer: []
components:
  schemas:
    InvoiceDetailsV1:
      allOf:
        - $ref: '#/components/schemas/InvoiceDeprecated'
        - type: object
          properties:
            integrations:
              type: array
              items:
                type: object
                properties:
                  entity_id:
                    type: string
                    description: ID of the entity in the provider.
                  provider_name:
                    type: string
                    enum:
                      - adyen
                      - stripe
                      - mollie
                      - gocardless
                      - airwallex
                      - salesforce
                      - hubspot
                      - attio
                      - xero
                      - pennylane
                      - zoho-books
                      - exact-online
                      - quickbooks
                      - netsuite
                      - anrok
                      - chargebee
                      - slack
                      - plain
                      - zendesk
                      - pylon
                      - intercom
                      - claap
                    description: Provider name.
                  provider_account_id:
                    type: string
                    description: ID of the connected provider account.
                required:
                  - entity_id
                  - provider_name
                  - provider_account_id
                description: Reference to the entity in an external provider.
                example:
                  entity_id: '123456789'
                  provider_name: stripe
                  provider_account_id: acc_1234567890
          required:
            - integrations
    InvoiceDeprecated:
      type: object
      properties:
        id:
          type: string
          description: Invoice ID.
          example: inv_1eTaiytfA0i2Va
        number:
          type: string
          description: >-
            Invoice number. Generated by Hyperline using the sequential
            numbering and format defined in your settings.
          example: INV-35
        type:
          type: string
          enum:
            - invoice
            - credit_note
            - document
            - child_invoice_ref
            - child_creditnote_ref
          description: >-
            Type of the invoice.


            - `invoice`: Legal invoice to be paid by your customer.

            - `credit_note`: Legal credit note cancelling an invoice and
            refunding your customer.

            - `document`: Custom document with no legal value. Can be generated
            from a subscription to meet specific needs.
              
          example: invoice
        document_name:
          type:
            - string
            - 'null'
          description: >-
            If the invoice is of type `document` you can give it a custom name
            (displayed on the final PDF).
          example: null
        status:
          type: string
          enum:
            - draft
            - open
            - to_pay
            - grace_period
            - partially_paid
            - paid
            - voided
            - closed
            - error
            - missing_info
            - archived
            - charged_on_parent
            - pending_parent_concat
            - uncollectible
          description: >
            Current invoice status.


            - `draft`: Invoice is in draft mode (not finalized yet).

            - `open`: Invoice for the current billing period, which will be
            issued at the end of the period (used for invoices with usage-based
            data).

            - `grace_period`: Invoice is in a review period after being issued
            for the billing period and before becoming due for payment.

            - `to_pay`: Invoice is awaiting payment.

            - `partially_paid`: Invoice is partially paid.

            - `paid`: Invoice is fully paid.

            - `voided`: Invoice has been voided and is no longer valid.

            - `closed`: Invoice was not issued and has been discarded.

            - `error`: Invoice failed to be paid.

            - `archived`: A previous version of an invoice.

            - `charged_on_parent`: Invoice is charged on the parent customer.

            - `pending_parent_concat`: Invoice is pending invoices concatenation
            on the parent customer to be grouped.

            - `uncollectible`: Invoice is uncollectible (bad debt).
          example: paid
        reference:
          type:
            - string
            - 'null'
          description: >-
            Unique identifier to ease reconciliation with payment. Useful for
            bank transfer.
          example: V0KAHOU6J3
        purchase_order:
          type:
            - string
            - 'null'
          description: Reference to the purchase order linked to the invoice.
          example: PO-12345
        currency:
          type: string
          enum:
            - EUR
            - AED
            - AFN
            - XCD
            - ALL
            - AMD
            - AOA
            - ARS
            - USD
            - AUD
            - AWG
            - AZN
            - BAM
            - BBD
            - BDT
            - BGN
            - BHD
            - BIF
            - XOF
            - BMD
            - BND
            - BOB
            - BRL
            - BSD
            - BTN
            - NOK
            - BWP
            - BYR
            - BZD
            - CAD
            - CDF
            - XAF
            - CHF
            - NZD
            - CLP
            - CNY
            - COP
            - CRC
            - CUP
            - CVE
            - ANG
            - CZK
            - DJF
            - DKK
            - DOP
            - DZD
            - EGP
            - MAD
            - ERN
            - ETB
            - FJD
            - FKP
            - GBP
            - GEL
            - GHS
            - GIP
            - GMD
            - GNF
            - GTQ
            - GYD
            - HKD
            - HNL
            - HRK
            - HTG
            - HUF
            - IDR
            - ILS
            - INR
            - IQD
            - IRR
            - ISK
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LYD
            - MDL
            - MGA
            - MKD
            - MMK
            - MNT
            - MOP
            - MRO
            - MUR
            - MVR
            - MWK
            - MXN
            - MYR
            - MZN
            - NAD
            - XPF
            - NGN
            - NIO
            - NPR
            - OMR
            - PAB
            - PEN
            - PGK
            - PHP
            - PKR
            - PLN
            - PYG
            - QAR
            - RON
            - RSD
            - RUB
            - RWF
            - SAR
            - SBD
            - SCR
            - SDG
            - SEK
            - SGD
            - SHP
            - SLL
            - SOS
            - SRD
            - SSP
            - STD
            - SYP
            - SZL
            - THB
            - TJS
            - TMT
            - TND
            - TOP
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UGX
            - UYU
            - UZS
            - VEF
            - VND
            - VUV
            - WST
            - YER
            - ZAR
            - ZMW
            - ZWL
          description: >-
            Currency code. See [ISO
            4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).
          example: EUR
        source:
          type: string
          enum:
            - hyperline
            - api
            - pennylane
            - chargebee
            - stripe
            - lago
            - sequence
            - other
          description: |
            Source of the invoice.
                - `hyperline`: Invoice created by Hyperline.
                - `api`: Invoice created through the API.
                - `other`: Invoice created by an external source.
          example: hyperline
        total_amount:
          type: number
          description: >-
            Sum of the amount and taxes amount of all products on the invoice.
            Expressed in currency's smallest unit.
          example: 24000
        amount_due:
          type: number
          description: >-
            Amount still need to be paid for the invoice. Expressed in
            currency's smallest unit.
          example: 0
        amount_paid:
          type: number
          description: >-
            Amount already paid for the invoice. Expressed in currency's
            smallest unit.
          example: 24000
        amount_fixed:
          type: number
          description: >-
            Amount corresponding to the recurring non-variable part of the total
            amount. Expressed in currency's smallest unit.
          example: 20000
        amount_excluding_tax:
          type: number
          description: >-
            Total amount without the taxes amount. Expressed in currency's
            smallest unit.
          example: 20000
        tax_rate:
          type: number
          description: Deprecated field, please use `line_items[].tax_rate`.
          deprecated: true
        tax_amount:
          type: number
          description: Tax amount of the invoice. Expressed in currency's smallest unit.
          example: 4000
        tax_scheme:
          type: string
          enum:
            - exempt
            - standard
            - reverse_charge
            - manual
            - not_eligible
          description: >-
            Tax scheme of the invoice.


            - `standard`: Tax rate is resolved depending on local tax
            regulations.

            - `exempt`: No tax rate applied because the customer country doesn't
            require it.

            - `reverse_charge`: No tax rate applied because the customer is
            eligible to EU reverse charge.

            - `manual`: Tax rate has been manually specified when creating the
            invoice.

            - `not_eligible`: Tax collection is disabled for the invoice.
              
          example: standard
        discount_amount:
          type: number
          description: >-
            Amount corresponding to the discounted part of the total amount.
            Expressed in currency's smallest unit.
          example: 0
        conversion_rate:
          type:
            - number
            - 'null'
          description: >-
            Conversion rate used between the invoice currency and your
            accounting currency.
          example: 1
        converted_amount:
          type:
            - number
            - 'null'
          description: >-
            Amount converted using the conversion rate. Expressed in currency's
            smallest unit.
          example: 24000
        converted_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Date of the conversion of the amount.
          example: '2024-10-13T02:00:00.000Z'
        payment_method_id:
          type:
            - string
            - 'null'
          description: >-
            ID of the default payment method used to pay the invoice.
            Transactions related to the invoice may use different payment
            methods.
          example: pm_1ryTrMj4TTAT1N
        bank_account_id:
          type:
            - string
            - 'null'
          description: >-
            ID of the bank account displayed on the invoice. Transactions
            related to the invoice may use different bank accounts.
          example: bac_KJyPrMA1toAqRG
        custom_note:
          type:
            - string
            - 'null'
          description: Custom note added to the invoice.
          example: Thank you for your purchase!
        additional_info:
          type:
            - string
            - 'null'
          description: >-
            Additional information added to the invoice. If not defined, it will
            be inherited from the invoicing entity's settings.
          example: >-
            This invoice must be paid within the payment delay indicated. After
            this period a late payment penalty of 10% will be applied.
        footer:
          type:
            - string
            - 'null'
          description: >-
            Footer added to the invoice. If not defined, it will be inherited
            from the invoicing entity's settings.
          example: ACME (Acme SAS) is a company registered in France | SIREN N°123456
        customer:
          type: object
          properties:
            id:
              type: string
              description: Customer ID.
              example: cus_Typ0px2W0aiEtl
            name:
              type: string
              description: Customer name.
              example: Acme
            email:
              type:
                - string
                - 'null'
              description: Email to which all communications will be sent.
              example: billing@acme.com
            external_id:
              type:
                - string
                - 'null'
              description: >-
                ID of the customer in your system. This helps matching your
                customer with the one on Hyperline.
              example: null
            vat_number:
              type:
                - string
                - 'null'
              description: Deprecated field, please use `tax_id`.
              deprecated: true
            tax_id:
              type:
                - string
                - 'null'
              description: Value of the customer tax ID.
              example: FR123456789
            address:
              $ref: '#/components/schemas/Address'
          required:
            - id
            - name
            - email
            - external_id
            - vat_number
            - tax_id
            - address
        seller:
          type: object
          properties:
            id:
              type: string
              description: ID of the invoicing entity attached to the invoice.
              example: ive_47484fjdhy5
            name:
              type: string
              description: Name of the invoicing entity
              example: Name of the invoicing entity
            tax_id:
              type:
                - string
                - 'null'
              description: Tax identifier / VAT number of the invoicing entity
              example: FR5878986578
            address:
              allOf:
                - $ref: '#/components/schemas/Address'
                - description: Seller address.
          required:
            - id
            - name
            - tax_id
            - address
        subscription_id:
          type:
            - string
            - 'null'
          description: ID of the subscription related to the invoice.
          example: sub_amiaWZ3lzDIWaoT
        period_starts_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Start date of the billing period of the invoice.
          example: '2024-10-13T00:00:00.000Z'
        period_ends_at:
          type:
            - string
            - 'null'
          format: date-time
          description: End date of the billing period of the invoice.
          example: '2024-11-13T00:00:00.000Z'
        emitted_at:
          type: string
          format: date-time
          description: Issue date of the invoice.
          example: '2024-10-13T00:00:00.000Z'
        due_at:
          type: string
          format: date-time
          description: >-
            Due date of the invoice. Computed from the issue date and the
            payment delay configured in your settings.
          example: '2024-11-12T00:00:00.000Z'
        refunded_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Date corresponding to the refund of the invoice, previously paid. A
            credit note exists with an original invoice ID equals to this
            invoice ID.
          example: null
        grace_period_ended_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Date the invoice grace period ended. This happens at the issue date
            + the grace period duration configured in your settings.
          example: null
        settled_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Date the invoice was fully paid.
          example: '2024-10-15T14:01:56.000Z'
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Date of the last update.
          example: '2024-10-15T14:01:56.000Z'
        properties:
          type:
            - object
            - 'null'
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
              - type: 'null'
              - type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
                    - type: boolean
                    - type: 'null'
                    - type: 'null'
              - type: 'null'
          description: Key/value pairs to store any metadata useful in your context.
          example: null
        custom_properties:
          type:
            - object
            - 'null'
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
              - type: string
                format: date-time
                description: >-
                  UTC date time string in the [ISO
                  8601](https://en.wikipedia.org/wiki/ISO_8601) format.
                example: '2024-12-20T16:04:11Z'
              - type: array
                items:
                  type: string
              - type: 'null'
          description: >-
            Values for custom properties defined for the `invoice` entity, keyed
            by slug.
          example: null
        original_invoice_id:
          type:
            - string
            - 'null'
          description: >-
            ID of the original invoice this entity is linked to (only used for
            credit note or organisation-based billing).
          example: null
        original_invoice_number:
          type:
            - string
            - 'null'
          description: >-
            Number of the original invoice this entity is linked to (only used
            for credit note).
          example: null
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItem'
          description: List of line items composing the invoice.
        coupons:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceCoupon'
          description: List of coupons applied to the invoice.
        transactions:
          type: array
          items:
            allOf:
              - type: object
                properties:
                  id:
                    type: string
                    description: Transaction ID.
                    example: tra_2QdJDDUej969ev
                  type:
                    type: string
                    enum:
                      - subscription
                      - one_time
                      - refund
                    description: >-

                      Transaction type.


                      - `subscription`: The transaction is related to a
                      subscription payment.

                      - `one_time`: The transaction is related to a one-time
                      payment.

                      - `refund`: The transaction is related to a refund
                      payment.
                        
                    example: subscription
                  amount:
                    type: number
                    description: Transaction amount.
                    example: 31500
                  currency:
                    type: string
                    enum:
                      - EUR
                      - AED
                      - AFN
                      - XCD
                      - ALL
                      - AMD
                      - AOA
                      - ARS
                      - USD
                      - AUD
                      - AWG
                      - AZN
                      - BAM
                      - BBD
                      - BDT
                      - BGN
                      - BHD
                      - BIF
                      - XOF
                      - BMD
                      - BND
                      - BOB
                      - BRL
                      - BSD
                      - BTN
                      - NOK
                      - BWP
                      - BYR
                      - BZD
                      - CAD
                      - CDF
                      - XAF
                      - CHF
                      - NZD
                      - CLP
                      - CNY
                      - COP
                      - CRC
                      - CUP
                      - CVE
                      - ANG
                      - CZK
                      - DJF
                      - DKK
                      - DOP
                      - DZD
                      - EGP
                      - MAD
                      - ERN
                      - ETB
                      - FJD
                      - FKP
                      - GBP
                      - GEL
                      - GHS
                      - GIP
                      - GMD
                      - GNF
                      - GTQ
                      - GYD
                      - HKD
                      - HNL
                      - HRK
                      - HTG
                      - HUF
                      - IDR
                      - ILS
                      - INR
                      - IQD
                      - IRR
                      - ISK
                      - JMD
                      - JOD
                      - JPY
                      - KES
                      - KGS
                      - KHR
                      - KMF
                      - KPW
                      - KRW
                      - KWD
                      - KYD
                      - KZT
                      - LAK
                      - LBP
                      - LKR
                      - LRD
                      - LSL
                      - LYD
                      - MDL
                      - MGA
                      - MKD
                      - MMK
                      - MNT
                      - MOP
                      - MRO
                      - MUR
                      - MVR
                      - MWK
                      - MXN
                      - MYR
                      - MZN
                      - NAD
                      - XPF
                      - NGN
                      - NIO
                      - NPR
                      - OMR
                      - PAB
                      - PEN
                      - PGK
                      - PHP
                      - PKR
                      - PLN
                      - PYG
                      - QAR
                      - RON
                      - RSD
                      - RUB
                      - RWF
                      - SAR
                      - SBD
                      - SCR
                      - SDG
                      - SEK
                      - SGD
                      - SHP
                      - SLL
                      - SOS
                      - SRD
                      - SSP
                      - STD
                      - SYP
                      - SZL
                      - THB
                      - TJS
                      - TMT
                      - TND
                      - TOP
                      - TRY
                      - TTD
                      - TWD
                      - TZS
                      - UAH
                      - UGX
                      - UYU
                      - UZS
                      - VEF
                      - VND
                      - VUV
                      - WST
                      - YER
                      - ZAR
                      - ZMW
                      - ZWL
                    description: Transaction currency.
                    example: EUR
                  customer_id:
                    type: string
                    description: ID of the customer linked to the transaction.
                    example: cus_QalW2vTAdkR6IY
                  provider_id:
                    type:
                      - string
                      - 'null'
                    description: Deprecated field, please use `integrations[].entity_id`.
                    deprecated: true
                  process_at:
                    type: string
                    format: date-time
                    description: >-
                      Date corresponding to the processing of the transaction.
                      If in the future, the transaction is scheduled to be
                      processed.
                    example: '2024-11-12T07:38:39.222Z'
                  refunded_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: Date corresponding to the refund of the transaction.
                    example: null
                  last_refreshed_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: >-
                      Date corresponding to the last synchronization of the
                      details with the payment provider.
                    example: null
                  provider_fee:
                    type:
                      - object
                      - 'null'
                    properties:
                      amount:
                        type: number
                        description: >-
                          Monetary amount. Expressed in currency's smallest
                          unit.
                      currency:
                        type: string
                        enum:
                          - EUR
                          - AED
                          - AFN
                          - XCD
                          - ALL
                          - AMD
                          - AOA
                          - ARS
                          - USD
                          - AUD
                          - AWG
                          - AZN
                          - BAM
                          - BBD
                          - BDT
                          - BGN
                          - BHD
                          - BIF
                          - XOF
                          - BMD
                          - BND
                          - BOB
                          - BRL
                          - BSD
                          - BTN
                          - NOK
                          - BWP
                          - BYR
                          - BZD
                          - CAD
                          - CDF
                          - XAF
                          - CHF
                          - NZD
                          - CLP
                          - CNY
                          - COP
                          - CRC
                          - CUP
                          - CVE
                          - ANG
                          - CZK
                          - DJF
                          - DKK
                          - DOP
                          - DZD
                          - EGP
                          - MAD
                          - ERN
                          - ETB
                          - FJD
                          - FKP
                          - GBP
                          - GEL
                          - GHS
                          - GIP
                          - GMD
                          - GNF
                          - GTQ
                          - GYD
                          - HKD
                          - HNL
                          - HRK
                          - HTG
                          - HUF
                          - IDR
                          - ILS
                          - INR
                          - IQD
                          - IRR
                          - ISK
                          - JMD
                          - JOD
                          - JPY
                          - KES
                          - KGS
                          - KHR
                          - KMF
                          - KPW
                          - KRW
                          - KWD
                          - KYD
                          - KZT
                          - LAK
                          - LBP
                          - LKR
                          - LRD
                          - LSL
                          - LYD
                          - MDL
                          - MGA
                          - MKD
                          - MMK
                          - MNT
                          - MOP
                          - MRO
                          - MUR
                          - MVR
                          - MWK
                          - MXN
                          - MYR
                          - MZN
                          - NAD
                          - XPF
                          - NGN
                          - NIO
                          - NPR
                          - OMR
                          - PAB
                          - PEN
                          - PGK
                          - PHP
                          - PKR
                          - PLN
                          - PYG
                          - QAR
                          - RON
                          - RSD
                          - RUB
                          - RWF
                          - SAR
                          - SBD
                          - SCR
                          - SDG
                          - SEK
                          - SGD
                          - SHP
                          - SLL
                          - SOS
                          - SRD
                          - SSP
                          - STD
                          - SYP
                          - SZL
                          - THB
                          - TJS
                          - TMT
                          - TND
                          - TOP
                          - TRY
                          - TTD
                          - TWD
                          - TZS
                          - UAH
                          - UGX
                          - UYU
                          - UZS
                          - VEF
                          - VND
                          - VUV
                          - WST
                          - YER
                          - ZAR
                          - ZMW
                          - ZWL
                        description: >-
                          Currency code. See [ISO
                          4217](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes).
                        example: EUR
                      exchange_rate:
                        type:
                          - number
                          - 'null'
                    required:
                      - amount
                      - currency
                      - exchange_rate
                    description: >-
                      Fee applied by the Payment Service Provider. Only
                      supported for Stripe.
                    example: null
                  chargeback:
                    type:
                      - object
                      - 'null'
                    properties:
                      amount:
                        type: number
                        description: Total chargeback loss amount.
                        example: 31500
                      last_chargeback_at:
                        type: string
                        format: date-time
                        description: Date corresponding to the last chargeback loss event.
                        example: '2024-10-13T10:00:01.860Z'
                    required:
                      - amount
                      - last_chargeback_at
                    description: Chargeback details related to the transaction.
                    example: null
                  integrations:
                    type: array
                    items:
                      type: object
                      properties:
                        entity_id:
                          type: string
                          description: ID of the entity in the provider.
                        provider_name:
                          type: string
                          enum:
                            - adyen
                            - stripe
                            - mollie
                            - gocardless
                            - airwallex
                            - salesforce
                            - hubspot
                            - attio
                            - xero
                            - pennylane
                            - zoho-books
                            - exact-online
                            - quickbooks
                            - netsuite
                            - anrok
                            - chargebee
                            - slack
                            - plain
                            - zendesk
                            - pylon
                            - intercom
                            - claap
                          description: Provider name.
                        provider_account_id:
                          type: string
                          description: ID of the connected provider account.
                      required:
                        - entity_id
                        - provider_name
                        - provider_account_id
                      description: Reference to the entity in an external provider.
                      example:
                        entity_id: '123456789'
                        provider_name: stripe
                        provider_account_id: acc_1234567890
                required:
                  - id
                  - type
                  - amount
                  - currency
                  - customer_id
                  - provider_id
                  - process_at
                  - refunded_at
                  - last_refreshed_at
                  - provider_fee
                  - chargeback
                  - integrations
              - oneOf:
                  - type: object
                    properties:
                      payment_method_type:
                        type: string
                        enum:
                          - card
                          - direct_debit
                          - direct_debit_ach
                          - direct_debit_bacs
                      payment_method:
                        $ref: '#/components/schemas/PaymentMethod'
                    required:
                      - payment_method_type
                      - payment_method
                  - type: object
                    properties:
                      payment_method_type:
                        type: string
                        enum:
                          - transfer
                          - transfer_automated
                      bank_account:
                        allOf:
                          - $ref: '#/components/schemas/BankAccount'
                          - anyOf:
                              - allOf:
                                  - type: object
                                    properties:
                                      id:
                                        type: string
                                        description: Bank account ID.
                                        example: bac_KJyPrMA1toAqRG
                                      currency:
                                        type: string
                                        enum:
                                          - EUR
                                          - AED
                                          - AFN
                                          - XCD
                                          - ALL
                                          - AMD
                                          - AOA
                                          - ARS
                                          - USD
                                          - AUD
                                          - AWG
                                          - AZN
                                          - BAM
                                          - BBD
                                          - BDT
                                          - BGN
                                          - BHD
                                          - BIF
                                          - XOF
                                          - BMD
                                          - BND
                                          - BOB
                                          - BRL
                                          - BSD
                                          - BTN
                                          - NOK
                                          - BWP
                                          - BYR
                                          - BZD
                                          - CAD
                                          - CDF
                                          - XAF
                                          - CHF
                                          - NZD
                                          - CLP
                                          - CNY
                                          - COP
                                          - CRC
                                          - CUP
                                          - CVE
                                          - ANG
                                          - CZK
                                          - DJF
                                          - DKK
                                          - DOP
                                          - DZD
                                          - EGP
                                          - MAD
                                          - ERN
                                          - ETB
                                          - FJD
                                          - FKP
                                          - GBP
                                          - GEL
                                          - GHS
                                          - GIP
                                          - GMD
                                          - GNF
                                          - GTQ
                                          - GYD
                                          - HKD
                                          - HNL
                                          - HRK
                                          - HTG
                                          - HUF
                                          - IDR
                                          - ILS
                                          - INR
                                          - IQD
                                          - IRR
                                          - ISK
                                          - JMD
                                          - JOD
                                          - JPY
                                          - KES
                                          - KGS
                                          - KHR
                                          - KMF
                                          - KPW
                                          - KRW
                                          - KWD
                                          - KYD
                                          - KZT
                                          - LAK
                                          - LBP
                                          - LKR
                                          - LRD
                                          - LSL
                                          - LYD
                                          - MDL
                                          - MGA
                                          - MKD
                                          - MMK
                                          - MNT
                                          - MOP
                                          - MRO
                                          - MUR
                                          - MVR
                                          - MWK
                                          - MXN
                                          - MYR
                                          - MZN
                                          - NAD
                                          - XPF
                                          - NGN
                                          - NIO
                                          - NPR
                                          - OMR
                                          - PAB
                                          - PEN
                                          - PGK
                                          - PHP
                                          - PKR
                                          - PLN
                                          - PYG
                                          - QAR
                                          - RON
                                          - RSD
                                          - RUB
                                          - RWF
                                          - SAR
                                          - SBD
                                          - SCR
                                          - SDG
                                          - SEK
                                          - SGD
                                          - SHP
                                          - SLL
                                          - SOS
                                          - SRD
                                          - SSP
                                          - STD
                                          - SYP
                                          - SZL
                                          - THB
                                          - TJS
                                          - TMT
                                          - TND
                                          - TOP
                                          - TRY
                                          - TTD
                                          - TWD
                                          - TZS
                                          - UAH
                                          - UGX
                                          - UYU
                                          - UZS
                                          - VEF
                                          - VND
                                          - VUV
                                          - WST
                                          - YER
                                          - ZAR
                                          - ZMW
                                          - ZWL
                                        description: Bank account currency.
                                        example: EUR
                                      bank_name:
                                        type:
                                          - string
                                          - 'null'
                                        description: Bank name.
                                        example: Fake bank
                                    required:
                                      - id
                                      - currency
                                      - bank_name
                                  - anyOf:
                                      - type: object
                                        properties:
                                          format:
                                            type: string
                                            enum:
                                              - iban_bic_swift
                                          iban:
                                            type: string
                                          bic_swift:
                                            type:
                                              - string
                                              - 'null'
                                        required:
                                          - format
                                          - iban
                                          - bic_swift
                                      - type: object
                                        properties:
                                          format:
                                            type: string
                                            enum:
                                              - sort_code_account_number
                                          sort_code:
                                            type: string
                                          account_number:
                                            type: string
                                        required:
                                          - format
                                          - sort_code
                                          - account_number
                                      - type: object
                                        properties:
                                          format:
                                            type: string
                                            enum:
                                              - account_number_routing_number
                                          account_number:
                                            type: string
                                          routing_number:
                                            type: string
                                        required:
                                          - format
                                          - account_number
                                          - routing_number
                                      - type: object
                                        properties:
                                          format:
                                            type: string
                                            enum:
                                              - account_number_bic_swift
                                          account_number:
                                            type: string
                                          bic_swift:
                                            type: string
                                        required:
                                          - format
                                          - account_number
                                          - bic_swift
                                    example:
                                      format: iban_bic_swift
                                      iban: FR76XXXXXXXXXXXXXXXXXXXXXXX
                                      bic_swift: XXXXXXXX
                              - type: 'null'
                    required:
                      - payment_method_type
                      - bank_account
                  - type: object
                    properties:
                      payment_method_type:
                        type: string
                        enum:
                          - wallet
                      wallet_id:
                        type: string
                        example: wal_PPpxP5d3uvgiTT
                    required:
                      - payment_method_type
                      - wallet_id
                  - type: object
                    properties:
                      payment_method_type:
                        type: string
                        enum:
                          - external
                    required:
                      - payment_method_type
              - anyOf:
                  - type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - scheduled
                          - to_process
                          - pending
                          - settled
                          - cancelled
                        description: >-

                          Transaction status.


                          - `scheduled`: The transaction is scheduled to be
                          processed in the future.

                          - `to_process`: The transaction is waiting to be
                          processed by our system.

                          - `pending`: The transaction has been authorized by
                          the related payment processor, but the banking
                          transaction is not yet settled.

                          - `settled`: The transaction has been cleared on the
                          banking side, the money transfer is fully completed.

                          - `cancelled`: The transaction has been cancelled and
                          won't be processed again.
                            
                        example: settled
                    required:
                      - status
                  - type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - failed
                        description: |-

                          Transaction status.

                          - `failed`: The transaction failed.
                            
                        example: failed
                      error_type:
                        type:
                          - string
                          - 'null'
                        enum:
                          - authentication_required
                          - declined
                          - fraud
                          - insufficient_funds
                          - mandate_invalid
                          - payment_method_authorization_error
                          - payment_method_declined
                          - payment_method_expired
                          - payment_method_invalid
                          - payment_method_not_supported
                          - processing_error
                          - provider_error
                          - unknown
                        description: >-

                          Transaction error type.


                          - `authentication_required`: The card was declined as
                          the transaction requires authentication (e.g. 3-D
                          Secure). The customer should go to their portal page
                          and authenticate their card. If the error happened on
                          an already authenticated transaction, the customer
                          needs to contact their card issuer for more
                          information.

                          - `payment_method_authorization_error`: A transaction
                          authorization cannot be created for a variety of
                          reasons such as the card issuer couldn't be reached,
                          or the card requires a PIN.

                          - `payment_method_declined`: The payment method was
                          declined for a variety of reasons such as a card
                          reported as lost or stolen, insufficient funds or
                          reaching the limit available on the method to complete
                          the purchase, a payment method on a known block list,
                          etc.

                          - `payment_method_expired`: The payment method is
                          expired. The customer should go to their portal page
                          and change their payment method.

                          - `payment_method_invalid`: The payment method is
                          invalid in most cases because of incorrect details
                          (card/account number, CVC, expiration date, postal
                          code).

                          - `payment_method_not_supported`: The payment method
                          doesn't support this type of purchase (e.g. currency,
                          online payment).

                          - `declined`: The payment was declined for a variety
                          of reasons such as security violation, banking service
                          not available, transaction not allowed, etc.

                          - `fraud`: The payment provider suspected the
                          transaction was fraudulent and has been blocked. Don't
                          report more detailed information to your customer, and
                          check on your provider account.

                          - `processing_error`: The payment couldn't be
                          processed by the issuer for an unknown reason.

                          - `provider_error`: An error occurred when contacting
                          the payment provider to initiate the transaction.

                          - `unknown`: A generic error happened on the payment
                          provider side.
                            
                        example: null
                      error_message:
                        type:
                          - string
                          - 'null'
                        description: Details of the error.
                        example: null
                    required:
                      - status
                      - error_type
                      - error_message
          description: List of transactions related to the invoice.
        public_url:
          type: string
          format: uri
          description: >-
            Public URL of the invoice page where the customer can pay the
            invoice.
      required:
        - id
        - number
        - type
        - document_name
        - status
        - reference
        - purchase_order
        - currency
        - source
        - total_amount
        - amount_due
        - amount_paid
        - amount_fixed
        - amount_excluding_tax
        - tax_rate
        - tax_amount
        - tax_scheme
        - discount_amount
        - conversion_rate
        - converted_amount
        - converted_at
        - payment_method_id
        - bank_account_id
        - custom_note
        - additional_info
        - footer
        - customer
        - seller
        - subscription_id
        - period_starts_at
        - period_ends_at
        - emitted_at
        - due_at
        - refunded_at
        - grace_period_ended_at
        - settled_at
        - updated_at
        - properties
        - custom_properties
        - original_invoice_id
        - original_invoice_number
        - line_items
        - coupons
        - transactions
        - public_url
    Address:
      type:
        - object
        - 'null'
      properties:
        name:
          type:
            - string
            - 'null'
          description: Address name.
          example: Acme
        line1:
          type:
            - string
            - 'null'
          description: Address first line.
          example: 5 rue de Paradis
        line2:
          type:
            - string
            - 'null'
          description: Address second line (optional).
          example: null
        city:
          type:
            - string
            - 'null'
          description: Address city.
          example: Paris
        zip:
          type:
            - string
            - 'null'
          description: Address ZIP code.
          example: '75010'
        state:
          type:
            - string
            - 'null'
          enum:
            - AA
            - AE
            - AK
            - AL
            - AP
            - AR
            - AS
            - AZ
            - CA
            - CO
            - CT
            - DC
            - DE
            - FL
            - GA
            - GU
            - HI
            - IA
            - ID
            - IL
            - IN
            - KS
            - KY
            - LA
            - MA
            - MD
            - ME
            - MI
            - MN
            - MO
            - MP
            - MS
            - MT
            - NC
            - ND
            - NE
            - NH
            - NJ
            - NM
            - NV
            - NY
            - OH
            - OK
            - OR
            - PA
            - PR
            - RI
            - SC
            - SD
            - TN
            - TX
            - UT
            - VA
            - VI
            - VT
            - WA
            - WI
            - WV
            - WY
          description: >-
            Only for US country. Second part of subdivision code in ISO format.
            See [ISO 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US).
          example: CA
        country:
          type:
            - string
            - 'null'
          enum:
            - AD
            - AE
            - AF
            - AG
            - AI
            - AL
            - AM
            - AO
            - AQ
            - AR
            - AS
            - AT
            - AU
            - AW
            - AX
            - AZ
            - BA
            - BB
            - BD
            - BE
            - BG
            - BH
            - BI
            - BJ
            - BL
            - BM
            - BN
            - BO
            - BQ
            - BR
            - BS
            - BT
            - BF
            - BV
            - BW
            - BY
            - BZ
            - CA
            - CC
            - CD
            - CF
            - CG
            - CH
            - CI
            - CK
            - CL
            - CM
            - CN
            - CO
            - CR
            - CU
            - CV
            - CW
            - CX
            - CY
            - CZ
            - DE
            - DJ
            - DK
            - DM
            - DO
            - DZ
            - EC
            - EE
            - EG
            - EH
            - ER
            - ES
            - ET
            - FI
            - FJ
            - FK
            - FM
            - FO
            - FR
            - GA
            - GB
            - GD
            - GE
            - GF
            - GG
            - GH
            - GI
            - GL
            - GM
            - GN
            - GP
            - GQ
            - GR
            - GS
            - GT
            - GU
            - GW
            - GY
            - HK
            - HM
            - HN
            - HR
            - HT
            - HU
            - IC
            - ID
            - IE
            - IL
            - IM
            - IN
            - IO
            - IQ
            - IR
            - IS
            - IT
            - JE
            - JM
            - JO
            - JP
            - KE
            - KG
            - KH
            - KI
            - KM
            - KN
            - KP
            - KR
            - KW
            - KY
            - KZ
            - LA
            - LB
            - LC
            - LI
            - LK
            - LR
            - LS
            - LT
            - LU
            - LV
            - LY
            - MA
            - MC
            - MD
            - ME
            - MF
            - MG
            - MH
            - MK
            - ML
            - MM
            - MN
            - MO
            - MP
            - MQ
            - MR
            - MS
            - MT
            - MU
            - MV
            - MW
            - MX
            - MY
            - MZ
            - NA
            - NC
            - NE
            - NF
            - NG
            - NI
            - NL
            - 'NO'
            - NP
            - NR
            - NU
            - NZ
            - OM
            - PA
            - PE
            - PF
            - PG
            - PH
            - PK
            - PL
            - PM
            - PN
            - PR
            - PS
            - PT
            - PT-20
            - PT-30
            - PW
            - PY
            - QA
            - RE
            - RO
            - RS
            - RU
            - RW
            - SA
            - SB
            - SC
            - SD
            - SE
            - SG
            - SH
            - SI
            - SJ
            - SK
            - SL
            - SM
            - SN
            - SO
            - SR
            - SS
            - ST
            - SV
            - SX
            - SY
            - SZ
            - TC
            - TD
            - TF
            - TG
            - TH
            - TJ
            - TK
            - TL
            - TM
            - TN
            - TO
            - TR
            - TT
            - TV
            - TW
            - TZ
            - UA
            - UG
            - UM
            - US
            - UY
            - UZ
            - VA
            - VC
            - VE
            - VG
            - VI
            - VN
            - VU
            - WF
            - WS
            - XK
            - YE
            - YT
            - ZA
            - ZM
            - ZW
          description: >-
            Two-letter country code in ISO format. See [ISO 3166-1
            alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
          example: FR
      description: Customer billing address.
    InvoiceLineItem:
      type: object
      properties:
        id:
          type: string
          description: Invoice line item ID.
          example: ili_0FACNpeoEFkGu3
        name:
          type: string
          description: Name of the line item, corresponding to the related product.
          example: Platform access
        entry_type:
          type: string
          enum:
            - debit
            - credit
          description: Indicates whether the line item is a debit or credit.
          example: debit
        product_id:
          type:
            - string
            - 'null'
          description: Product ID related to the invoice line item.
          example: itm_KbLcWt2qm5p1S2
        product_type:
          type:
            - string
            - 'null'
          enum:
            - flat_fee
            - seat
            - dynamic
            - credit
            - bundle
          description: Product type related to the invoice line item.
          example: flat_fee
        units_count:
          type: number
          description: Count of units of the product related to the invoice line item.
          example: 1
        unit_amount:
          type: number
          description: >-
            Amount of one unit of the product related to the invoice line item.
            Expressed in currency's smallest unit.
          example: 24000
        amount:
          type: number
          description: >-
            Total amount of the invoice line item. Debit or credit can be
            distinguished using the `entry_type` field. Expressed in currency's
            smallest unit.
          example: 24000
        amount_excluding_tax:
          type: number
          description: >-
            Total amount without the taxes amount of the invoice line item.
            Expressed in currency's smallest unit.
          example: 20000
        tax_rate:
          type: number
          description: Tax rate of the invoice line item.
          example: 20
        tax_rate_id:
          type:
            - string
            - 'null'
          description: Custom tax rate ID applied to the invoice line item.
          example: null
        tax_amount:
          type: number
          description: >-
            Tax amount of the invoice line item. Expressed in currency's
            smallest unit.
          example: 4000
        discount_amount:
          type: number
          description: >-
            Amount corresponding to the discounted part of the total amount of
            the invoice line item. Expressed in currency's smallest unit.
          example: 0
        discount_percent:
          type:
            - number
            - 'null'
          description: >-
            Percentage applied to compute the discounted part of the invoice
            line amount. Only if coupons applied are percentage based.
        period_starts_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Start date of the period corresponding to the line item charge.
          example: '2024-10-13T00:00:00.000Z'
        period_ends_at:
          type:
            - string
            - 'null'
          format: date-time
          description: End date of the period corresponding to the line item charge.
          example: '2024-11-13T00:00:00.000Z'
        revenue_type:
          type:
            - string
            - 'null'
          enum:
            - recurring
            - variable
            - one_off
          description: >-
            Revenue type classification of the line item.


            - `recurring`: Recurring revenue (MRR) from subscription products
            billed at regular intervals.

            - `variable`: Variable revenue from usage-based products.

            - `one_off`: One-time revenue from single charges or products billed
            once.
          example: recurring
        revenue_interval_count:
          type:
            - number
            - 'null'
          description: >-
            For recurring revenue, the number of interval periods between
            billings (e.g., 1 for monthly, 12 for annual).
          example: 1
        revenue_interval_period:
          type:
            - string
            - 'null'
          enum:
            - days
            - weeks
            - months
            - quarters
            - years
            - once
            - all
          description: >-
            For recurring revenue, the interval period (days, weeks, months,
            quarters, years).
          example: months
        display_unit_amount:
          type: boolean
          description: >-
            Whether the unit amount is displayed on the invoice PDF. Defaults to
            true.
          example: true
        display_service_period:
          type: boolean
          description: >-
            Whether the service period dates are displayed in the line item
            description on the invoice PDF. Defaults to true.
          example: true
        original_line_item_id:
          type:
            - string
            - 'null'
          description: >-
            ID of the original line item this line item is linked to (used for
            organisation-based billing).
          example: null
      required:
        - id
        - name
        - entry_type
        - product_id
        - product_type
        - units_count
        - unit_amount
        - amount
        - amount_excluding_tax
        - tax_rate
        - tax_rate_id
        - tax_amount
        - discount_amount
        - discount_percent
        - period_starts_at
        - period_ends_at
        - revenue_type
        - revenue_interval_count
        - revenue_interval_period
        - display_unit_amount
        - display_service_period
        - original_line_item_id
    InvoiceCoupon:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: Coupon ID.
          example: cou_DKL4Xcb5VSa8CQ
        name:
          type:
            - string
            - 'null'
          description: Coupon name.
          example: Partner discount
        discount_amount:
          type:
            - number
            - 'null'
          description: >-
            Amount to apply as a discount on the total amount (excluding taxes)
            of a subscription. Expressed in the currency's smallest unit.
          example: 2000
        discount_percent:
          type:
            - number
            - 'null'
          description: >-
            Percentage to apply as a discount on the amount (excluding taxes) of
            a product.
          example: null
        line_item_ids:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            IDs of the line items to which the coupon applies. Null means all
            line items.
          example:
            - ili_0FACNpeoEFkGu3
      required:
        - id
        - name
        - discount_amount
        - discount_percent
        - line_item_ids
    PaymentMethod:
      anyOf:
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - active
                - pending
                - expired
                - errored
              description: >-

                Payment method status.


                - `active`: The payment method is ready to be used.

                - `pending`: The payment method is pending activation or being
                validated.
                  
              example: active
            type:
              type: string
              enum:
                - card
                - apple_pay
                - google_pay
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: card
            last_4_digits:
              type:
                - number
                - 'null'
              description: Last four digits of the card.
              example: 2718
            expiration_date:
              type:
                - string
                - 'null'
              description: Expiration date of the card using YYYY-MM format.
              example: 2027-11
            brand:
              type:
                - string
                - 'null'
              description: Brand of the card.
              examples:
                - visa
                - mastercard
                - amex
          required:
            - id
            - status
            - type
            - last_4_digits
            - expiration_date
            - brand
          title: Card
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - errored
              description: >-

                Payment method status.


                - `errored`: The payment method has failed and can no longer be
                used.
                  
              example: errored
            error_type:
              type: string
              enum:
                - authentication_required
                - authorization_error
                - insufficient_funds
                - declined
                - expired
                - fraud
                - invalid
                - mandate_invalid
                - not_supported
                - unknown
              description: >-

                Payment method error type.


                - `authentication_required`: The card was declined as the
                transaction requires authentication (e.g. 3-D Secure). The
                customer should go to their portal page and authenticate their
                card. If the error happened on an already authenticated
                transaction, the customer needs to contact their card issuer for
                more information.

                - `authorization_error`: A transaction authorization cannot be
                created for a variety of reasons such as the card issuer
                couldn't be reached, or the card requires a PIN.

                - `declined`: The payment method was declined for a variety of
                reasons such as a card reported as lost or stolen, insufficient
                funds or reaching the limit available on the method to complete
                the purchase, a payment method on a known block list, etc.

                - `expired`: The payment method is expired. The customer should
                go to their portal page and change their payment method.

                - `fraud`: The payment provider suspected the payment method was
                fraudulent and has been blocked. Don't report more detailed
                information to your customer, and check on your provider
                account.

                - `invalid`: The payment method is invalid in most cases because
                of incorrect details (card/account number, CVC, expiration date,
                postal code).

                - `not_supported`: The payment method doesn't support this type
                of purchase (e.g. currency, online payment).

                - `unknown`: A generic error happened on the payment provider
                side.
                  
              example: expired
            type:
              type: string
              enum:
                - card
                - apple_pay
                - google_pay
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: card
            last_4_digits:
              type:
                - number
                - 'null'
              description: Last four digits of the card.
              example: 2718
            expiration_date:
              type:
                - string
                - 'null'
              description: Expiration date of the card using YYYY-MM format.
              example: 2027-11
            brand:
              type:
                - string
                - 'null'
              description: Brand of the card.
              examples:
                - visa
                - mastercard
                - amex
          required:
            - id
            - status
            - error_type
            - type
            - last_4_digits
            - expiration_date
            - brand
          title: Card (errored)
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - active
                - pending
                - expired
                - errored
              description: >-

                Payment method status.


                - `active`: The payment method is ready to be used.

                - `pending`: The payment method is pending activation or being
                validated.
                  
              example: active
            type:
              type: string
              enum:
                - direct_debit
                - direct_debit_ach
                - direct_debit_bacs
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: direct_debit
            account_number_ending:
              type:
                - string
                - 'null'
              description: Last characters of the account number.
              example: '6789'
          required:
            - id
            - status
            - type
            - account_number_ending
          title: Direct Debit
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - errored
              description: >-

                Payment method status.


                - `errored`: The payment method has failed and can no longer be
                used.
                  
              example: errored
            error_type:
              type: string
              enum:
                - authentication_required
                - authorization_error
                - insufficient_funds
                - declined
                - expired
                - fraud
                - invalid
                - mandate_invalid
                - not_supported
                - unknown
              description: >-

                Payment method error type.


                - `authentication_required`: The card was declined as the
                transaction requires authentication (e.g. 3-D Secure). The
                customer should go to their portal page and authenticate their
                card. If the error happened on an already authenticated
                transaction, the customer needs to contact their card issuer for
                more information.

                - `authorization_error`: A transaction authorization cannot be
                created for a variety of reasons such as the card issuer
                couldn't be reached, or the card requires a PIN.

                - `declined`: The payment method was declined for a variety of
                reasons such as a card reported as lost or stolen, insufficient
                funds or reaching the limit available on the method to complete
                the purchase, a payment method on a known block list, etc.

                - `expired`: The payment method is expired. The customer should
                go to their portal page and change their payment method.

                - `fraud`: The payment provider suspected the payment method was
                fraudulent and has been blocked. Don't report more detailed
                information to your customer, and check on your provider
                account.

                - `invalid`: The payment method is invalid in most cases because
                of incorrect details (card/account number, CVC, expiration date,
                postal code).

                - `not_supported`: The payment method doesn't support this type
                of purchase (e.g. currency, online payment).

                - `unknown`: A generic error happened on the payment provider
                side.
                  
              example: expired
            type:
              type: string
              enum:
                - direct_debit
                - direct_debit_ach
                - direct_debit_bacs
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: direct_debit
            account_number_ending:
              type:
                - string
                - 'null'
              description: Last characters of the account number.
              example: '6789'
          required:
            - id
            - status
            - error_type
            - type
            - account_number_ending
          title: Direct Debit (errored)
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - active
                - pending
                - expired
                - errored
              description: >-

                Payment method status.


                - `active`: The payment method is ready to be used.

                - `pending`: The payment method is pending activation or being
                validated.
                  
              example: active
            type:
              type: string
              enum:
                - stripe_link
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: stripe_link
          required:
            - id
            - status
            - type
          title: Stripe Link
        - type: object
          properties:
            id:
              type: string
              description: Payment method ID.
              example: pm_1xMpj5bwRqN7LM
            status:
              type: string
              enum:
                - errored
              description: >-

                Payment method status.


                - `errored`: The payment method has failed and can no longer be
                used.
                  
              example: errored
            error_type:
              type: string
              enum:
                - authentication_required
                - authorization_error
                - insufficient_funds
                - declined
                - expired
                - fraud
                - invalid
                - mandate_invalid
                - not_supported
                - unknown
              description: >-

                Payment method error type.


                - `authentication_required`: The card was declined as the
                transaction requires authentication (e.g. 3-D Secure). The
                customer should go to their portal page and authenticate their
                card. If the error happened on an already authenticated
                transaction, the customer needs to contact their card issuer for
                more information.

                - `authorization_error`: A transaction authorization cannot be
                created for a variety of reasons such as the card issuer
                couldn't be reached, or the card requires a PIN.

                - `declined`: The payment method was declined for a variety of
                reasons such as a card reported as lost or stolen, insufficient
                funds or reaching the limit available on the method to complete
                the purchase, a payment method on a known block list, etc.

                - `expired`: The payment method is expired. The customer should
                go to their portal page and change their payment method.

                - `fraud`: The payment provider suspected the payment method was
                fraudulent and has been blocked. Don't report more detailed
                information to your customer, and check on your provider
                account.

                - `invalid`: The payment method is invalid in most cases because
                of incorrect details (card/account number, CVC, expiration date,
                postal code).

                - `not_supported`: The payment method doesn't support this type
                of purchase (e.g. currency, online payment).

                - `unknown`: A generic error happened on the payment provider
                side.
                  
              example: expired
            type:
              type: string
              enum:
                - stripe_link
              description: |-

                Payment method type.

                - `card`: Credit or debit card
                - `apple_pay`: Apple Pay
                - `google_pay`: Google Pay
                - `direct_debit_sepa`: SEPA Direct Debit
                - `direct_debit_ach`: ACH Direct Debit
                - `direct_debit_bacs`: Bacs Direct Debit
                - `stripe_link`: Stripe Link
                  
              example: stripe_link
          required:
            - id
            - status
            - error_type
            - type
          title: Stripe Link (errored)
        - type: 'null'
    BankAccount:
      allOf:
        - type: object
          properties:
            id:
              type: string
              description: Bank account ID.
              example: bac_KJyPrMA1toAqRG
            currency:
              type: string
              enum:
                - EUR
                - AED
                - AFN
                - XCD
                - ALL
                - AMD
                - AOA
                - ARS
                - USD
                - AUD
                - AWG
                - AZN
                - BAM
                - BBD
                - BDT
                - BGN
                - BHD
                - BIF
                - XOF
                - BMD
                - BND
                - BOB
                - BRL
                - BSD
                - BTN
                - NOK
                - BWP
                - BYR
                - BZD
                - CAD
                - CDF
                - XAF
                - CHF
                - NZD
                - CLP
                - CNY
                - COP
                - CRC
                - CUP
                - CVE
                - ANG
                - CZK
                - DJF
                - DKK
                - DOP
                - DZD
                - EGP
                - MAD
                - ERN
                - ETB
                - FJD
                - FKP
                - GBP
                - GEL
                - GHS
                - GIP
                - GMD
                - GNF
                - GTQ
                - GYD
                - HKD
                - HNL
                - HRK
                - HTG
                - HUF
                - IDR
                - ILS
                - INR
                - IQD
                - IRR
                - ISK
                - JMD
                - JOD
                - JPY
                - KES
                - KGS
                - KHR
                - KMF
                - KPW
                - KRW
                - KWD
                - KYD
                - KZT
                - LAK
                - LBP
                - LKR
                - LRD
                - LSL
                - LYD
                - MDL
                - MGA
                - MKD
                - MMK
                - MNT
                - MOP
                - MRO
                - MUR
                - MVR
                - MWK
                - MXN
                - MYR
                - MZN
                - NAD
                - XPF
                - NGN
                - NIO
                - NPR
                - OMR
                - PAB
                - PEN
                - PGK
                - PHP
                - PKR
                - PLN
                - PYG
                - QAR
                - RON
                - RSD
                - RUB
                - RWF
                - SAR
                - SBD
                - SCR
                - SDG
                - SEK
                - SGD
                - SHP
                - SLL
                - SOS
                - SRD
                - SSP
                - STD
                - SYP
                - SZL
                - THB
                - TJS
                - TMT
                - TND
                - TOP
                - TRY
                - TTD
                - TWD
                - TZS
                - UAH
                - UGX
                - UYU
                - UZS
                - VEF
                - VND
                - VUV
                - WST
                - YER
                - ZAR
                - ZMW
                - ZWL
              description: Bank account currency.
              example: EUR
            bank_name:
              type:
                - string
                - 'null'
              description: Bank name.
              example: Fake bank
          required:
            - id
            - currency
            - bank_name
        - anyOf:
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - iban_bic_swift
                iban:
                  type: string
                bic_swift:
                  type:
                    - string
                    - 'null'
              required:
                - format
                - iban
                - bic_swift
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - sort_code_account_number
                sort_code:
                  type: string
                account_number:
                  type: string
              required:
                - format
                - sort_code
                - account_number
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - account_number_routing_number
                account_number:
                  type: string
                routing_number:
                  type: string
              required:
                - format
                - account_number
                - routing_number
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - account_number_bic_swift
                account_number:
                  type: string
                bic_swift:
                  type: string
              required:
                - format
                - account_number
                - bic_swift
          example:
            format: iban_bic_swift
            iban: FR76XXXXXXXXXXXXXXXXXXXXXXX
            bic_swift: XXXXXXXX
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````