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

# Refund transaction

> Refund a settled banking transaction for its full amount. The related invoice will switch back to to pay status. Use the create credit note endpoint if you want to cancel (and optionally refund) the initial invoice.



## OpenAPI

````yaml post /v1/transactions/{id}/refund
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/{id}/refund:
    post:
      tags:
        - Transactions
      summary: Refund transaction
      description: >-
        Refund a settled banking transaction for its full amount. The related
        invoice will switch back to to pay status. Use the create credit note
        endpoint if you want to cancel (and optionally refund) the initial
        invoice.
      operationId: refundTransaction
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      responses:
        '200':
          description: The created refund transaction.
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                        description: Transaction ID.
                        example: tra_2QdJDDUej969ev
                      type:
                        type: string
                        enum:
                          - subscription
                          - one_time
                          - refund
                        description: >-

                          Transaction type.


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

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

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

                              Transaction status.


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

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

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

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

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

                              Transaction status.

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

                              Transaction error type.


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

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

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

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

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

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

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

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

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

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

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

````