> ## 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

> Record a settled offline payment, refund, or chargeback in the customer's currency without requiring an invoice.



## OpenAPI

````yaml post /v1/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/transactions:
    post:
      tags:
        - Transactions
      summary: Create transaction
      description: >-
        Record a settled offline payment, refund, or chargeback in the
        customer's currency without requiring an invoice.
      operationId: createTransaction
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    customer_id:
                      type: string
                      description: ID of the customer linked to the transaction.
                      example: cus_QalW2vTAdkR6IY
                    amount:
                      type: integer
                      minimum: 1
                      maximum: 9007199254740991
                      description: >-
                        Positive transaction amount in the customer's currency's
                        smallest unit.
                      example: 31500
                    date:
                      type: string
                      format: date-time
                      description: Date when the offline transaction settled.
                      example: '2024-11-12T07:38:39.222Z'
                    payment_method_type:
                      type: string
                      enum:
                        - transfer
                        - external
                      description: >-
                        Offline payment method: bank transfer or external
                        payment.
                      example: transfer
                    bank_account_id:
                      type: string
                      description: >-
                        Bank account for a transfer, in the customer's currency;
                        not allowed for external payments.
                      example: bac_2QdJDDUej969ev
                    type:
                      type: string
                      enum:
                        - one_time
                      description: Type of offline transaction to record.
                    reference:
                      type: string
                      description: Optional reference identifying the offline payment.
                      example: PAYMENT-2026-001
                  required:
                    - customer_id
                    - amount
                    - date
                    - payment_method_type
                    - type
                - type: object
                  properties:
                    customer_id:
                      type: string
                      description: ID of the customer linked to the transaction.
                      example: cus_QalW2vTAdkR6IY
                    amount:
                      type: integer
                      minimum: 1
                      maximum: 9007199254740991
                      description: >-
                        Positive transaction amount in the customer's currency's
                        smallest unit.
                      example: 31500
                    date:
                      type: string
                      format: date-time
                      description: Date when the offline transaction settled.
                      example: '2024-11-12T07:38:39.222Z'
                    payment_method_type:
                      type: string
                      enum:
                        - transfer
                        - external
                      description: >-
                        Offline payment method: bank transfer or external
                        payment.
                      example: transfer
                    bank_account_id:
                      type: string
                      description: >-
                        Bank account for a transfer, in the customer's currency;
                        not allowed for external payments.
                      example: bac_2QdJDDUej969ev
                    type:
                      type: string
                      enum:
                        - refund
                      description: Type of offline transaction to record.
                    original_transaction_id:
                      type: string
                      description: >-
                        Original payment transaction ID for a refund or
                        chargeback.
                      example: tra_2QdJDDUej969ev
                  required:
                    - customer_id
                    - amount
                    - date
                    - payment_method_type
                    - type
                - type: object
                  properties:
                    customer_id:
                      type: string
                      description: ID of the customer linked to the transaction.
                      example: cus_QalW2vTAdkR6IY
                    amount:
                      type: integer
                      minimum: 1
                      maximum: 9007199254740991
                      description: >-
                        Positive transaction amount in the customer's currency's
                        smallest unit.
                      example: 31500
                    date:
                      type: string
                      format: date-time
                      description: Date when the offline transaction settled.
                      example: '2024-11-12T07:38:39.222Z'
                    type:
                      type: string
                      enum:
                        - chargeback
                      description: Type of offline transaction to record.
                    original_transaction_id:
                      type: string
                      description: >-
                        Original payment transaction ID for a refund or
                        chargeback.
                      example: tra_2QdJDDUej969ev
                  required:
                    - customer_id
                    - amount
                    - date
                    - type
                    - original_transaction_id
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                anyOf:
                  - allOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            description: Transaction ID.
                            example: tra_2QdJDDUej969ev
                          type:
                            type: string
                            enum:
                              - subscription
                              - one_time
                            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.

                              - `chargeback`: The transaction records funds
                              withdrawn after a payment dispute.
                                
                            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'
                          settled_at:
                            type:
                              - string
                              - 'null'
                            format: date-time
                            description: >-
                              Date when the transaction was settled. For
                              provider transactions, this is derived from
                              provider settlement data when available.
                            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
                          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
                                    - rillet
                                    - datev
                                    - anrok
                                    - chargebee
                                    - slack
                                    - plain
                                    - zendesk
                                    - pylon
                                    - intercom
                                    - front
                                    - helpscout
                                    - claap
                                    - grain
                                    - gong
                                    - jiminny
                                    - posthog
                                  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
                          allocations:
                            type: array
                            items:
                              type: object
                              properties:
                                invoice_id:
                                  type: string
                                  description: >-
                                    ID of the invoice receiving the allocated
                                    amount.
                                  example: inv_2QdJDDUej969ev
                                amount:
                                  type: number
                                  description: >-
                                    Transaction amount allocated to the invoice,
                                    in the currency's smallest unit.
                                  example: 31500
                              required:
                                - invoice_id
                                - amount
                            description: >-
                              Invoice allocations currently associated with the
                              transaction.
                        required:
                          - id
                          - type
                          - amount
                          - currency
                          - customer_id
                          - provider_id
                          - process_at
                          - settled_at
                          - refunded_at
                          - last_refreshed_at
                          - provider_fee
                          - integrations
                          - allocations
                      - oneOf:
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - card
                                  - direct_debit
                                  - direct_debit_ach
                                  - direct_debit_bacs
                                description: Payment method type used for the transaction.
                              payment_method:
                                $ref: '#/components/schemas/PaymentMethod'
                            required:
                              - payment_method_type
                              - payment_method
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - transfer
                                  - transfer_automated
                                description: Payment method type used for the transaction.
                              bank_account:
                                allOf:
                                  - $ref: '#/components/schemas/BankAccount'
                                  - anyOf:
                                      - $ref: '#/components/schemas/StandardBankAccount'
                                      - $ref: >-
                                          #/components/schemas/ConnectedBankAccount
                                      - type: 'null'
                                    description: >-
                                      Bank account used for a bank transfer
                                      transaction.
                            required:
                              - payment_method_type
                              - bank_account
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - wallet
                                description: Payment method type used for the transaction.
                              wallet_id:
                                type: string
                                description: >-
                                  ID of the wallet used for a wallet
                                  transaction.
                                example: wal_PPpxP5d3uvgiTT
                            required:
                              - payment_method_type
                              - wallet_id
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - external
                                description: Payment method type used for the transaction.
                            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
                    title: Payment
                  - allOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            description: Transaction ID.
                            example: tra_2QdJDDUej969ev
                          type:
                            type: string
                            enum:
                              - 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.

                              - `chargeback`: The transaction records funds
                              withdrawn after a payment dispute.
                                
                            example: refund
                          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'
                          settled_at:
                            type:
                              - string
                              - 'null'
                            format: date-time
                            description: >-
                              Date when the transaction was settled. For
                              provider transactions, this is derived from
                              provider settlement data when available.
                            example: '2024-11-12T07:38:39.222Z'
                          original_transaction_id:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Original payment transaction ID for a refund or
                              chargeback.
                            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
                          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
                                    - rillet
                                    - datev
                                    - anrok
                                    - chargebee
                                    - slack
                                    - plain
                                    - zendesk
                                    - pylon
                                    - intercom
                                    - front
                                    - helpscout
                                    - claap
                                    - grain
                                    - gong
                                    - jiminny
                                    - posthog
                                  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
                          allocations:
                            type: array
                            items:
                              type: object
                              properties:
                                invoice_id:
                                  type: string
                                  description: >-
                                    ID of the invoice receiving the allocated
                                    amount.
                                  example: inv_2QdJDDUej969ev
                                amount:
                                  type: number
                                  description: >-
                                    Transaction amount allocated to the invoice,
                                    in the currency's smallest unit.
                                  example: 31500
                              required:
                                - invoice_id
                                - amount
                            description: >-
                              Invoice allocations currently associated with the
                              transaction.
                        required:
                          - id
                          - type
                          - amount
                          - currency
                          - customer_id
                          - provider_id
                          - process_at
                          - settled_at
                          - original_transaction_id
                          - last_refreshed_at
                          - provider_fee
                          - integrations
                          - allocations
                      - oneOf:
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - card
                                  - direct_debit
                                  - direct_debit_ach
                                  - direct_debit_bacs
                                description: Payment method type used for the transaction.
                              payment_method:
                                $ref: '#/components/schemas/PaymentMethod'
                            required:
                              - payment_method_type
                              - payment_method
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - transfer
                                  - transfer_automated
                                description: Payment method type used for the transaction.
                              bank_account:
                                allOf:
                                  - $ref: '#/components/schemas/BankAccount'
                                  - anyOf:
                                      - $ref: '#/components/schemas/StandardBankAccount'
                                      - $ref: >-
                                          #/components/schemas/ConnectedBankAccount
                                      - type: 'null'
                                    description: >-
                                      Bank account used for a bank transfer
                                      transaction.
                            required:
                              - payment_method_type
                              - bank_account
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - wallet
                                description: Payment method type used for the transaction.
                              wallet_id:
                                type: string
                                description: >-
                                  ID of the wallet used for a wallet
                                  transaction.
                                example: wal_PPpxP5d3uvgiTT
                            required:
                              - payment_method_type
                              - wallet_id
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - external
                                description: Payment method type used for the transaction.
                            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
                    title: Refund
                  - allOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            description: Transaction ID.
                            example: tra_2QdJDDUej969ev
                          type:
                            type: string
                            enum:
                              - chargeback
                            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.

                              - `chargeback`: The transaction records funds
                              withdrawn after a payment dispute.
                                
                            example: chargeback
                          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'
                          settled_at:
                            type:
                              - string
                              - 'null'
                            format: date-time
                            description: >-
                              Date when the transaction was settled. For
                              provider transactions, this is derived from
                              provider settlement data when available.
                            example: '2024-11-12T07:38:39.222Z'
                          original_transaction_id:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Original payment transaction ID for a refund or
                              chargeback.
                            example: null
                          reversed_at:
                            type:
                              - string
                              - 'null'
                            format: date-time
                            description: Date when a chargeback withdrawal was reversed.
                            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
                          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
                                    - rillet
                                    - datev
                                    - anrok
                                    - chargebee
                                    - slack
                                    - plain
                                    - zendesk
                                    - pylon
                                    - intercom
                                    - front
                                    - helpscout
                                    - claap
                                    - grain
                                    - gong
                                    - jiminny
                                    - posthog
                                  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
                          allocations:
                            type: array
                            items:
                              type: object
                              properties:
                                invoice_id:
                                  type: string
                                  description: >-
                                    ID of the invoice receiving the allocated
                                    amount.
                                  example: inv_2QdJDDUej969ev
                                amount:
                                  type: number
                                  description: >-
                                    Transaction amount allocated to the invoice,
                                    in the currency's smallest unit.
                                  example: 31500
                              required:
                                - invoice_id
                                - amount
                            description: >-
                              Invoice allocations currently associated with the
                              transaction.
                        required:
                          - id
                          - type
                          - amount
                          - currency
                          - customer_id
                          - provider_id
                          - process_at
                          - settled_at
                          - original_transaction_id
                          - reversed_at
                          - last_refreshed_at
                          - provider_fee
                          - integrations
                          - allocations
                      - oneOf:
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - card
                                  - direct_debit
                                  - direct_debit_ach
                                  - direct_debit_bacs
                                description: Payment method type used for the transaction.
                              payment_method:
                                $ref: '#/components/schemas/PaymentMethod'
                            required:
                              - payment_method_type
                              - payment_method
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - transfer
                                  - transfer_automated
                                description: Payment method type used for the transaction.
                              bank_account:
                                allOf:
                                  - $ref: '#/components/schemas/BankAccount'
                                  - anyOf:
                                      - $ref: '#/components/schemas/StandardBankAccount'
                                      - $ref: >-
                                          #/components/schemas/ConnectedBankAccount
                                      - type: 'null'
                                    description: >-
                                      Bank account used for a bank transfer
                                      transaction.
                            required:
                              - payment_method_type
                              - bank_account
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - wallet
                                description: Payment method type used for the transaction.
                              wallet_id:
                                type: string
                                description: >-
                                  ID of the wallet used for a wallet
                                  transaction.
                                example: wal_PPpxP5d3uvgiTT
                            required:
                              - payment_method_type
                              - wallet_id
                          - type: object
                            properties:
                              payment_method_type:
                                type: string
                                enum:
                                  - external
                                description: Payment method type used for the transaction.
                            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
                    title: Chargeback
        '400':
          description: Invalid offline transaction.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '404':
          description: Customer, bank account, or original transaction not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
      security:
        - bearer: []
components:
  schemas:
    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'
      description: Payment method used for a card or direct debit transaction.
    BankAccount:
      anyOf:
        - $ref: '#/components/schemas/StandardBankAccount'
        - $ref: '#/components/schemas/ConnectedBankAccount'
    StandardBankAccount:
      allOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - standard
              description: |
                Bank account type.

                - `standard`: Bank account not connected through open banking.
                - `connected`: Bank account connected through open banking.
              example: standard
          required:
            - type
        - 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
            name:
              type:
                - string
                - 'null'
              description: Bank account display name.
              example: Main account
            country:
              type:
                - string
                - 'null'
              description: Bank account country.
              example: FR
          required:
            - id
            - currency
            - bank_name
            - name
            - country
        - anyOf:
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - iban_bic_swift
                  description: Bank account details format.
                  example: iban_bic_swift
                iban:
                  type: string
                  description: IBAN.
                  example: FR7630006000011234567890189
                bic_swift:
                  type:
                    - string
                    - 'null'
                  description: BIC or SWIFT code.
                  example: BNPAFRPP
              required:
                - format
                - iban
                - bic_swift
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - sort_code_account_number
                  description: Bank account details format.
                  example: sort_code_account_number
                sort_code:
                  type: string
                  description: Sort code.
                  example: '123456'
                account_number:
                  type: string
                  description: Account number.
                  example: '000123456789'
              required:
                - format
                - sort_code
                - account_number
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - account_number_routing_number
                  description: Bank account details format.
                  example: account_number_routing_number
                account_number:
                  type: string
                  description: Account number.
                  example: '000123456789'
                routing_number:
                  type: string
                  description: Routing number.
                  example: '021000021'
              required:
                - format
                - account_number
                - routing_number
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - account_number_bic_swift
                  description: Bank account details format.
                  example: account_number_bic_swift
                account_number:
                  type: string
                  description: Account number.
                  example: '000123456789'
                bic_swift:
                  type: string
                  description: BIC or SWIFT code.
                  example: BNPAFRPP
              required:
                - format
                - account_number
                - bic_swift
          example:
            format: iban_bic_swift
            iban: FR7630006000011234567890189
            bic_swift: BNPAFRPP
    ConnectedBankAccount:
      allOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - connected
              description: |
                Bank account type.

                - `standard`: Bank account not connected through open banking.
                - `connected`: Bank account connected through open banking.
              example: connected
            status:
              type: string
              enum:
                - active
                - error
              description: Bank account connection status.
              example: active
            balance:
              type:
                - number
                - 'null'
              description: >-
                Latest known balance for connected bank accounts, expressed in
                the currency's smallest unit.
              example: 120500
            last_refreshed_at:
              type:
                - string
                - 'null'
              format: date-time
              description: Date when the connected bank account was last refreshed.
              example: '2026-01-15T10:30:00.000Z'
            last_error_type:
              type:
                - string
                - 'null'
              enum:
                - provider_error
                - invalid_credentials
                - unknown
              description: Latest connection error type, when the account is errored.
              example: null
          required:
            - type
            - status
            - balance
            - last_refreshed_at
            - last_error_type
        - 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
            name:
              type:
                - string
                - 'null'
              description: Bank account display name.
              example: Main account
            country:
              type:
                - string
                - 'null'
              description: Bank account country.
              example: FR
          required:
            - id
            - currency
            - bank_name
            - name
            - country
        - anyOf:
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - iban_bic_swift
                  description: Bank account details format.
                  example: iban_bic_swift
                iban:
                  type: string
                  description: IBAN.
                  example: FR7630006000011234567890189
                bic_swift:
                  type:
                    - string
                    - 'null'
                  description: BIC or SWIFT code.
                  example: BNPAFRPP
              required:
                - format
                - iban
                - bic_swift
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - sort_code_account_number
                  description: Bank account details format.
                  example: sort_code_account_number
                sort_code:
                  type: string
                  description: Sort code.
                  example: '123456'
                account_number:
                  type: string
                  description: Account number.
                  example: '000123456789'
              required:
                - format
                - sort_code
                - account_number
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - account_number_routing_number
                  description: Bank account details format.
                  example: account_number_routing_number
                account_number:
                  type: string
                  description: Account number.
                  example: '000123456789'
                routing_number:
                  type: string
                  description: Routing number.
                  example: '021000021'
              required:
                - format
                - account_number
                - routing_number
            - type: object
              properties:
                format:
                  type: string
                  enum:
                    - account_number_bic_swift
                  description: Bank account details format.
                  example: account_number_bic_swift
                account_number:
                  type: string
                  description: Account number.
                  example: '000123456789'
                bic_swift:
                  type: string
                  description: BIC or SWIFT code.
                  example: BNPAFRPP
              required:
                - format
                - account_number
                - bic_swift
          example:
            format: iban_bic_swift
            iban: FR7630006000011234567890189
            bic_swift: BNPAFRPP
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````