openapi: 3.1.0
info:
  title: Embed API
  description: |
    Payments infrastructure for software platforms.
  license:
    name: Proprietary
    url: https://embed.co
  version: 2.0.5
  contact:
    name: Embed Support
    email: support@embed.co
servers:
  - url: https://apisbx.fungpayments.com/v2
    description: Sandbox
  - url: https://api.fungpayments.com/v2
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: API keys
    description: Create and manage API keys of your users
  - name: Balance accounts
    description: Create and manage balance accounts to flexibly collect and disburse funds
  - name: Checkouts
    description: Collect payments from customers using [Payment components](/accept-payments/payment-components) or [Payment links](/accept-payments/payment-links)
  - name: Clearing configs
    description: Configure funds clearing for balance accounts
  - name: Documents
    description: Manage documents that are used for onboarding of accounts
  - name: Funding instruments
    description: Create and manage bank details of your customers, used for top-ups and payouts
  - name: Onboarding
    description: Manage the API-based onboarding flow for merchants and legal entities
  - name: Operating accounts
    description: Manage operating accounts to collect payments
  - name: Payment contracts
    description: Create and manage payment contracts recurring payments and usage based billing
  - name: Payment profiles
    description: Create and manage payment profiles controlling the payment methods available on payment links and components
  - name: Payments
    description: Initiate and control the lifecycle of payments
  - name: Payout configs
    description: Manage the frequency and select the destination of balance account payouts
  - name: Payouts
    description: Manage payouts
  - name: Payout reports
    description: Retrieve information about your payouts
  - name: Terminals
    description: Register and manage terminals to accept in person payments
  - name: Notifications
    description: Retrieve webhook notifications, and resend missed notifications generated by Embed
  - name: Themes
    description: Create and manage themes for your payment pages
  - name: Transaction reports
    description: Get information about payments, refunds and other transaction related information
  - name: Users
    description: Manage users of your platform and of your merchants
  - name: 3DS Authentication
    description: Initiate and manage 3DS authentication for card payments
  - name: Reports
    description: Create and manage reports
  - name: Capabilities
    description: Manage capabilities
paths:
  /credential/createApiKey:
    post:
      tags:
        - API keys
      operationId: createApiKey
      summary: Create an API key
      description: Create a new API key for a user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyCreateRequest'
      responses:
        '201':
          description: API key created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyCreateResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /funding-instrument:
    post:
      tags:
        - Funding instruments
      operationId: createFundingInstrument
      summary: Create a funding instrument
      description: Create a new funding instrument
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FundingInstrumentRequest'
      responses:
        '201':
          description: Funding instrument created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundingInstrumentResponse'
              example:
                id: 21210021c2855007efa2d657018
                name: Main Business Account
                type: BANK_ACCOUNT
                status: PENDING
                accountId: 21210021c2855007efa2d657019
                bankAccount:
                  accountNumber: NL91ABNA0417164300
                  accountHolderName: Johan van der Berg
                  bankName: ABN AMRO Bank
                  bankCode: ABNANL2A
                documentIds:
                  - 21210021c2855007efa2d657020
                createdAt: '2024-01-15T10:30:00Z'
                updatedAt: '2024-01-15T10:30:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
    get:
      tags:
        - Funding instruments
      operationId: listFundingInstruments
      summary: List all funding instruments
      description: Retrieve a list of funding instruments, optionally filtered by parent account ID
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/verificationStatus'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/lastKey'
        - $ref: '#/components/parameters/fundingInstrumentIncludesQuery'
      responses:
        '200':
          description: List of funding instruments
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/paginatedResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/FundingInstrumentResponse'
              example:
                data:
                  - id: 21210021c2855007efa2d657018
                    name: Main Business Account
                    type: BANK_ACCOUNT
                    status: VERIFIED
                    accountId: 21210021c2855007efa2d657019
                    bankAccount:
                      accountNumber: NL91ABNA0417164300
                      accountHolderName: Johan van der Berg
                      bankName: ABN AMRO Bank
                      bankCode: ABNANL2A
                    documentIds:
                      - 21210021c2855007efa2d657020
                    createdAt: '2024-01-15T10:30:00Z'
                    updatedAt: '2024-01-15T14:45:00Z'
                  - id: 21210021c2855007efa2d657021
                    name: Secondary Account
                    type: BANK_ACCOUNT
                    status: PENDING
                    accountId: 21210021c2855007efa2d657019
                    bankAccount:
                      accountNumber: NO9386011117947
                      accountHolderName: Erik Hansen
                      bankName: DNB Bank
                      bankCode: DNBANOKK
                    documentIds: []
                    createdAt: '2024-01-16T09:15:00Z'
                    updatedAt: '2024-01-16T09:15:00Z'
                  - id: 21210021c2855007efa2d657022
                    name: German Operations Account
                    type: BANK_ACCOUNT
                    status: VERIFIED
                    accountId: 21210021c2855007efa2d657019
                    bankAccount:
                      accountNumber: DE89370400440532013000
                      accountHolderName: Hans Mueller
                      bankName: Deutsche Bank
                      bankCode: DEUTDEFF
                    documentIds:
                      - 21210021c2855007efa2d657023
                    createdAt: '2024-01-17T11:20:00Z'
                    updatedAt: '2024-01-17T11:20:00Z'
                pagination:
                  lastKey: eyJsYXN0SWQiOiIyMTIxMDAyMWMyODU1MDA3ZWZhMmQ2NTcwMjIiLCJsYXN0Q3JlYXRlZEF0IjoiMjAyNC0wMS0xN1QxMToyMDowMFoifQ==
                  count: 3
                  hasMoreItems: false
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /funding-instrument/{id}:
    get:
      tags:
        - Funding instruments
      operationId: getFundingInstrumentById
      summary: Retrieve a funding instrument
      description: Retrieve a specific funding instrument by its ID
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the funding instrument to retrieve
      responses:
        '200':
          description: Funding instrument details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundingInstrumentResponse'
              example:
                id: 21210021c2855007efa2d657018
                name: Main Business Account
                type: BANK_ACCOUNT
                status: VERIFIED
                accountId: 21210021c2855007efa2d657019
                bankAccount:
                  accountNumber: NL91ABNA0417164300
                  accountHolderName: Johan van der Berg
                  bankName: ABN AMRO Bank
                  bankCode: ABNANL2A
                documentIds:
                  - 21210021c2855007efa2d657020
                createdAt: '2024-01-15T10:30:00Z'
                updatedAt: '2024-01-15T14:45:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
    put:
      tags:
        - Funding instruments
      operationId: updateFundingInstrumentById
      summary: Update a funding instrument
      description: |
        Updates the details of a funding instrument.

        **Note:** A funding instrument can only be updated if it is in `PENDING` or `CHANGES_REQUIRED` status.
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the funding instrument to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FundingInstrumentRequest'
      responses:
        '200':
          description: Funding instrument details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundingInstrumentResponse'
              example:
                id: 21210021c2855007efa2d657018
                name: Updated Business Account
                type: BANK_ACCOUNT
                status: PENDING
                accountId: 21210021c2855007efa2d657019
                bankAccount:
                  accountNumber: NL91ABNA0417164300
                  accountHolderName: Johan van der Berg
                  bankName: ABN AMRO Bank
                  bankCode: ABNANL2A
                documentIds:
                  - 21210021c2855007efa2d657020
                  - 21210021c2855007efa2d657021
                createdAt: '2024-01-15T10:30:00Z'
                updatedAt: '2024-01-16T15:20:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /funding-instrument/{id}/document:
    post:
      tags:
        - Funding instruments
      operationId: addDocumentToFundingInstrument
      summary: Add a document to a funding instrument
      description: Add a document to a funding instrument
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the funding instrument to add a document to
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                documentIds:
                  type: array
                  items:
                    $ref: '#/components/schemas/id'
                  description: The ids of the documents to be associated with the funding instrument
              required:
                - documentIds
            example:
              documentIds:
                - 21210021c2855007efa2d657024
                - 21210021c2855007efa2d657025
      responses:
        '204':
          description: Document added to funding instrument successfully
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payout-config:
    get:
      tags:
        - Payout configs
      operationId: listPayoutConfigs
      summary: List all payout configs
      description: Retrieves a list of payout configs
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/lastKey'
        - $ref: '#/components/parameters/payoutConfigIncludesQuery'
      responses:
        '200':
          description: List of payout configs
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/paginatedResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/PayoutConfigResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
    post:
      tags:
        - Payout configs
      operationId: createPayoutConfig
      summary: Create a payout config
      description: Create a new payout config
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutConfigStandaloneRequest'
      responses:
        '201':
          description: Payout config created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayoutConfigResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payout-config/{id}:
    get:
      tags:
        - Payout configs
      operationId: retrievePayoutConfig
      summary: Retrieve a payout config
      description: Retrieves a specific payout config by its ID
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the payout config to retrieve
        - $ref: '#/components/parameters/payoutConfigIncludesQuery'
      responses:
        '200':
          description: Payout config details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayoutConfigResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
    put:
      tags:
        - Payout configs
      operationId: updatePayoutConfig
      summary: Update a payout config
      description: |
        Updates the details of a payout config.

        **Note:** Changes to the schedule or funding account will have an effect during the next payout cycle.
        To avoid any disruption and delays of payouts, it is recommended to update the payout config in advance.
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the payout config to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutConfigRequest'
      responses:
        '200':
          description: Payout config details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayoutConfigResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /clearing-config:
    get:
      tags:
        - Clearing configs
      operationId: listClearingConfigs
      summary: List all clearing configs
      description: Retrieves a list of clearing configs
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/lastKey'
      responses:
        '200':
          description: List of clearing configs
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/paginatedResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/ClearingConfigResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
    post:
      tags:
        - Clearing configs
      operationId: createClearingConfig
      summary: Create a clearing config
      description: Creates a new clearing config
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClearingConfigCreateRequest'
      responses:
        '200':
          description: Clearing config created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClearingConfigResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /clearing-config/{id}:
    get:
      tags:
        - Clearing configs
      operationId: retrieveClearingConfig
      summary: Retrieve a clearing config
      description: Retrieves a specific clearing config by its ID
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the clearing config to retrieve
      responses:
        '200':
          description: Clearing config details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClearingConfigResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
    put:
      tags:
        - Clearing configs
      operationId: updateClearingConfig
      summary: Update a clearing config
      description: |
        Updates the details of a clearing config.

        **Note:** Changes to the source currencies or clearing currency will have an effect during the next clearing cycle.
        To avoid any disruption and delays of clearing, it is recommended to update the clearing config in advance, and that you've configured clearing config for all currencies
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the clearing config to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClearingConfigUpdateRequest'
      responses:
        '200':
          description: Clearing config details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClearingConfigResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/balance-account/transfer:
    post:
      tags:
        - Balance accounts
      operationId: createBalanceAccountTransfer
      summary: Initiate a transfer from a balance account
      description: Initiate a transfer from a balance account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BalanceAccountTransferRequest'
      responses:
        '201':
          description: Balance account transfer created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceAccountTransferResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/balance-account/initiatePayment:
    post:
      tags:
        - Payments
      operationId: initiateBalanceAccountPayment
      summary: Initiate a payment against a balance account
      description: Initiate a payment against a balance account. The payment will be processed immediately if sufficient funds are available, or will wait for a topup based on the `pendingDays` setting.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitiateBalanceAccountPaymentRequest'
      responses:
        '201':
          description: Balance account payment processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitiateBalanceAccountPaymentResponse'
              examples:
                authorized:
                  summary: Payment authorized and processed immediately
                  value:
                    id: 21210021c2855007efa2d657018
                    status: AUTHORIZED
                    responseMessage: Payment initiated successfully
                    details:
                      balanceAccountId: 21210021c2855007efa2d657018
                      transactionVariant: balanceaccount
                declined:
                  summary: Payment declined
                  value:
                    id: 21210021c2855007efa2d657018
                    status: DECLINED
                    reason: NOT_ENOUGH_BALANCE
                    responseMessage: Insufficient funds
                    details:
                      balanceAccountId: 21210021c2855007efa2d657018
                      transactionVariant: balanceaccount
                pending:
                  summary: Payment pending a topup
                  value:
                    id: 21210021c2855007efa2d657018
                    status: INITIATED
                    responseMessage: Awaiting topup
                    action: PRESENT_DETAILS
                    details:
                      balanceAccountId: 21210021c2855007efa2d657018
                      transactionVariant: balanceaccount
                      amount: 500
                      currencyCode: EUR
                      paymentReference: '1234567890'
                      accountNumber: NL91DEUT0000000000
                      accountNumberType: IBAN
                      accountHolderName: Stichting Custodian Embed
                      bankCode: DEUT2NLAXXX
                      bankCodeType: BIC
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /account/merchant:
    post:
      tags:
        - Merchant accounts
      operationId: createMerchantAccount
      summary: Create a merchant account
      description: |
        Create a new merchant account

        You can provide `legalEntity` details to pre-populate the Legal entity required for Merchant onboarding.

        <scalar-callout
          type="success"
          icon="check-circle">
          For organizations, providing a `legalEntity.registrationNumber` will trigger a lookup in official registers and populate the Legal entity details,
        which can drastically reduce the information required to collect from the Merchant.
        </scalar-callout>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMerchantAccountRequest'
      responses:
        '201':
          description: Merchant account created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateMerchantAccountResponse'
              examples:
                merchantAccount:
                  summary: Merchant account creation response
                  value:
                    id: 21210021c2855007efa2d657018
                    name: Acme Corp
                    legalEntity:
                      id: 21210021c2855007efa2d657018
                      type: ORGANIZATION
                      organization:
                        legalName: Acme Corp
                        type: PRIVATE_LIMITED
                        registrationNumber: '123456789'
                        taxIdNumber: '1234567890'
                        registeredAddress:
                          street: 456 Business Avenue
                          city: Oslo
                          postalCode: '0456'
                          countryCode: 'NO'
                    operatingAccountId: 21210021c2855007efa2d657019
                    users:
                      - email: john.doe@example.com
                        firstName: John
                        lastName: Doe
                        role: ADMIN
                        id: 21210021c2855007efa2d657019
                    capabilities:
                      - type: PAYMENTS
                        status: INACTIVE
                        activePlans: []
                        accountId: 21210021c2855007efa2d657018
                        createdAt: '2025-01-15T10:30:00Z'
                        updatedAt: '2025-01-15T10:30:00Z'
                        plans:
                          - planType: PAYMENTS_LIMITED
                            status: APPROVED
                            constraints:
                              maxProcessingVolume: 1000000
                              endDate: '2025-12-31T23:59:59Z'
                            requirements:
                              - resourceType: LEGAL_ENTITY
                                missing:
                                  - type: FIELD
                                    path: $.organization
                                    message: Official data of the organization
                                  - type: FIELD
                                    path: $.organization.registrationNumber
                                    message: Official registration number
                                  - type: FIELD
                                    path: $.organization.registeredAddress
                                    message: Registered address
                                  - type: FIELD
                                    path: $.organization.registeredAddress.street
                                    message: Registered address street
                                  - type: FIELD
                                    path: $.organization.registeredAddress.city
                                    message: Registered address city
                                  - type: FIELD
                                    path: $.organization.registeredAddress.postalCode
                                    message: Registered address postal code
                                  - type: FIELD
                                    path: $.organization.registeredAddress.countryCode
                                    message: Registered address country code
                                  - type: FIELD
                                    path: $.organization.legalName
                                    message: Organization legal name
                                  - type: FIELD
                                    path: $.organization.estimatedMonthlyRevenue
                                    message: Estimated monthly revenue
                                  - type: FIELD
                                    path: $.organization.businessModelDescription
                                    message: Business model description
                                  - type: FIELD
                                    path: $.organization.type
                                    message: Legal type
                                  - type: FIELD
                                    path: $.organization.businessLines
                                    message: Merchant information
                                  - type: FIELD
                                    path: $.organization.businessLines[0].mcc
                                    message: Merchant category code (MCC)
                                  - type: FIELD
                                    path: $.organization.businessLines[0].salesChannels
                                    message: Sales channels
                                  - type: FIELD
                                    path: $.organization.businessLines[0].webData
                                    message: Web data of the business
                                  - type: FIELD
                                    path: $.organization.businessLines[0].webData.urls
                                    message: Website of the business
                                  - type: ASSOCIATION
                                    associationCategory: IndividualAssociation
                                    associationType: ACCOUNT_OWNER
                                    path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])]
                                  - type: FIELD
                                    path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual
                                    message: Business representative
                                  - type: FIELD
                                    path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual.firstName
                                    message: Business representative first name
                                  - type: FIELD
                                    path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual.lastName
                                    message: Business representative last name
                                  - type: FIELD
                                    path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual.email
                                    message: Business representative email
                                  - type: FIELD
                                    path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual.phoneNumber
                                    message: Business representative phone number
                            createdAt: '2025-01-15T10:30:00Z'
                            updatedAt: '2025-01-15T10:30:00Z'
                      - type: PAYOUTS
                        status: INACTIVE
                        activePlans: []
                        accountId: 21210021c2855007efa2d657018
                        createdAt: '2025-01-15T10:30:00Z'
                        updatedAt: '2025-01-15T10:30:00Z'
                        plans:
                          - planType: PAYOUTS_STANDARD
                            status: UNREQUESTED
                            requirements:
                              - resourceType: ACCOUNT
                                missing:
                                  - type: CAPABILITY_PLAN
                                    planType: PAYMENTS_LIMITED
                                    path: $.capabilities[?(@.planType == 'PAYMENTS_LIMITED' && (@.status == 'REQUESTED' || @.status == 'APPROVED'))]
                                    message: PAYMENTS_LIMITED plan must be REQUESTED or APPROVED
                                  - type: CAPABILITY_PLAN
                                    planType: PAYMENTS_STANDARD
                                    path: $.capabilities[?(@.planType == 'PAYMENTS_STANDARD' && (@.status == 'REQUESTED' || @.status == 'APPROVED'))]
                                    message: PAYMENTS_STANDARD plan must be REQUESTED or APPROVED
                            createdAt: '2025-01-15T10:30:00Z'
                            updatedAt: '2025-01-15T10:30:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /balance-account:
    post:
      tags:
        - Balance accounts
      operationId: createBalanceAccount
      summary: Create a balance account
      description: |
        Create a balance account. Use `type` to specify either:
        - **STANDARD**: For merchants to receive cleared funds from transactions
        - **EXTERNAL**: For third parties (CPO, site host) with their own legal entity and onboarding requirements
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBalanceAccountRequest'
            examples:
              Standard:
                summary: Standard balance account
                value:
                  type: STANDARD
                  name: Nordic EV Charging Network
                  accountId: 212100210000100ff6a2990b013
                  region: EEA
                  currencyCode: NOK
                  externalReference: nordic_ev_network_001
                  clearingConfig:
                    sourceCurrencyCodes:
                      - NOK
                      - SEK
                      - DKK
                  payoutConfig:
                    name: Daily NOK Payout
                    schedule:
                      unit: DAY
                    statementDescriptor: PAYOUTNORDICEV
                    fundingInstrument:
                      type: BANK_ACCOUNT
                      name: DNB Bank Account
                      bankAccount:
                        accountNumber: NO45DNBA1234567890
                        accountHolderName: Nordic EV Charging Network AS
                        bankName: DNB Bank
              ExternalOrganization:
                summary: External balance account for organization
                value:
                  type: EXTERNAL
                  name: CPMS Green Energy Solutions
                  accountId: 212100210000100ff6a2990b013
                  region: EEA
                  currencyCode: DKK
                  externalReference: cpms_green_energy_004
                  legalEntity:
                    type: ORGANIZATION
                    organization:
                      legalName: CPMS Green Energy Solutions ApS
                      registrationNumber: DK12345678
                      type: PRIVATE_LIMITED
                      registeredAddress:
                        street: 123 Green Energy Street
                        city: Copenhagen
                        postalCode: '1050'
                        countryCode: DK
                  payoutConfig:
                    name: Monthly DKK Payout
                    schedule:
                      unit: MONTH
                    statementDescriptor: PAYOUTCPMSGREEN
                    fundingInstrument:
                      type: BANK_ACCOUNT
                      name: Danske Bank Account
                      bankAccount:
                        accountNumber: DK12DANS4567890123
                        accountHolderName: CPMS Green Energy Solutions ApS
                        bankName: Danske Bank
              ExternalIndividual:
                summary: External balance account for individual
                value:
                  type: EXTERNAL
                  name: Lars Andersson - Home Charging
                  accountId: 212100210000100ff6a2990b013
                  region: EEA
                  currencyCode: SEK
                  externalReference: lars_andersson_home_003
                  legalEntity:
                    type: INDIVIDUAL
                    individual:
                      firstName: Lars
                      lastName: Andersson
                      email: lars.andersson@example.com
                      phoneNumber: '+4712345678'
                  payoutConfig:
                    name: Weekly SEK Payout
                    schedule:
                      unit: WEEK
                    statementDescriptor: PAYOUTLARS
                    fundingInstrument:
                      type: BANK_ACCOUNT
                      name: Swedbank Account
                      bankAccount:
                        accountNumber: SE5412345678901234567890
                        accountHolderName: Lars Andersson
                        bankName: Swedbank
      responses:
        '201':
          description: Balance account created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceAccountResponse'
              examples:
                Standard:
                  summary: Standard balance account created
                  value:
                    id: 212106610000100ff6a45dbb013
                    accountId: 212100210000100ff6a2990b013
                    type: STANDARD
                    status: ACTIVE
                    name: Nordic EV Charging Network
                    region: EEA
                    currencyCode: NOK
                    externalReference: nordic_ev_network_001
                    clearingConfigIds:
                      - 212106610000100ff6a45dbb099
                    topupDetails:
                      bankTransfer:
                        accountNumber: NO45 DEUT 1234567890
                        accountHolderName: Nordic EV Charging Network AS
                        bankName: Deutsche Bank
                        bankCode: DEUTNO2A
                        accountNumberType: IBAN
                        bankCodeType: BIC
                        paymentReference: TOPUPNORDICEV001
                    balance:
                      availableBalance: 0
                      currencyCode: NOK
                    payoutConfig:
                      id: 212106610000100ff6a45dbb014
                      name: Daily NOK Payout
                      balanceAccountId: 212106610000100ff6a45dbb013
                      schedule:
                        unit: DAY
                      statementDescriptor: PAYOUTNORDICEV
                      fundingInstrumentId: 212106610000100ff6a45dbb015
                      status: ACTIVE
                      createdAt: '2024-01-15T10:30:00Z'
                      updatedAt: '2024-01-15T10:30:00Z'
                    createdAt: '2024-01-15T10:30:00Z'
                    updatedAt: '2024-01-15T10:30:00Z'
                ExternalOrganization:
                  summary: External balance account for organization
                  value:
                    id: 212106610000100ff6a45dbb020
                    accountId: 212100210000100ff6a2990b013
                    type: EXTERNAL
                    status: ACTIVE
                    name: CPMS Green Energy Solutions
                    region: EEA
                    currencyCode: DKK
                    externalReference: cpms_green_energy_004
                    legalEntity:
                      id: 212106610000100ff6a45dbb027
                      type: ORGANIZATION
                      organization:
                        legalName: CPMS Green Energy Solutions ApS
                        registrationNumber: DK12345678
                        type: PRIVATE_LIMITED
                        registeredAddress:
                          street: 123 Green Energy Street
                          city: Copenhagen
                          postalCode: '1050'
                          countryCode: DK
                    topupDetails:
                      bankTransfer:
                        accountNumber: DK12 DEUT 4567890123
                        accountHolderName: CPMS Green Energy Solutions ApS
                        bankName: Deutsche Bank
                        bankCode: DEUTDK2A
                        accountNumberType: IBAN
                        bankCodeType: BIC
                        paymentReference: TOPUPCPMSGREEN004
                    balance:
                      availableBalance: 0
                      currencyCode: DKK
                    payoutConfig:
                      id: 212106610000100ff6a45dbb021
                      name: Monthly DKK Payout
                      balanceAccountId: 212106610000100ff6a45dbb020
                      schedule:
                        unit: MONTH
                      statementDescriptor: PAYOUTCPMSGREEN
                      fundingInstrumentId: 212106610000100ff6a45dbb022
                      status: ACTIVE
                      createdAt: '2024-01-25T09:45:00Z'
                      updatedAt: '2024-01-25T09:45:00Z'
                    capabilities:
                      - type: PAYOUTS
                        status: INACTIVE
                        activePlans: []
                        accountId: 212106610000100ff6a45dbb020
                        createdAt: '2024-01-25T09:45:00Z'
                        updatedAt: '2024-01-25T09:45:00Z'
                        plans:
                          - planType: PAYOUTS_EXTERNAL
                            status: UNREQUESTED
                            requirements:
                              - resourceType: LEGAL_ENTITY
                                resourceId: 212106610000100ff6a45dbb027
                                missing:
                                  - type: FIELD
                                    path: $.organization
                                    message: Official data of the organization
                                  - type: FIELD
                                    path: $.organization.registrationNumber
                                    message: Official registration number
                                  - type: FIELD
                                    path: $.organization.registeredAddress
                                    message: Registered address
                                  - type: FIELD
                                    path: $.organization.legalName
                                    message: Organization legal name
                                  - type: FIELD
                                    path: $.organization.type
                                    message: Legal type
                                  - type: ASSOCIATION
                                    associationCategory: IndividualAssociation
                                    associationType: ACCOUNT_OWNER
                                    path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])]
                                  - type: FIELD
                                    path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual
                                    message: Business representative
                                  - type: DOCUMENT
                                    documentCategory: COMPANY
                                    documentType: REGISTRATION_DOCUMENT
                                    path: $.documents[?(@.category == 'COMPANY' && @.type == 'REGISTRATION_DOCUMENT')]
                                    message: Chamber of Commerce Extract
                                  - type: DOCUMENT
                                    documentCategory: COMPANY
                                    documentType: PROOF_OF_OWNERSHIP
                                    path: $.documents[?(@.category == 'COMPANY' && @.type == 'PROOF_OF_OWNERSHIP')]
                                    message: UBO Identification
                            createdAt: '2024-01-25T09:45:00Z'
                            updatedAt: '2024-01-25T09:45:00Z'
                    createdAt: '2024-01-25T09:45:00Z'
                    updatedAt: '2024-01-25T09:45:00Z'
                ExternalIndividual:
                  summary: External balance account for individual
                  value:
                    id: 212106610000100ff6a45dbb028
                    accountId: 212100210000100ff6a2990b013
                    type: EXTERNAL
                    status: ACTIVE
                    name: Lars Andersson - Home Charging
                    region: EEA
                    currencyCode: SEK
                    externalReference: lars_andersson_home_003
                    legalEntity:
                      id: 212106610000100ff6a45dbb026
                      type: INDIVIDUAL
                      individual:
                        firstName: Lars
                        lastName: Andersson
                        email: lars.andersson@example.com
                        phoneNumber: '+4712345678'
                    topupDetails:
                      bankTransfer:
                        accountNumber: SE54 DEUT 3456789012
                        accountHolderName: Lars Andersson
                        bankName: Deutsche Bank
                        bankCode: DEUTSE2A
                        accountNumberType: IBAN
                        bankCodeType: BIC
                        paymentReference: TOPUPLARS003
                    balance:
                      availableBalance: 0
                      currencyCode: SEK
                    payoutConfig:
                      id: 212106610000100ff6a45dbb029
                      name: Weekly SEK Payout
                      balanceAccountId: 212106610000100ff6a45dbb028
                      schedule:
                        unit: WEEK
                      statementDescriptor: PAYOUTLARS
                      fundingInstrumentId: 212106610000100ff6a45dbb030
                      status: ACTIVE
                      createdAt: '2024-01-20T14:15:00Z'
                      updatedAt: '2024-01-20T14:15:00Z'
                    capabilities:
                      - type: PAYOUTS
                        status: INACTIVE
                        activePlans: []
                        accountId: 212106610000100ff6a45dbb028
                        createdAt: '2024-01-20T14:15:00Z'
                        updatedAt: '2024-01-20T14:15:00Z'
                        plans:
                          - planType: PAYOUTS_EXTERNAL
                            status: UNREQUESTED
                            requirements:
                              - resourceType: LEGAL_ENTITY
                                resourceId: 212106610000100ff6a45dbb026
                                missing:
                                  - type: FIELD
                                    path: $.individual
                                    message: Individual details
                                  - type: FIELD
                                    path: $.individual.firstName
                                    message: First name
                                  - type: FIELD
                                    path: $.individual.lastName
                                    message: Last name
                                  - type: FIELD
                                    path: $.individual.email
                                    message: Email address
                                  - type: FIELD
                                    path: $.individual.phoneNumber
                                    message: Phone number
                                  - type: DOCUMENT
                                    documentCategory: INDIVIDUAL
                                    documentType: IDENTITY_DOCUMENT
                                    path: $.documents[?(@.category == 'INDIVIDUAL' && @.type == 'IDENTITY_DOCUMENT')]
                                    message: Identity document
                            createdAt: '2024-01-20T14:15:00Z'
                            updatedAt: '2024-01-20T14:15:00Z'
                    createdAt: '2024-01-20T14:15:00Z'
                    updatedAt: '2024-01-20T14:15:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
    get:
      tags:
        - Balance accounts
      operationId: listBalanceAccounts
      summary: List all balance accounts
      description: Retrieve a list of balance accounts (both standard and external)
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/balanceAccountType'
        - $ref: '#/components/parameters/externalReference'
        - $ref: '#/components/parameters/status'
        - $ref: '#/components/parameters/balanceCurrencyCode'
        - name: accountNumber
          in: query
          required: false
          description: Either the prefix or the suffix or the full account number to filter by
          schema:
            type: string
          example: NL24
        - $ref: '#/components/parameters/balanceAccountListIncludesQuery'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/lastKey'
      responses:
        '200':
          description: List of balance accounts
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/paginatedResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          discriminator:
                            propertyName: type
                            mapping:
                              STANDARD: '#/components/schemas/StandardBalanceAccountResponse'
                              EXTERNAL: '#/components/schemas/ExternalBalanceAccountResponse'
                          oneOf:
                            - $ref: '#/components/schemas/StandardBalanceAccountResponse'
                              title: Standard balance account
                            - $ref: '#/components/schemas/ExternalBalanceAccountResponse'
                              title: External balance account
              example:
                data:
                  - id: 212106610000100ff6a45dbb013
                    accountId: 212100210000100ff6a2990b013
                    type: STANDARD
                    region: EEA
                    name: Nordic EV Charging Network
                    currencyCode: NOK
                    status: ACTIVE
                    externalReference: nordic_ev_network_001
                    createdAt: '2024-01-15T10:30:00Z'
                    updatedAt: '2024-01-15T10:30:00Z'
                  - id: 212106610000100ff6a45dbb020
                    accountId: 212100210000100ff6a2990b013
                    type: EXTERNAL
                    region: EEA
                    name: CPMS Green Energy Solutions
                    currencyCode: DKK
                    status: ACTIVE
                    externalReference: cpms_green_energy_004
                    legalEntity:
                      id: 212106610000100ff6a45dbb027
                      type: ORGANIZATION
                      organization:
                        legalName: CPMS Green Energy Solutions ApS
                        registrationNumber: DK12345678
                        type: PRIVATE_LIMITED
                    capabilities:
                      - type: PAYOUTS
                        status: INACTIVE
                        activePlans: []
                    createdAt: '2024-01-25T09:45:00Z'
                    updatedAt: '2024-01-25T09:45:00Z'
                pagination:
                  count: 2
                  hasMoreItems: false
                  lastKey: eyJsYXN0SWQiOiIyMTIxMDY2MTAwMDAxMDBmZjZhNDVkYmIwMjAifQ==
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /balance-account/{id}:
    get:
      tags:
        - Balance accounts
      operationId: getBalanceAccountById
      summary: Retrieve a balance account
      description: Retrieve a specific balance account by its ID
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the balance account to retrieve
        - $ref: '#/components/parameters/balanceAccountIncludesQuery'
      responses:
        '200':
          description: Balance account details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceAccountResponse'
              examples:
                StandardBalanceAccount:
                  summary: Standard balance account with daily NOK payout
                  value:
                    id: 212106610000100ff6a45dbb013
                    accountId: 212100210000100ff6a2990b013
                    type: STANDARD
                    region: EEA
                    name: Nordic EV Charging Network
                    currencyCode: NOK
                    status: ACTIVE
                    externalReference: nordic_ev_network_001
                    createdAt: '2024-01-15T10:30:00Z'
                    updatedAt: '2024-01-15T10:30:00Z'
                    balance:
                      availableBalance: 1250000
                      currencyCode: NOK
                    topupDetails:
                      bankTransfer:
                        accountNumber: NO45 DEUT 1234567890
                        accountHolderName: Nordic EV Charging Network AS
                        bankName: Deutsche Bank
                        bankCode: DEUTNO2A
                        accountNumberType: IBAN
                        bankCodeType: BIC
                        paymentReference: TOPUPNORDICEV001
                    payoutConfig:
                      id: 212106610000100ff6a45dbb014
                      name: Daily NOK Payout
                      balanceAccountId: 212106610000100ff6a45dbb013
                      schedule:
                        unit: DAY
                      statementDescriptor: PAYOUTNORDICEV
                      fundingInstrumentId: 212106610000100ff6a45dbb015
                      status: ACTIVE
                      createdAt: '2024-01-15T10:30:00Z'
                      updatedAt: '2024-01-15T10:30:00Z'
                ExternalBalanceAccount:
                  summary: External balance account for organization
                  value:
                    id: 212106610000100ff6a45dbb020
                    accountId: 212100210000100ff6a2990b013
                    type: EXTERNAL
                    region: EEA
                    name: CPMS Green Energy Solutions
                    currencyCode: DKK
                    status: ACTIVE
                    externalReference: cpms_green_energy_004
                    legalEntity:
                      id: 212106610000100ff6a45dbb027
                      type: ORGANIZATION
                      organization:
                        legalName: CPMS Green Energy Solutions ApS
                        registrationNumber: DK12345678
                        type: PRIVATE_LIMITED
                        registeredAddress:
                          street: 123 Green Energy Street
                          city: Copenhagen
                          postalCode: '1050'
                          countryCode: DK
                    capabilities:
                      - type: PAYOUTS
                        status: INACTIVE
                        activePlans: []
                        accountId: 212106610000100ff6a45dbb020
                        plans:
                          - planType: PAYOUTS_EXTERNAL
                            status: UNREQUESTED
                        createdAt: '2024-01-25T09:45:00Z'
                        updatedAt: '2024-01-25T09:45:00Z'
                    balance:
                      availableBalance: 0
                      currencyCode: DKK
                    topupDetails:
                      bankTransfer:
                        accountNumber: DK12 DEUT 4567890123
                        accountHolderName: CPMS Green Energy Solutions ApS
                        bankName: Deutsche Bank
                        bankCode: DEUTDK2A
                        accountNumberType: IBAN
                        bankCodeType: BIC
                        paymentReference: TOPUPCPMSGREEN004
                    payoutConfig:
                      id: 212106610000100ff6a45dbb021
                      name: Monthly DKK Payout
                      balanceAccountId: 212106610000100ff6a45dbb020
                      schedule:
                        unit: MONTH
                      statementDescriptor: PAYOUTCPMSGREEN
                      fundingInstrumentId: 212106610000100ff6a45dbb022
                      status: ACTIVE
                      createdAt: '2024-01-25T09:45:00Z'
                      updatedAt: '2024-01-25T09:45:00Z'
                    createdAt: '2024-01-25T09:45:00Z'
                    updatedAt: '2024-01-25T09:45:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
    put:
      tags:
        - Balance accounts
      operationId: updateBalanceAccount
      summary: Update a balance account
      description: Update an existing balance account
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the balance account to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBalanceAccountRequest'
            examples:
              UpdateBalanceAccount:
                summary: Update balance account
                value:
                  name: Nordic EV Charging Network - Updated
                  externalReference: nordic_ev_network_updated
              UpdateWithClearingConfig:
                summary: Update standard balance account with clearing config
                value:
                  name: Nordic EV Charging Network - Updated
                  externalReference: nordic_ev_network_updated
                  clearingConfig:
                    sourceCurrencyCodes:
                      - NOK
                      - SEK
                      - DKK
      responses:
        '200':
          description: Balance account updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceAccountResponse'
              examples:
                UpdatedStandardBalanceAccount:
                  summary: Updated standard balance account
                  value:
                    id: 212106610000100ff6a45dbb013
                    accountId: 212100210000100ff6a2990b013
                    type: STANDARD
                    region: EEA
                    name: Nordic EV Charging Network
                    currencyCode: NOK
                    status: ACTIVE
                    externalReference: nordic_ev_network_001
                    createdAt: '2024-01-15T10:30:00Z'
                    updatedAt: '2024-01-16T14:20:00Z'
                    balance:
                      availableBalance: 1250000
                      currencyCode: NOK
                    topupDetails:
                      bankTransfer:
                        accountNumber: NO45 DEUT 1234567890
                        accountHolderName: Nordic EV Charging Network AS
                        bankName: Deutsche Bank
                        bankCode: DEUTNO2A
                        accountNumberType: IBAN
                        bankCodeType: BIC
                        paymentReference: TOPUPNORDICEV001
                    payoutConfig:
                      id: 212106610000100ff6a45dbb014
                      name: Daily NOK Payout
                      balanceAccountId: 212106610000100ff6a45dbb013
                      schedule:
                        unit: DAY
                      statementDescriptor: PAYOUTNORDICEV
                      fundingInstrumentId: 212106610000100ff6a45dbb015
                      status: ACTIVE
                      createdAt: '2024-01-15T10:30:00Z'
                      updatedAt: '2024-01-16T14:20:00Z'
                UpdatedExternalBalanceAccount:
                  summary: Updated external balance account
                  value:
                    id: 212106610000100ff6a45dbb020
                    accountId: 212100210000100ff6a2990b013
                    type: EXTERNAL
                    region: EEA
                    name: CPMS Green Energy Solutions - Updated
                    currencyCode: DKK
                    status: ACTIVE
                    externalReference: cpms_green_energy_004
                    legalEntity:
                      id: 212106610000100ff6a45dbb027
                      type: ORGANIZATION
                      organization:
                        legalName: CPMS Green Energy Solutions ApS
                        registrationNumber: DK12345678
                        type: PRIVATE_LIMITED
                    capabilities:
                      - type: PAYOUTS
                        status: INACTIVE
                        activePlans: []
                        accountId: 212106610000100ff6a45dbb020
                        plans:
                          - planType: PAYOUTS_EXTERNAL
                            status: UNREQUESTED
                        createdAt: '2024-01-25T09:45:00Z'
                        updatedAt: '2024-01-25T09:45:00Z'
                    balance:
                      availableBalance: 0
                      currencyCode: DKK
                    payoutConfig:
                      id: 212106610000100ff6a45dbb021
                      name: Monthly DKK Payout
                      balanceAccountId: 212106610000100ff6a45dbb020
                      schedule:
                        unit: MONTH
                      statementDescriptor: PAYOUTCPMSGREEN
                      fundingInstrumentId: 212106610000100ff6a45dbb022
                      status: ACTIVE
                      createdAt: '2024-01-25T09:45:00Z'
                      updatedAt: '2024-01-26T10:00:00Z'
                    createdAt: '2024-01-25T09:45:00Z'
                    updatedAt: '2024-01-26T10:00:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /balance-account/{id}/transaction:
    get:
      tags:
        - Balance accounts
      operationId: getBalanceAccountTransactions
      summary: List balance account transactions
      description: Get balance account transactions list
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the balance account to retrieve transactions for
        - $ref: '#/components/parameters/startDate'
          description: Start date to filter transactions by
        - $ref: '#/components/parameters/endDate'
          description: End date to filter transactions by
        - name: transactionType
          schema:
            $ref: '#/components/schemas/balanceAccountTransactionType'
          in: query
          required: false
          description: Type of the transaction to filter by
        - $ref: '#/components/parameters/balanceAccountTransactionIncludesQuery'
      responses:
        '200':
          description: Balance account transactions list retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceAccountTransactionListResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /account/{accountId}/capability:
    get:
      tags:
        - Capabilities
      operationId: getAccountCapabilitiesList
      summary: List all account capabilities
      description: |
        List all account capabilities with their status and requirements.
      parameters:
        - name: accountId
          schema:
            $ref: '#/components/schemas/id'
          in: path
          required: true
          description: The ID of the account to get the capability for
        - name: include
          schema:
            $ref: '#/components/schemas/getCapabilityIncludeParameter'
          in: query
          required: false
          description: Include additional information in the response
      responses:
        '200':
          description: Capabilities retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAccountCapabilitiesResponse'
              examples:
                capabilities:
                  summary: Capabilities
                  value:
                    - accountId: 21210021c2855007efa2d657018
                      status: ACTIVE
                      type: PAYMENTS
                      activePlans:
                        - PAYMENTS_LIMITED
                      createdAt: '2025-01-01T00:00:00Z'
                      updatedAt: '2025-01-01T00:00:00Z'
                    - accountId: 21210021c2855007efa2d657999
                      status: INACTIVE
                      type: PAYOUTS
                      activePlans: []
                      createdAt: '2025-01-01T00:00:00Z'
                      updatedAt: '2025-01-01T00:00:00Z'
                capabilitiesWithPlans:
                  summary: Capabilities with plans
                  value:
                    - accountId: 21210021c2855007efa2d657018
                      status: ACTIVE
                      type: PAYMENTS
                      activePlans:
                        - PAYMENTS_LIMITED
                      plans:
                        - planType: PAYMENTS_LIMITED
                          status: APPROVED
                          constraints:
                            maxProcessingVolume: 10000
                            endDate: '2025-12-31T23:59:59Z'
                          requirements: []
                          createdAt: '2025-01-01T00:00:00Z'
                          updatedAt: '2025-01-01T00:00:00Z'
                        - planType: PAYMENTS_STANDARD
                          status: REQUESTED
                          requirements: []
                          createdAt: '2025-01-01T00:00:00Z'
                          updatedAt: '2025-01-01T00:00:00Z'
                      createdAt: '2025-01-01T00:00:00Z'
                      updatedAt: '2025-01-01T00:00:00Z'
                    - accountId: 21210021c2855007efa2d657999
                      status: INACTIVE
                      type: PAYOUTS
                      activePlans: []
                      plans:
                        - planType: PAYOUTS_STANDARD
                          status: UNREQUESTED
                          createdAt: '2025-01-01T00:00:00Z'
                          updatedAt: '2025-01-01T00:00:00Z'
                      createdAt: '2025-01-01T00:00:00Z'
                      updatedAt: '2025-01-01T00:00:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /account/{accountId}/capability/{type}:
    get:
      tags:
        - Capabilities
      operationId: getCapability
      summary: Retrieve a account capability
      description: |
        Retrieve a capability by its type for a merchant account or external balance account.
      parameters:
        - name: accountId
          schema:
            $ref: '#/components/schemas/id'
          in: path
          required: true
          description: The ID of the account to get the capability for
        - name: type
          schema:
            $ref: '#/components/schemas/capabilityType'
          in: path
          required: true
          description: The type of capability to get
        - name: include
          schema:
            $ref: '#/components/schemas/getCapabilityIncludeParameter'
          in: query
          required: false
          description: Include additional information in the response
      responses:
        '200':
          description: Capability retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapabilityResponse'
              examples:
                inactivePayments:
                  summary: Inactive payments capability
                  value:
                    accountId: 21210021c2855007efa2d657018
                    status: INACTIVE
                    type: PAYMENTS
                    activePlans: []
                    plans:
                      - planType: PAYMENTS_LIMITED
                        status: UNREQUESTED
                        requirements:
                          - resourceType: LEGAL_ENTITY
                            resourceId: 21210021c2855007efa2d657018
                            missing:
                              - type: FIELD
                                path: $.organization
                                message: Official data of the organization
                              - type: FIELD
                                path: $.organization.registrationNumber
                                message: Official registration number
                              - type: FIELD
                                path: $.organization.registeredAddress
                                message: Registered address
                              - type: FIELD
                                path: $.organization.registeredAddress.street
                                message: Registered address street
                              - type: FIELD
                                path: $.organization.registeredAddress.city
                                message: Registered address city
                              - type: FIELD
                                path: $.organization.registeredAddress.postalCode
                                message: Registered address postal code
                              - type: FIELD
                                path: $.organization.registeredAddress.countryCode
                                message: Registered address country code
                              - type: FIELD
                                path: $.organization.legalName
                                message: Organization legal name
                              - type: FIELD
                                path: $.organization.estimatedMonthlyRevenue
                                message: Estimated monthly revenue
                              - type: FIELD
                                path: $.organization.businessModelDescription
                                message: Business model description
                              - type: FIELD
                                path: $.organization.type
                                message: Legal type
                              - type: FIELD
                                path: $.organization.businessLines
                                message: Merchant information
                              - type: FIELD
                                path: $.organization.businessLines[0].mcc
                                message: Merchant category code (MCC)
                              - type: FIELD
                                path: $.organization.businessLines[0].salesChannels
                                message: Sales channels
                              - type: FIELD
                                path: $.organization.businessLines[0].webData
                                message: Web data of the business
                              - type: FIELD
                                path: $.organization.businessLines[0].webData.urls
                                message: Website of the business
                              - type: ASSOCIATION
                                associationCategory: IndividualAssociation
                                associationType: ACCOUNT_OWNER
                                path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])]
                              - type: FIELD
                                path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual
                                message: Business representative
                              - type: FIELD
                                path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual.firstName
                                message: Business representative first name
                              - type: FIELD
                                path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual.lastName
                                message: Business representative last name
                              - type: FIELD
                                path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual.email
                                message: Business representative email
                              - type: FIELD
                                path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].individual.phoneNumber
                                message: Business representative phone number
                              - type: DOCUMENT
                                documentCategory: INDIVIDUAL
                                documentType: IDENTITY_DOCUMENT
                                path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].documents[?(@.category == 'INDIVIDUAL' && @.type == 'IDENTITY_DOCUMENT')]
                                message: Business representative identity document
                              - type: AGREEMENT_SIGNATURE
                                documentCategory: INTERNAL
                                documentType: TERMS_AND_CONDITIONS
                                isDisqualifierPath: true
                                path: $.documents[?(@.category == 'INTERNAL' && @.type == 'TERMS_AND_CONDITIONS' && @.details.isRequired == true && !@.details.signedBy)]
                                message: Terms and conditions signature
                              - type: AGREEMENT_SIGNATURE
                                documentCategory: INTERNAL
                                documentType: OTHER_SIGN_OFF_REQUIRED
                                isDisqualifierPath: true
                                path: $.documents[?(@.category == 'INTERNAL' && @.type == 'OTHER_SIGN_OFF_REQUIRED' && @.details.isRequired == true && !@.details.signedBy)]
                                message: Agreement signature
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                      - planType: PAYMENTS_STANDARD
                        status: UNREQUESTED
                        requirements:
                          - resourceType: LEGAL_ENTITY
                            resourceId: 21210021c2855007efa2d657018
                            missing:
                              - type: DOCUMENT
                                documentCategory: COMPANY
                                documentType: REGISTRATION_DOCUMENT
                                path: $.documents[?(@.category == 'COMPANY' && @.type == 'REGISTRATION_DOCUMENT')]
                                message: Chamber of Commerce Extract
                              - type: DOCUMENT
                                documentCategory: COMPANY
                                documentType: PROOF_OF_OWNERSHIP
                                path: $.documents[?(@.category == 'COMPANY' && @.type == 'PROOF_OF_OWNERSHIP')]
                                message: UBO Identification (Shareholders Registers/Shareholding Structure)
                          - resourceType: ACCOUNT
                            resourceId: 21210021c2855007efa2d657018
                            missing:
                              - type: CAPABILITY_PLAN
                                path: $..plans[?(@.planType === "PAYMENTS_LIMITED" && (@.status === "REQUESTED" || @.status === "APPROVED") && @parent.type === "PAYMENTS")]^
                                capabilityType: PAYMENTS
                                planType: PAYMENTS_LIMITED
                                planStatus: REQUESTED
                                message: Payments limited capability plan not in unrequested state
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                    createdAt: '2025-01-01T00:00:00Z'
                    updatedAt: '2025-01-01T00:00:00Z'
                activeLimitedPayments:
                  summary: Active payments with constraints applied
                  value:
                    accountId: 21210021c2855007efa2d657018
                    status: ACTIVE
                    type: PAYMENTS
                    activePlans:
                      - PAYMENTS_LIMITED
                    plans:
                      - planType: PAYMENTS_LIMITED
                        status: APPROVED
                        constraints:
                          maxProcessingVolume: 10000
                          endDate: '2025-12-31T23:59:59Z'
                        requirements: []
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                      - planType: PAYMENTS_STANDARD
                        status: UNREQUESTED
                        requirements:
                          - resourceType: LEGAL_ENTITY
                            resourceId: 21210021c2855007efa2d657018
                            missing:
                              - type: DOCUMENT
                                documentCategory: COMPANY
                                documentType: REGISTRATION_DOCUMENT
                                path: $.documents[?(@.category == 'COMPANY' && @.type == 'REGISTRATION_DOCUMENT')]
                                message: Chamber of Commerce Extract
                              - type: DOCUMENT
                                documentCategory: COMPANY
                                documentType: PROOF_OF_OWNERSHIP
                                path: $.documents[?(@.category == 'COMPANY' && @.type == 'PROOF_OF_OWNERSHIP')]
                                message: UBO Identification (Shareholders Registers/Shareholding Structure)
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                    createdAt: '2025-01-01T00:00:00Z'
                    updatedAt: '2025-01-01T00:00:00Z'
                activeStandardPayments:
                  summary: Active payments with no constraints applied
                  value:
                    accountId: 21210021c2855007efa2d657018
                    status: ACTIVE
                    type: PAYMENTS
                    activePlans:
                      - PAYMENTS_STANDARD
                    plans:
                      - planType: PAYMENTS_LIMITED
                        status: APPROVED
                        requirements: []
                        constraints:
                          maxProcessingVolume: 10000
                          endDate: '2025-12-31T23:59:59Z'
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                      - planType: PAYMENTS_STANDARD
                        status: APPROVED
                        requirements: []
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                    createdAt: '2025-01-01T00:00:00Z'
                    updatedAt: '2025-01-01T00:00:00Z'
                inactivePayouts:
                  summary: Inactive payouts capability with requirements
                  value:
                    accountId: 21210021c2855007efa2d657018
                    status: INACTIVE
                    type: PAYOUTS
                    activePlans: []
                    plans:
                      - planType: PAYOUTS_STANDARD
                        status: UNREQUESTED
                        requirements:
                          - resourceType: ACCOUNT
                            missing:
                              - type: CAPABILITY_PLAN
                                planType: PAYMENTS_LIMITED
                                path: $.capabilities[?(@.type == 'PAYMENTS' && @.planType == 'PAYMENTS_LIMITED' && (@.planStatus == 'REQUESTED' || @.planStatus == 'APPROVED'))]
                                message: PAYMENTS_LIMITED plan must be REQUESTED or APPROVED
                              - type: CAPABILITY_PLAN
                                planType: PAYMENTS_STANDARD
                                path: $.capabilities[?(@.type == 'PAYMENTS' && @.planType == 'PAYMENTS_STANDARD' && (@.planStatus == 'REQUESTED' || @.planStatus == 'APPROVED'))]
                                message: PAYMENTS_STANDARD plan must be REQUESTED or APPROVED
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                    createdAt: '2025-01-01T00:00:00Z'
                    updatedAt: '2025-01-01T00:00:00Z'
                activePayouts:
                  summary: Merchant account - active payouts capability
                  value:
                    accountId: 21210021c2855007efa2d657018
                    status: ACTIVE
                    type: PAYOUTS
                    activePlans:
                      - PAYOUTS_STANDARD
                    plans:
                      - planType: PAYOUTS_STANDARD
                        status: APPROVED
                        requirements: []
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                    createdAt: '2025-01-01T00:00:00Z'
                    updatedAt: '2025-01-01T00:00:00Z'
                externalBalanceAccountPayouts:
                  summary: External balance account - PAYOUTS capability
                  value:
                    accountId: 212106610000100ff6a45dbb020
                    status: INACTIVE
                    type: PAYOUTS
                    activePlans: []
                    plans:
                      - planType: PAYOUTS_EXTERNAL
                        status: UNREQUESTED
                        requirements:
                          - resourceType: LEGAL_ENTITY
                            resourceId: 212106610000100ff6a45dbb027
                            missing:
                              - type: FIELD
                                path: $.organization.registrationNumber
                                message: Official registration number
                              - type: DOCUMENT
                                documentCategory: COMPANY
                                documentType: REGISTRATION_DOCUMENT
                                path: $.documents[?(@.category == 'COMPANY' && @.type == 'REGISTRATION_DOCUMENT')]
                                message: Chamber of Commerce Extract
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                    createdAt: '2025-01-01T00:00:00Z'
                    updatedAt: '2025-01-01T00:00:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /account/{accountId}/capability/{type}/request:
    post:
      tags:
        - Capabilities
      operationId: requestCapability
      summary: Request a account capability plan
      description: |
        Request a capability plan for a merchant account or external balance account.

        **Merchant accounts**: Capability plans must be requested in order. First request `PAYMENTS_LIMITED`, then `PAYMENTS_STANDARD` once PAYMENTS_LIMITED is approved. The `PAYOUTS_STANDARD` plan is automatically granted when `PAYMENTS_STANDARD` is approved—no separate request is needed.

        **External balance accounts**: Request `PAYOUTS_EXTERNAL` to enable payouts for external balance accounts.
      parameters:
        - name: accountId
          schema:
            $ref: '#/components/schemas/id'
          in: path
          required: true
          description: The ID of the account to request the capability plan for
        - name: type
          schema:
            $ref: '#/components/schemas/capabilityType'
          in: path
          required: true
          description: The type of the capability
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CapabilityRequestParameters'
            examples:
              MerchantAccountLimitedAPI:
                summary: Merchant account - request PAYMENTS_LIMITED via API (step 1)
                value:
                  plan: PAYMENTS_LIMITED
                  requestType: API
              MerchantAccountLimitedPortal:
                summary: Merchant account - request PAYMENTS_LIMITED via portal (step 1)
                value:
                  plan: PAYMENTS_LIMITED
                  requestType: PORTAL
                  redirectUrl: https://my.business.com/onboarding-complete
              MerchantAccountStandardAPI:
                summary: Merchant account - request PAYMENTS_STANDARD via API (step 2)
                value:
                  plan: PAYMENTS_STANDARD
                  requestType: API
              MerchantAccountStandardPortal:
                summary: Merchant account - request PAYMENTS_STANDARD via portal (step 2)
                value:
                  plan: PAYMENTS_STANDARD
                  requestType: PORTAL
                  redirectUrl: https://my.business.com/onboarding-complete
              ExternalBalanceAccount:
                summary: External balance account - request PAYOUTS_EXTERNAL via API
                value:
                  plan: PAYOUTS_EXTERNAL
                  requestType: API
      responses:
        '200':
          description: Capability requested successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapabilityResponse'
              examples:
                MerchantPaymentsLimitedRequested:
                  summary: Merchant account - Payments limited
                  value:
                    accountId: 21210021c2855007efa2d657018
                    status: INACTIVE
                    type: PAYMENTS
                    activePlans: []
                    createdAt: '2025-01-01T00:00:00Z'
                    updatedAt: '2025-01-01T00:00:00Z'
                    plans:
                      - planType: PAYMENTS_LIMITED
                        status: REQUESTED
                        portal:
                          url: https://portal.embed.com/onboarding
                          type: DETAILS
                        requirements: []
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                      - planType: PAYMENTS_STANDARD
                        status: UNREQUESTED
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                        requirements:
                          - resourceType: LEGAL_ENTITY
                            resourceId: 21210021c2855007efa2d657018
                            missing:
                              - type: DOCUMENT
                                documentCategory: COMPANY
                                documentType: REGISTRATION_DOCUMENT
                                path: $.documents[?(@.category == 'COMPANY' && @.type == 'REGISTRATION_DOCUMENT')]
                                message: Chamber of Commerce Extract
                              - type: DOCUMENT
                                documentCategory: COMPANY
                                documentType: PROOF_OF_OWNERSHIP
                                path: $.documents[?(@.category == 'COMPANY' && @.type == 'PROOF_OF_OWNERSHIP')]
                                message: UBO Identification
                MerchantPaymentsStandardRequested:
                  summary: Merchant account - Payments standard
                  value:
                    accountId: 21210021c2855007efa2d657018
                    status: ACTIVE
                    type: PAYMENTS
                    activePlans:
                      - PAYMENTS_LIMITED
                    plans:
                      - planType: PAYMENTS_LIMITED
                        status: APPROVED
                        constraints:
                          maxProcessingVolume: 10000
                          endDate: '2025-12-31T23:59:59Z'
                        requirements: []
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                      - planType: PAYMENTS_STANDARD
                        status: REQUESTED
                        portal:
                          url: https://portal.embed.com/onboarding
                          type: DETAILS
                        requirements: []
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
                    createdAt: '2025-01-01T00:00:00Z'
                    updatedAt: '2025-01-01T00:00:00Z'
                ExternalBalanceAccountPayoutsRequested:
                  summary: External balance account - Payouts external
                  value:
                    accountId: 212106610000100ff6a45dbb020
                    status: INACTIVE
                    type: PAYOUTS
                    activePlans: []
                    createdAt: '2025-01-01T00:00:00Z'
                    updatedAt: '2025-01-01T00:00:00Z'
                    plans:
                      - planType: PAYOUTS_EXTERNAL
                        status: REQUESTED
                        createdAt: '2025-01-01T00:00:00Z'
                        updatedAt: '2025-01-01T00:00:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /document:
    post:
      tags:
        - Documents
      summary: Create a document
      description: Creates a document
      operationId: createDocument
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentRequest'
            example:
              accountId: 21210021c2855007efa2d657019
              category: FUNDING_INSTRUMENT
              type: BANK_STATEMENT
              name: Bank Statement - ABN AMRO Account
              description: Last 3 months bank statement for account NL91ABNA0417164300
              files:
                - type: BASE_64
                  content: JVBERi0xLjQKJcOkw7zDtsO...base64_encoded_pdf_content_here...
              target:
                type: FUNDING_INSTRUMENT
                id: 21210021c2855007efa2d657018
      responses:
        '201':
          description: Document created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
              example:
                id: 21210021c2855007efa2d657024
                accountId: 21210021c2855007efa2d657019
                type: BANK_STATEMENT
                name: Bank Statement - ABN AMRO Account
                description: Last 3 months bank statement for account NL91ABNA0417164300
                files:
                  - url: https://app.embed.co/documents/21210021c2855007efa2d657024/files/0/download
                    expiresAt: '2025-01-01T00:00:00Z'
                details: {}
        '401':
          description: Unauthorized - file id not part of your hive
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorizedError'
        '404':
          description: Not found - file id not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notFoundError'
    get:
      tags:
        - Documents
      summary: List documents
      description: Retrieves all documents for an accountss
      operationId: getDocuments
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/lastKey'
      responses:
        '200':
          description: Documents retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/paginatedResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Document'
              example:
                data:
                  - id: 21210021c2855007efa2d657024
                    accountId: 21210021c2855007efa2d657019
                    type: BANK_STATEMENT
                    name: Bank Statement - ABN AMRO Account
                    description: Last 3 months bank statement for account NL91ABNA0417164300
                    files:
                      - url: https://app.embed.co/documents/21210021c2855007efa2d657024/files/0/download
                        expiresAt: '2025-01-01T00:00:00Z'
                    details: {}
                  - id: 21210021c2855007efa2d657025
                    accountId: 21210021c2855007efa2d657019
                    type: PASSPORT
                    name: Passport - Johan van der Berg
                    description: Dutch passport for account holder
                    files:
                      - url: https://app.embed.co/documents/21210021c2855007efa2d657025/files/0/download
                        expiresAt: '2025-01-01T00:00:00Z'
                    details: {}
                pagination:
                  lastKey: eyJsYXN0SWQiOiIyMTIxMDAyMWMyODU1MDA3ZWZhMmQ2NTcwMjUiLCJsYXN0Q3JlYXRlZEF0IjoiMjAyNC0wMS0xNVQxMDozMDowMFoifQ==
                  count: 2
                  hasMoreItems: false
        '404':
          $ref: '#/components/responses/notFound'
  /document/{id}:
    get:
      tags:
        - Documents
      summary: Retrieve a document
      description: Retrieves a specific document by its id
      operationId: getDocument
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Document retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
              example:
                id: 21210021c2855007efa2d657024
                accountId: 21210021c2855007efa2d657019
                type: BANK_STATEMENT
                name: Bank Statement - ABN AMRO Account
                description: Monthly bank statement for account NL91ABNA0417164300
                files:
                  - url: https://api.example.com/documents/21210021c2855007efa2d657024/files/0/download
                    expiresAt: '2025-01-01T00:00:00Z'
                details: {}
        '404':
          $ref: '#/components/responses/notFound'
  /legal-entity:
    post:
      tags:
        - Legal entities
      operationId: createLegalEntity
      summary: Create a new legal entity
      description: Creates a new legal entity (individual or organization)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LegalEntityRequest'
      responses:
        '201':
          description: Legal entity created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegalEntity'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /legal-entity/{id}:
    get:
      tags:
        - Legal entities
      summary: Retrieve a legal entity
      description: Gets a legal entity by id
      operationId: getLegalEntity
      parameters:
        - $ref: '#/components/parameters/id'
        - name: include
          in: query
          schema:
            $ref: '#/components/schemas/getLegalEntityIncludeParameters'
          description: Comma-separated list of additional fields to include in the response
      responses:
        '200':
          description: Legal entity retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegalEntity'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorizedError'
        '404':
          $ref: '#/components/responses/notFound'
    put:
      tags:
        - Legal entities
      operationId: updateLegalEntityById
      summary: Update a legal entity by id
      description: |
        Updates the details of a legal entity

        Additional verifications might be done on the provided details.
      parameters:
        - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LegalEntityRequest'
      responses:
        '200':
          description: Legal entity updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegalEntity'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /legal-entity/{id}/association:
    post:
      tags:
        - Legal entities
      summary: Add a new association
      description: Adds a new association, to the existing associations of the legal entity
      operationId: appendAssociations
      parameters:
        - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Association'
      responses:
        '200':
          description: Associations updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegalEntity'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorizedError'
        '404':
          description: Not found - referenced association id not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notFoundError'
    put:
      tags:
        - Legal entities
      summary: Update associations
      description: Updates the associations array for a legal entity by overwriting the existing associations
      operationId: replaceAssociations
      parameters:
        - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The associations to replace the existing associations with
              items:
                $ref: '#/components/schemas/Association'
      responses:
        '200':
          description: Associations replaced successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegalEntity'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorizedError'
        '404':
          description: Not found - referenced association id not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notFoundError'
  /legal-entity/{id}/document:
    post:
      tags:
        - Legal entities
      summary: Add a document to a legal entity
      description: Adds a new document, to the existing documents of the legal entity
      operationId: appendDocuments
      parameters:
        - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                documentIds:
                  type: array
                  items:
                    $ref: '#/components/schemas/id'
            example:
              documentIds:
                - 21210021c2855007efa2d657024
                - 21210021c2855007efa2d657025
      responses:
        '204':
          description: Associations updated successfully
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorizedError'
        '404':
          description: Not found - referenced association id not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notFoundError'
  /legal-entity/document/{documentId}/sign:
    post:
      tags:
        - Legal entities
      operationId: signDocument
      summary: Sign a document
      description: Sign a document which requires a signature.
      parameters:
        - name: documentId
          in: path
          required: true
          description: The unique identifier for the document to sign.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentSignatureRequest'
      responses:
        '201':
          description: Document signed successfully.
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /legal-entity/onboardMerchantAccount:
    post:
      tags:
        - Legal entities
      operationId: onboardMerchantAccount
      summary: Onboard a merchant account
      description: Creates a new merchant account, a legal entity and an operating account for that merchant.
      deprecated: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OnboardMerchantAccountRequest'
      responses:
        '200':
          description: Merchant account created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OnboardMerchantAccountResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/ideal/initiatePayment:
    post:
      tags:
        - Payments
      operationId: initiateIdealPayment
      summary: Initiate a iDEAL payment
      description: Initiate a iDEAL payment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdealPaymentRequest'
      responses:
        '201':
          description: iDEAL payment initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdealPaymentResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/open-banking/initiatePayment:
    post:
      tags:
        - Payments
      operationId: initiateOpenBankingPayment
      summary: Initiate a Open Banking payment
      description: Initiate a Open Banking payment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenBankingPaymentRequest'
      responses:
        '201':
          description: Open Banking payment initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenBankingPaymentResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/card/authorizePayment:
    post:
      tags:
        - Payments
      operationId: authorizeCardPayment
      summary: Authorize a card payment
      description: Authorize a card payment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthorizePaymentRequest'
      responses:
        '201':
          description: Card payment authorized successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardPaymentResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/card/incrementAuthorization:
    post:
      tags:
        - Payments
      operationId: incrementCardAuthorization
      summary: Increment an authorization
      description: Increment an authorization.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IncrementAuthorizationRequest'
      responses:
        '201':
          description: Authorization incremented successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IncrementAuthorizationResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/twint/initiatePayment:
    post:
      tags:
        - Payments
      operationId: initiateTwintPayment
      summary: Initiate a TWINT payment
      description: Initiate a TWINT payment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TwintPaymentRequest'
      responses:
        '201':
          description: Open Banking payment initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TwintPaymentResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/paymentContract/createCharge:
    post:
      tags:
        - Payments
      operationId: createPaymentContractCharge
      summary: Create a charge using a payment contract
      description: Create a charge using a payment contract.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentContractChargeRequest'
      responses:
        '201':
          description: Charge created successfully
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/CardPaymentResponse'
                  - $ref: '#/components/schemas/SepaDirectDebitPaymentResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/capturePayment:
    post:
      tags:
        - Payments
      operationId: capturePayment
      summary: Capture a payment
      description: Capture a payment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CapturePaymentRequest'
      responses:
        '201':
          description: Payment captured successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapturePaymentResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/cancelPayment:
    post:
      tags:
        - Payments
      operationId: cancelPayment
      summary: Cancel a payment
      description: Cancel a payment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelPaymentRequest'
      responses:
        '201':
          description: Payment canceled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelPaymentResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/refundPayment:
    post:
      tags:
        - Payments
      operationId: refundPayment
      summary: Refund a payment
      description: Refund a payment.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundPaymentRequest'
      responses:
        '201':
          description: Payment refunded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundPaymentResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/twint/getOrCreateQrCode:
    post:
      tags:
        - Payments
      operationId: getOrCreateTwintQrCode
      summary: Get or create TWINT qr-code
      description: Get or create a TWINT qr-code for a merchant reference and amount. Returns the `qr` image as base64 encoded QR code image and the `url` encoded within the QR code separately.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TwintQrCodeRequest'
      responses:
        '200':
          description: TWINT QR code retrieved or created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TwintQrCodeResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internalServerError'
  /transaction:
    get:
      tags:
        - Transaction reports
      operationId: getTransactionList
      summary: List transactions
      description: Retrieve a list of transactions with details
      parameters:
        - $ref: '#/components/parameters/transaction-list_accountId'
        - $ref: '#/components/parameters/transaction-list_status'
        - $ref: '#/components/parameters/paymentMethod'
        - $ref: '#/components/parameters/type'
        - $ref: '#/components/parameters/channel'
        - $ref: '#/components/parameters/currencyCode'
        - $ref: '#/components/parameters/merchantReference'
          description: Filter by merchant reference. This field will override other parameters except createdAt.startDate and createdAt.endDate.
        - $ref: '#/components/parameters/transactionId'
        - $ref: '#/components/parameters/lastFour'
        - $ref: '#/components/parameters/bin'
        - $ref: '#/components/parameters/accountHolderName'
        - $ref: '#/components/parameters/createdAtStartDate'
        - $ref: '#/components/parameters/createdAtEndDate'
        - $ref: '#/components/parameters/amountMin'
        - $ref: '#/components/parameters/amountMax'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/lastKey'
      responses:
        '200':
          description: List of transactions
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/paginatedResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/TransactionListItemResponse'
                        example:
                          - createdAt: '2025-08-08T11:03:55.167Z'
                            updatedAt: '2025-08-08T11:05:55.825Z'
                            id: 212101b1c8d580127f141a1f018
                            metadata:
                              invoiceId: INV-12345
                              customerRef: CUST-98765
                            checkoutId: null
                            initialTransactionId: null
                            status: SETTLED
                            channel: ECOM
                            type: CAPTURE
                            paymentMethod: card
                            balanceAccountId: null
                            balanceAccountName: null
                            balanceAccountTransactionType: null
                            operatingAccountId: 212100419d82e00e790f4e0f0c3
                            merchantAccountId: 212100219d82e00e790f3fc1019
                            platformAccountId: 212103e19be5c00e21c7c491011
                            operatingAccountName: Book Store Toronto
                            merchantAccountName: Nomad Publisher
                            platformAccountName: Book Platform
                            merchantReference: ORDER-1754651033
                            currencyCode: EUR
                            latestAmount: 10000
                            totalAuthorizedAmount: 10000
                            totalCanceledAmount: 0
                            totalCapturedAmount: 10000
                            totalRefundedAmount: 0
                            totalDisputedAmount: 0
                            shopperCountryCode: NL
                            accountHolderName: Carolyn Greenfelder MD
                            accountNumber: null
                            cardDetails:
                              issuerName: Visa Inc.
                              issuerCountryCode: NL
                              lastFour: '0036'
                              bin: '401881'
                              walletType: null
                              cardType: COMMERCIAL
                              cardProduct: DEBIT
                              region: DOMESTIC
                              brand: Visa
                              subBrand: VISA Signature
                            declineCode: null
                            declineMessage: null
                            disputeCode: null
                            disputeMessage: null
                          - createdAt: '2025-08-06T06:06:30.233Z'
                            updatedAt: '2025-08-06T06:06:32.417Z'
                            id: 212101b1c801101273b71759015
                            metadata:
                              invoiceId: INV-56789
                              customerRef: CUST-32100
                            checkoutId: 21210201c800901273b6de64019
                            initialTransactionId: null
                            status: DECLINED
                            channel: ECOM
                            type: AUTHORIZATION
                            paymentMethod: card
                            balanceAccountId: null
                            balanceAccountName: null
                            balanceAccountTransactionType: null
                            operatingAccountId: 212100419d82e00e790f4e0f0c3
                            merchantAccountId: 212100219d82e00e790f3fc1019
                            platformAccountId: 212103e19be5c00e21c7c491011
                            operatingAccountName: Book Store Toronto
                            merchantAccountName: Nomad Publisher
                            platformAccountName: Book Platform
                            merchantReference: '2023-08-23T13:48:49.978Z'
                            currencyCode: EUR
                            latestAmount: 2313
                            totalAuthorizedAmount: 0
                            totalCanceledAmount: 0
                            totalCapturedAmount: 0
                            totalRefundedAmount: 0
                            totalDisputedAmount: 0
                            shopperCountryCode: null
                            accountHolderName: null
                            accountNumber: null
                            cardDetails:
                              issuerName: Visa Inc.
                              issuerCountryCode: null
                              lastFour: null
                              bin: null
                              walletType: null
                              cardType: null
                              cardProduct: null
                              region: null
                              brand: Visa
                              subBrand: null
                            declineCode: '57'
                            declineMessage: Transaction not permitted to cardholder - The cardholder is not permitted to perform this transaction.
                            disputeCode: null
                            disputeMessage: null
                          - createdAt: '2025-08-06T08:03:29.186Z'
                            updatedAt: '2025-08-07T01:16:42.879Z'
                            id: 212101b1c80cf01274223122033
                            metadata:
                              invoiceId: INV-24680
                              customerRef: CUST-11223
                            checkoutId: 21210201c80cd01274221ebc0f0
                            initialTransactionId: null
                            status: SETTLED
                            channel: ECOM
                            type: CAPTURE
                            paymentMethod: ideal
                            balanceAccountId: null
                            balanceAccountName: null
                            balanceAccountTransactionType: null
                            operatingAccountId: 21210041c804101273c8ac990f7
                            merchantAccountId: 21210021c804101273c89917019
                            platformAccountId: 212103e1c802b01273be47ed018
                            operatingAccountName: Keizergracht ABC
                            merchantAccountName: Amsterdam ABC
                            platformAccountName: Netherlands ABC
                            merchantReference: '2023-08-23T13:48:49.978Z'
                            currencyCode: EUR
                            latestAmount: 2830
                            totalAuthorizedAmount: 2830
                            totalCanceledAmount: 0
                            totalCapturedAmount: 2830
                            totalRefundedAmount: 0
                            totalDisputedAmount: 0
                            shopperCountryCode: null
                            accountHolderName: Kevin van der Laan
                            accountNumber: NL91**********4300
                            cardDetails:
                              issuerName: Visa Inc.
                              issuerCountryCode: null
                              lastFour: null
                              bin: null
                              walletType: null
                              cardType: null
                              cardProduct: null
                              region: null
                              brand: Visa
                              subBrand: null
                            declineCode: null
                            declineMessage: null
                            disputeCode: null
                            disputeMessage: null
                          - createdAt: '2025-08-05T13:41:48.872Z'
                            updatedAt: '2025-08-06T01:16:58.106Z'
                            id: 212101b1c7aac012703194c8022
                            metadata:
                              invoiceId: INV-13579
                              customerRef: CUST-44556
                            checkoutId: 21210201c7a6701270088471017
                            initialTransactionId: null
                            status: SETLLED
                            channel: ECOM
                            type: CAPTURE
                            paymentMethod: openbanking
                            balanceAccountId: null
                            balanceAccountName: null
                            balanceAccountTransactionType: null
                            operatingAccountId: 212100419769d00d4a62d48c098
                            merchantAccountId: 212100219769d00d4a62ccea013
                            platformAccountId: 212103e19769800d4a61b889010
                            operatingAccountName: Reebok Keizergracht
                            merchantAccountName: Reebok Amsterdam
                            platformAccountName: Reebok Netherlands
                            merchantReference: '1754398616'
                            currencyCode: EUR
                            latestAmount: 10000
                            totalAuthorizedAmount: 10000
                            totalCanceledAmount: 0
                            totalCapturedAmount: 10000
                            totalRefundedAmount: 0
                            totalDisputedAmount: 0
                            shopperCountryCode: NL
                            accountHolderName: Vince Carter
                            accountNumber: NL48**********0009
                            cardDetails:
                              issuerName: Visa Inc.
                              issuerCountryCode: null
                              lastFour: null
                              bin: null
                              walletType: null
                              cardType: null
                              cardProduct: null
                              region: null
                              subBrand: null
                            declineCode: null
                            declineMessage: null
                            disputeCode: null
                            disputeMessage: null
                          - createdAt: '2025-08-08T11:03:55.167Z'
                            updatedAt: '2025-08-14T12:41:59.286Z'
                            id: 212101b1c8d580127f141a1f018
                            metadata:
                              invoiceId: INV-88888
                              customerRef: CUST-99999
                            checkoutId: ''
                            initialTransactionId: ''
                            status: SETTLED
                            channel: ECOM
                            type: CHARGEBACK
                            paymentMethod: card
                            balanceAccountId: ''
                            balanceAccountName: ''
                            balanceAccountTransactionType: ''
                            operatingAccountId: 212100419d82e00e790f4e0f0c3
                            merchantAccountId: 212100219d82e00e790f3fc1019
                            platformAccountId: 212103e19be5c00e21c7c491011
                            operatingAccountName: EV Charging Dundass Square
                            merchantAccountName: EV Charging Merchant
                            platformAccountName: EV Charging Platform
                            merchantReference: '1754651033'
                            currencyCode: EUR
                            latestAmount: 10000
                            totalAuthorizedAmount: 10000
                            totalCanceledAmount: 0
                            totalCapturedAmount: 0
                            totalRefundedAmount: 0
                            totalDisputedAmount: -10000
                            shopperCountryCode: NL
                            accountHolderName: Shannon Becker
                            accountNumber: null
                            cardDetails:
                              issuerName: Visa Inc.
                              issuerCountryCode: NL
                              lastFour: '0036'
                              bin: '401881'
                              walletType: null
                              cardType: COMMERCIAL
                              cardProduct: DEBIT
                              region: DOMESTIC
                              brand: Visa
                              subBrand: VISA Signature
                            declineCode: null
                            declineMessage: null
                            disputeCode: '4837'
                            disputeMessage: No Cardholder Authorization
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /transaction/getRefundById/{id}:
    get:
      tags:
        - Transaction reports
      operationId: getRefundById
      summary: Get a refund by ID
      description: Retrieve detailed information about a specific refund
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the refund to retrieve
      responses:
        '200':
          description: Refund details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundResponse'
              examples:
                RefundExample:
                  summary: Refund with metadata
                  value:
                    refundId: 21210021c2855007efa2d657018
                    status: INITIATED
                    amount: 1000
                    currencyCode: EUR
                    txId: 21210021c2855007efa2d657019
                    createdAt: '2024-01-15T10:30:00Z'
                    acquirer: 21210021c2855007efa2d657020
                    merchantReference: ORDER-12345
                    metadata:
                      invoiceId: INV-12345
                      customerRef: CUST-98765
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /transaction/merchant/getTransactionById/{id}:
    get:
      tags:
        - Transaction reports
      operationId: getMerchantTransactionById
      summary: Get transaction by ID (merchant view)
      description: Returns transaction details visible to merchants, excluding internal platform information
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the transaction to retrieve
      responses:
        '200':
          description: Detailed transaction information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDetailsMerchantResponse'
              examples:
                AuthorizedTransaction:
                  summary: Authorized transaction
                  value:
                    id: 21210021c2855007efa2d657018
                    metadata:
                      invoiceId: INV-12345
                      customerRef: CUST-98765
                    checkoutId: 21210021c2855007efa2d657019
                    createdAt: '2024-01-15T10:30:00Z'
                    updatedAt: '2024-01-15T10:35:00Z'
                    currencyCode: EUR
                    accountId: 21210021c2855007efa2d657020
                    latestStatus: AUTHORIZED
                    latestTransactionType: AUTHORIZATION
                    latestAmount: 1000
                    formattedLatestAmount: €10.00
                    shopperCountryCode: NL
                    totalAuthAmount: 1000
                    expiresAt: '2024-01-22T10:30:00Z'
                    children:
                      - id: 21210021c2855007efa2d657028
                        amount: 1000
                        currencyCode: EUR
                        formattedAmount: €10.00
                        transactionType: AUTHORIZATION
                        transactionVariant: card
                        transactionChannel: ECOM
                        merchantReference: order-12345
                        acquirerAccountId: 21210021c2855007efa2d657029
                        paymentMethodDetails:
                          card:
                            cardDetails:
                              bin: '424242'
                              lastFour: '4242'
                              expiryMonth: 12
                              expiryYear: 2025
                              cardholderName: John Doe
                              cardType: CONSUMER
                              cardBrand: Visa
                              cardSubBrand: Classic
                              cardRegionType: INTERREGIONAL
                              cardFundingSource: CREDIT
                            cardToken: tok_1234567890
                            captureWhen: INSTANT
                            transactionType: FIRST_UNSCHEDULED
                            initialTransactionId: 21210021c2855007efa2d657018
                            authorizationType: FINAL_AUTH
                            preAuthorizationType: STANDARD
                            maximumAuthorizationAmount: 1000
                            walletType: APPLE_PAY
                            dynamicDescriptor: My Company
                        events:
                          - id: 21210021c2855007efa2d657030
                            status: INITIATED
                            details:
                              responseMessage: Transaction initiated
                              responseCode: '000'
                            createdAt: '2024-01-15T10:30:00Z'
                          - id: 21210021c2855007efa2d657031
                            status: AUTHORIZED
                            details:
                              responseMessage: Transaction approved
                              responseCode: '000'
                            createdAt: '2024-01-15T10:31:00Z'
                        createdAt: '2024-01-15T10:30:00Z'
                SettledTransaction:
                  summary: Settled transaction
                  value:
                    id: 21210021c2855007efa2d657018
                    metadata:
                      invoiceId: INV-56789
                      customerRef: CUST-32100
                    checkoutId: 21210021c2855007efa2d657019
                    createdAt: '2024-01-15T10:30:00Z'
                    updatedAt: '2024-01-15T10:40:00Z'
                    currencyCode: EUR
                    accountId: 21210021c2855007efa2d657020
                    latestStatus: SETTLED
                    latestTransactionType: CAPTURE
                    latestAmount: 1000
                    formattedLatestAmount: €10.00
                    shopperCountryCode: NL
                    totalAuthAmount: 1000
                    expiresAt: '2024-01-22T10:30:00Z'
                    children:
                      - id: 21210021c2855007efa2d657028
                        amount: 1000
                        currencyCode: EUR
                        formattedAmount: €10.00
                        transactionType: AUTHORIZATION
                        transactionVariant: card
                        transactionChannel: ECOM
                        merchantReference: order-12345
                        acquirerAccountId: 21210021c2855007efa2d657029
                        paymentMethodDetails:
                          card:
                            cardDetails:
                              bin: '424242'
                              lastFour: '4242'
                              expiryMonth: 12
                              expiryYear: 2025
                              cardholderName: John Doe
                              cardType: CONSUMER
                              cardBrand: Visa
                              cardSubBrand: Classic
                              cardRegionType: INTERREGIONAL
                              cardFundingSource: CREDIT
                            cardToken: tok_1234567890
                            captureWhen: INSTANT
                            transactionType: FIRST_UNSCHEDULED
                            initialTransactionId: 21210021c2855007efa2d657018
                            authorizationType: FINAL_AUTH
                            preAuthorizationType: STANDARD
                            maximumAuthorizationAmount: 1000
                            walletType: APPLE_PAY
                            dynamicDescriptor: My Company
                        events:
                          - id: 21210021c2855007efa2d657030
                            status: INITIATED
                            details:
                              responseMessage: Transaction initiated
                              responseCode: '000'
                            createdAt: '2024-01-15T10:30:00Z'
                          - id: 21210021c2855007efa2d657031
                            status: AUTHORIZED
                            details:
                              responseMessage: Transaction approved
                              responseCode: '000'
                            createdAt: '2024-01-15T10:31:00Z'
                        createdAt: '2024-01-15T10:30:00Z'
                      - id: 21210021c2855007efa2d657032
                        amount: 1000
                        currencyCode: EUR
                        formattedAmount: €10.00
                        transactionType: CAPTURE
                        transactionVariant: card
                        transactionChannel: ECOM
                        merchantReference: order-12345
                        acquirerAccountId: 21210021c2855007efa2d657029
                        events:
                          - id: 21210021c2855007efa2d657033
                            status: INITIATED
                            details:
                              responseCode: '00'
                            createdAt: '2024-01-15T10:32:00Z'
                          - id: 21210021c2855007efa2d657036
                            status: SETTLED
                            details:
                              platformPriceFixedFee: 0.15
                              platformPricePercentageFee: 2.5
                              platformFeeAmount: 40000
                              platformFeeDecimals: 5
                              platformFeeCurrencyCode: EUR
                              platformFeeFormatted: '-€0.40'
                              platformPriceRecordId: '4361'
                              merchantNetAmount: 960000
                              merchantNetDecimals: 5
                              merchantNetCurrencyCode: EUR
                              merchantNetAmountFormatted: €9.60
                              splitPaymentCommissionAmountDecimals: 5
                              txNetAmountInPlatformCurrency: 960000
                              txNetAmountInPlatformCurrencyDecimals: 5
                              txNetAmountInPlatformPricingCurrencyCode: EUR
                              txNetAmountInPlatformCurrencyFormatted: €9.60
                              txGrossAmountInPlatformCurrency: 1000000
                              txGrossAmountInPlatformCurrencyDecimals: 5
                              txGrossAmountInPlatformPricingCurrencyCode: EUR
                              txGrossAmountInPlatformCurrencyFormatted: €10.00
                              txNetAmountInTransactionCurrency: 960000
                              txNetAmountInTransactionCurrencyDecimals: 5
                              txNetAmountInTransactionCurrencyCode: EUR
                              txNetAmountInTransactionCurrencyFormatted: €9.60
                              txNetAmountBeforeFx: 960000
                              txNetAmountBeforeFxDecimals: 5
                              txNetAmountBeforeFxCurrencyCode: EUR
                              txNetAmountBeforeFxFormatted: €9.60
                              splitPaymentCommissionBeforeFx: 0
                              splitPaymentCommissionBeforeFxDecimals: 5
                              splitPaymentCommissionBeforeFxCurrencyCode: EUR
                              platformFeeGrossBeforeFxFee: 40000
                              platformFeeGrossBeforeFxFeeDecimals: 5
                              platformFeeGrossBeforeFxFeeCurrencyCode: EUR
                              platformFeeGrossBeforeFxFeeFormatted: '-€0.40'
                              platformFeeAfterFxFee: 40000
                              platformFeeAfterFxFeeDecimals: 5
                              platformFeeAfterFxFeeCurrencyCode: EUR
                              platformFeeAfterFxFeeFormatted: '-€0.40'
                              platformInterchangeFee: -3000
                              platformInterchangeFeeDecimals: 5
                              platformInterchangeFeeCurrencyCode: EUR
                              platformInterchangeFeeFormatted: '-€0.03'
                              platformSchemeFee: -1000
                              platformSchemeFeeDecimals: 5
                              platformSchemeFeeCurrencyCode: EUR
                              platformSchemeFeeFormatted: '-€0.01'
                            createdAt: '2024-01-15T10:40:00Z'
                        createdAt: '2024-01-15T10:32:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /transaction/platform/getTransactionById/{id}:
    get:
      tags:
        - Transaction reports
      operationId: getPlatformTransactionById
      summary: Get transaction by ID (platform view)
      description: Returns complete transaction details including platform fees and internal information
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the transaction to retrieve
      responses:
        '200':
          description: Detailed transaction information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDetailsPlatformResponse'
              examples:
                AuthorizedTransaction:
                  summary: Authorized transaction
                  value:
                    id: 21210021c2855007efa2d657018
                    metadata:
                      invoiceId: INV-12345
                      customerRef: CUST-98765
                    checkoutId: 21210021c2855007efa2d657019
                    createdAt: '2024-01-15T10:30:00Z'
                    updatedAt: '2024-01-15T10:35:00Z'
                    currencyCode: EUR
                    accountId: 21210021c2855007efa2d657020
                    latestStatus: AUTHORIZED
                    latestTransactionType: AUTHORIZATION
                    latestAmount: 1000
                    formattedLatestAmount: €10.00
                    shopperCountryCode: NL
                    totalAuthAmount: 1000
                    expiresAt: '2024-01-22T10:30:00Z'
                    children:
                      - id: 21210021c2855007efa2d657028
                        amount: 1000
                        currencyCode: EUR
                        formattedAmount: €10.00
                        transactionType: AUTHORIZATION
                        transactionVariant: card
                        transactionChannel: ECOM
                        merchantReference: order-12345
                        acquirerAccountId: 21210021c2855007efa2d657029
                        paymentMethodDetails:
                          card:
                            cardDetails:
                              bin: '424242'
                              lastFour: '4242'
                              expiryMonth: 12
                              expiryYear: 2025
                              cardholderName: John Doe
                              cardType: CONSUMER
                              cardBrand: Visa
                              cardSubBrand: Classic
                              cardRegionType: INTERREGIONAL
                              cardFundingSource: CREDIT
                            cardToken: tok_1234567890
                            captureWhen: INSTANT
                            transactionType: FIRST_UNSCHEDULED
                            initialTransactionId: 21210021c2855007efa2d657018
                            authorizationType: FINAL_AUTH
                            preAuthorizationType: STANDARD
                            maximumAuthorizationAmount: 1000
                            walletType: APPLE_PAY
                            dynamicDescriptor: My Company
                        events:
                          - id: 21210021c2855007efa2d657030
                            status: INITIATED
                            details:
                              responseMessage: Transaction initiated
                              responseCode: '000'
                            createdAt: '2024-01-15T10:30:00Z'
                          - id: 21210021c2855007efa2d657031
                            status: AUTHORIZED
                            details:
                              responseMessage: Transaction approved
                              responseCode: '000'
                            createdAt: '2024-01-15T10:31:00Z'
                        createdAt: '2024-01-15T10:30:00Z'
                SettledTransaction:
                  summary: Settled transaction
                  value:
                    id: 21210021c2855007efa2d657018
                    metadata:
                      invoiceId: INV-56789
                      customerRef: CUST-32100
                    checkoutId: 21210021c2855007efa2d657019
                    createdAt: '2024-01-15T10:30:00Z'
                    updatedAt: '2024-01-15T10:40:00Z'
                    currencyCode: EUR
                    accountId: 21210021c2855007efa2d657020
                    latestStatus: SETTLED
                    latestTransactionType: CAPTURE
                    latestAmount: 1000
                    formattedLatestAmount: €10.00
                    shopperCountryCode: NL
                    totalAuthAmount: 1000
                    expiresAt: '2024-01-22T10:30:00Z'
                    children:
                      - id: 21210021c2855007efa2d657028
                        amount: 1000
                        currencyCode: EUR
                        formattedAmount: €10.00
                        transactionType: AUTHORIZATION
                        transactionVariant: card
                        transactionChannel: ECOM
                        merchantReference: order-12345
                        acquirerAccountId: 21210021c2855007efa2d657029
                        paymentMethodDetails:
                          card:
                            cardDetails:
                              bin: '424242'
                              lastFour: '4242'
                              expiryMonth: 12
                              expiryYear: 2025
                              cardholderName: John Doe
                              cardType: CONSUMER
                              cardBrand: Visa
                              cardSubBrand: Classic
                              cardRegionType: INTERREGIONAL
                              cardFundingSource: CREDIT
                            cardToken: tok_1234567890
                            captureWhen: INSTANT
                            transactionType: FIRST_UNSCHEDULED
                            initialTransactionId: 21210021c2855007efa2d657018
                            authorizationType: FINAL_AUTH
                            preAuthorizationType: STANDARD
                            maximumAuthorizationAmount: 1000
                            walletType: APPLE_PAY
                            dynamicDescriptor: My Company
                        events:
                          - id: 21210021c2855007efa2d657030
                            status: INITIATED
                            details:
                              responseMessage: Transaction initiated
                              responseCode: '000'
                            createdAt: '2024-01-15T10:30:00Z'
                          - id: 21210021c2855007efa2d657031
                            status: AUTHORIZED
                            details:
                              responseMessage: Transaction approved
                              responseCode: '000'
                            createdAt: '2024-01-15T10:31:00Z'
                        createdAt: '2024-01-15T10:30:00Z'
                      - id: 21210021c2855007efa2d657032
                        amount: 1000
                        currencyCode: EUR
                        formattedAmount: €10.00
                        transactionType: CAPTURE
                        transactionVariant: card
                        transactionChannel: ECOM
                        merchantReference: order-12345
                        acquirerAccountId: 21210021c2855007efa2d657029
                        events:
                          - id: 21210021c2855007efa2d657033
                            status: INITIATED
                            details:
                              responseCode: '00'
                            createdAt: '2024-01-15T10:32:00Z'
                          - id: 21210021c2855007efa2d657036
                            status: SETTLED
                            details:
                              fungPriceFixedFee: 0.109
                              fungPricePercentageFee: 0.242
                              fungFeeAmount: 13320
                              fungFeeDecimals: 5
                              fungFeeCurrencyCode: EUR
                              fungFeeFormatted: '-€0.13'
                              fungPriceRecordId: 2
                              fungFeeAfterFx: 17320
                              fungFeeAfterFxDecimals: 5
                              fungFeeAfterFxCurrencyCode: EUR
                              fungFeeAfterFxFormatted: '-€0.17'
                              platformPriceFixedFee: 0.15
                              platformPricePercentageFee: 2.5
                              platformFeeAmount: 40000
                              platformFeeDecimals: 5
                              platformFeeCurrencyCode: EUR
                              platformFeeFormatted: '-€0.40'
                              platformPriceRecordId: '4361'
                              platformNetFeeAmount: 22680
                              platformNetFeeDecimals: 5
                              platformNetFeeCurrencyCode: EUR
                              platformNetFormatted: €0.23
                              platformNetBeforeFx: 22680
                              platformNetBeforeFxDecimals: 5
                              platformNetBeforeFxCurrencyCode: EUR
                              platformNetBeforeFxFormatted: €0.23
                              platformNetFxFee: 0
                              platformNetFxFeeDecimals: 5
                              platformNetFxFeeCurrencyCode: EUR
                              platformNetFxFeeFormatted: €0.00
                              merchantNetAmount: 960000
                              merchantNetDecimals: 5
                              merchantNetCurrencyCode: EUR
                              merchantNetAmountFormatted: €9.60
                              splitPaymentCommissionAmountDecimals: 5
                              txNetAmountInPlatformCurrency: 960000
                              txNetAmountInPlatformCurrencyDecimals: 5
                              txNetAmountInPlatformPricingCurrencyCode: EUR
                              txNetAmountInPlatformCurrencyFormatted: €9.60
                              txGrossAmountInPlatformCurrency: 1000000
                              txGrossAmountInPlatformCurrencyDecimals: 5
                              txGrossAmountInPlatformPricingCurrencyCode: EUR
                              txGrossAmountInPlatformCurrencyFormatted: €10.00
                              txNetAmountInTransactionCurrency: 960000
                              txNetAmountInTransactionCurrencyDecimals: 5
                              txNetAmountInTransactionCurrencyCode: EUR
                              txNetAmountInTransactionCurrencyFormatted: €9.60
                              txGrossAmountInPspCurrency: 1000000
                              txGrossAmountInPspCurrencyDecimals: 5
                              txGrossAmountInPspCurrencyCode: EUR
                              txGrossAmountInPspCurrencyFormatted: €10.00
                              txNetAmountBeforeFx: 960000
                              txNetAmountBeforeFxDecimals: 5
                              txNetAmountBeforeFxCurrencyCode: EUR
                              txNetAmountBeforeFxFormatted: €9.60
                              splitPaymentCommissionBeforeFx: 0
                              splitPaymentCommissionBeforeFxDecimals: 5
                              splitPaymentCommissionBeforeFxCurrencyCode: EUR
                              platformFeeGrossBeforeFxFee: 40000
                              platformFeeGrossBeforeFxFeeDecimals: 5
                              platformFeeGrossBeforeFxFeeCurrencyCode: EUR
                              platformFeeGrossBeforeFxFeeFormatted: '-€0.40'
                              pspGrossBeforeFxFee: 13320
                              pspGrossBeforeFxFeeDecimals: 5
                              pspGrossBeforeFxFeeCurrencyCode: EUR
                              pspGrossBeforeFxFeeFormatted: '-€0.13'
                              pspMerchantFxFee: 0
                              pspMerchantFxFeeDecimals: 5
                              pspMerchantFxFeeCurrencyCode: EUR
                              pspPlatformFxFee: 0
                              pspPlatformFxFeeDecimals: 5
                              pspPlatformFxFeeCurrencyCode: EUR
                              platformFeeAfterFxFee: 40000
                              platformFeeAfterFxFeeDecimals: 5
                              platformFeeAfterFxFeeCurrencyCode: EUR
                              platformFeeAfterFxFeeFormatted: '-€0.40'
                              platformInterchangeFee: -3000
                              platformInterchangeFeeDecimals: 5
                              platformInterchangeFeeCurrencyCode: EUR
                              platformInterchangeFeeFormatted: '-€0.03'
                              platformSchemeFee: -1000
                              platformSchemeFeeDecimals: 5
                              platformSchemeFeeCurrencyCode: EUR
                              platformSchemeFeeFormatted: '-€0.01'
                              pspInterchangeFee: 3000
                              pspInterchangeFeeDecimals: 5
                              pspInterchangeFeeCurrencyCode: EUR
                              pspInterchangeFeeFormatted: '-€0.03'
                              pspSchemeFee: 1000
                              pspSchemeFeeDecimals: 5
                              pspSchemeFeeCurrencyCode: EUR
                              pspSchemeFeeFormatted: '-€0.01'
                            createdAt: '2024-01-15T10:40:00Z'
                        createdAt: '2024-01-15T10:32:00Z'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /account/createOperatingAccount:
    post:
      tags:
        - Operating accounts
      operationId: createOperatingAccount
      summary: Create an operating account
      description: Create a new operating account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OperatingAccountCreateRequest'
      responses:
        '201':
          description: Operating account created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatingAccountResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /account/updateOperatingAccount:
    post:
      tags:
        - Operating accounts
      operationId: updateOperatingAccount
      summary: Update an operating account
      description: Update an existing operating account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OperatingAccountUpdateRequest'
      responses:
        '201':
          description: Operating account updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatingAccountResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /account/getAccountDetails/{id}:
    get:
      tags:
        - Operating accounts
      operationId: getOperatingAccountDetails
      summary: Retrieve an operating account
      description: Retrieve a specific operating account by its id
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Operating account details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatingAccountResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /account/getOperatingAccountList/{merchantAccountId}:
    post:
      tags:
        - Operating accounts
      operationId: getOperatingAccountList
      summary: Get list of operating accounts by merchant account id
      description: Retrieve a list of operating accounts by merchant account id
      parameters:
        - $ref: '#/components/parameters/merchantAccountId'
      responses:
        '200':
          description: List of operating accounts
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OperatingAccountResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /user/getUserListByAccountId/{id}:
    get:
      tags:
        - Users
      operationId: getUserListByAccountId
      summary: List users by account ID
      description: Retrieve a list of users by account ID
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the account to filter by
      responses:
        '200':
          description: List of users
          content:
            application/json:
              schema:
                type: object
                properties:
                  list:
                    type: array
                    items:
                      $ref: '#/components/schemas/models_User'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment-contract/createPaymentContract:
    post:
      tags:
        - Payment contracts
      operationId: createPaymentContract
      summary: Create a payment contract
      description: Create a new payment contract
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentContractCreateRequest'
      responses:
        '201':
          description: Payment contract created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentContractResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment-contract/getPaymentContractById/{id}:
    get:
      tags:
        - Payment contracts
      operationId: getPaymentContractById
      summary: Get a payment contract
      description: Get a specific payment contract by its id
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Payment contract details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentContractResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment-contract/getPaymentContractList:
    get:
      tags:
        - Payment contracts
      operationId: getPaymentContractList
      summary: Get list of payment contracts
      description: Get a list of payment contracts
      responses:
        '200':
          description: List of payment contracts
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaymentContractResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment-contract/suspendPaymentContract:
    post:
      tags:
        - Payment contracts
      operationId: suspendPaymentContract
      summary: Suspend a payment contract
      description: Suspend a payment contract
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuspendPaymentContractRequest'
      responses:
        '200':
          description: Payment contract suspended successfully
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment-profile/createPaymentProfile:
    post:
      tags:
        - Payment profiles
      operationId: createPaymentProfile
      summary: Create a payment profile
      description: Create a payment profile.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentProfileRequest'
      responses:
        '201':
          description: Payment profile created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentProfileResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment-profile/updatePaymentProfile:
    post:
      tags:
        - Payment profiles
      operationId: updatePaymentProfile
      summary: Update a payment profile
      description: Update a payment profile.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePaymentProfileRequest'
      responses:
        '201':
          description: Payment profile updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentProfileResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment-profile/getPaymentProfileByAccountId/{accountId}:
    get:
      tags:
        - Payment profiles
      operationId: getPaymentProfileByAccountId
      summary: Get a payment profile by account ID
      description: Get a payment profile by account ID.
      parameters:
        - name: accountId
          in: path
          required: true
          description: ID of the account to retrieve payment profile for
          schema:
            $ref: '#/components/schemas/id'
      responses:
        '200':
          description: Payment profile
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentProfileResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /checkout/createCheckout:
    post:
      tags:
        - Checkouts
      operationId: createCheckout
      summary: Create a Checkout
      description: Create a new checkout session for processing payments.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutRequest'
      responses:
        '201':
          description: Checkout created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Checkout'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /checkout/getCheckoutById/{id}:
    get:
      tags:
        - Checkouts
      operationId: getCheckoutById
      summary: Get a Checkout by ID
      description: Retrieve details of a checkout session by its ID.
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the checkout
      responses:
        '200':
          description: Checkout details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Checkout'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /checkout/getCheckoutStatus/{id}:
    get:
      tags:
        - Checkouts
      operationId: getCheckoutStatus
      summary: Get Checkout Status
      description: Retrieve the current status of a checkout session.
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the checkout
      responses:
        '200':
          description: Checkout status
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/CheckoutStatus'
                    description: Current status of the checkout
                  metadata:
                    $ref: '#/components/schemas/Metadata'
                    description: Metadata associated with this checkout
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payment/balance-account/initiatePayout:
    post:
      tags:
        - Payout
      operationId: initiateBalanceAccountPayout
      summary: Initiate a payout
      description: Initiate a payout from a balance account.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitiatePayoutForBalanceAccount'
      responses:
        '201':
          description: Payout initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayoutResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /payout/{payoutId}/settlement-report:
    get:
      tags:
        - Payout reports
      operationId: getSettlementReportByPayoutId
      summary: Retrieve a Payout Settlement Report
      description: Retrieve a Settlement Report for a Payout in CSV format.
      parameters:
        - name: payoutId
          in: path
          required: true
          description: The ID of the payout to retrieve the settlement report for
          schema:
            type: string
      responses:
        '200':
          description: Report download information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/file'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /theme/createTheme:
    post:
      tags:
        - Themes
      operationId: createTheme
      summary: Create a theme
      description: Create a new theme
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThemeCreateRequest'
      responses:
        '201':
          description: Theme created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThemeResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /theme/getThemeById/{id}:
    get:
      tags:
        - Themes
      operationId: getThemeById
      summary: Retrieve a theme
      description: Retrieve a theme by ID
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Theme details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThemeResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /theme/getThemesByAccountId/{id}:
    get:
      tags:
        - Themes
      operationId: getThemesByAccountId
      summary: Get themes by account ID
      description: List themes by account ID
      parameters:
        - $ref: '#/components/parameters/id'
        - in: query
          name: app
          required: false
          schema:
            type: string
            enum:
              - CHECKOUT
            x-enum-descriptions:
              CHECKOUT: Checkout page
            description: The application to get themes for, currently only `CHECKOUT` is supported
            example: CHECKOUT
      responses:
        '200':
          description: Theme details
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ThemeResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /threeds/startThreedsAuthentication:
    post:
      tags:
        - 3DS Authentication
      operationId: startThreedsAuthentication
      summary: Start 3DS Authentication
      description: |
        Initiates a 3DS authentication process for a card payment.

        This endpoint starts the 3DS authentication flow which may require:
        - Device fingerprinting (handled via rendering an invisible iframe)
        - Challenge flow (handled via rendering an iframe)

        The response will indicate the current status and any required actions.
        Notifications are sent if configured using the Notification Configuration API, alternatively
        use the returned ID to poll for status updates using the getThreedsStatus endpoint.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartThreedsRequest'
      responses:
        '200':
          description: 3DS authentication started successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreedsResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /threeds/getThreedsStatus/{id}:
    get:
      tags:
        - 3DS Authentication
      operationId: getThreedsStatus
      summary: Get 3DS Authentication Status
      description: |
        Retrieves the current status of a 3DS authentication process.

        **Status Transitions:**
        - `AUTHENTICATED`
        - `INPROGRESS` (device fingerprinting) → `INPROGRESS` (challenge) → `AUTHENTICATED`
        - `INPROGRESS` (device fingerprinting) → `AUTHENTICATED` (frictionless)
        - `INPROGRESS` → `DECLINED`
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: 3DS authentication status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreedsResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /threeds/cancelThreedsAuthentication/{id}:
    post:
      tags:
        - 3DS Authentication
      operationId: cancelThreedsAuthentication
      summary: Cancel 3DS Authentication
      description: |
        Cancels an ongoing 3DS authentication process.

        This endpoint should be called when:
        - User cancels the payment flow
        - Timeout occurs during authentication
        - An error occurs that requires cleanup

        After cancellation, the 3DS session becomes invalid and cannot be resumed.
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: 3DS authentication cancelled successfully
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /terminal/registerTerminal:
    post:
      tags:
        - Terminals
      operationId: registerTerminal
      summary: Register a terminal
      description: Register a new terminal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterTerminalRequest'
      responses:
        '201':
          description: Terminal registered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /terminal/getTerminalById/{id}:
    get:
      tags:
        - Terminals
      operationId: getTerminalById
      summary: Retrieve a terminal
      description: Retrieve a terminal by its ID
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Terminal retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '500':
          $ref: '#/components/responses/internalServerError'
  /notification/getWebhookNotificationsByConfigId/{id}:
    get:
      tags:
        - Notifications
      operationId: listWebhookNotificationsByConfigId
      summary: List webhook notifications
      description: Retrieve a paginated list of webhook notifications of the provided webhook configuration
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the webhook configuration to retrieve notifications for
        - $ref: '#/components/parameters/startDate'
          description: Filter notifications created on or after this date (YYYY-MM-DD)
        - $ref: '#/components/parameters/endDate'
          description: Filter notifications created on or before this date (YYYY-MM-DD)
        - $ref: '#/components/parameters/limit'
          description: Maximum number of notifications to return
        - $ref: '#/components/parameters/lastKey'
          description: Pagination key from the previous response
        - $ref: '#/components/parameters/notificationType'
          description: Filter notifications by event type
      responses:
        '200':
          description: List of webhook notifications
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrieveNotificationsResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /notification/getWebhookNotificationsByResourceId/{resourceId}:
    get:
      tags:
        - Notifications
      operationId: listWebhookNotificationsByResourceId
      summary: List webhook notifications by resource ID
      description: Retrieve a paginated list of notifications related to the resource (e.g. a transaction) identified by the provided ID.
      parameters:
        - name: resourceId
          in: path
          required: true
          description: ID of the resource to retrieve notifications for
          schema:
            $ref: '#/components/schemas/id'
        - $ref: '#/components/parameters/startDate'
          description: Filter notifications created on or after this date (YYYY-MM-DD)
        - $ref: '#/components/parameters/endDate'
          description: Filter notifications created on or before this date (YYYY-MM-DD)
        - $ref: '#/components/parameters/limit'
          description: Maximum number of notifications to return
        - $ref: '#/components/parameters/lastKey'
          description: Pagination key from the previous response
      responses:
        '200':
          description: List of webhook notifications
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrieveNotificationsResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /notification/resendWebhookNotifications/{webhookConfigId}:
    post:
      tags:
        - Notifications
      operationId: resendWebhookNotifications
      summary: Resend webhook notifications
      description: |
        Retry delivery of notifications by the specified webhook configuration.
        You can optionally limit the resend to notifications created within a time range and/or of a specific event type.
      parameters:
        - name: webhookConfigId
          in: path
          required: true
          description: ID of the webhook whose notifications will be resent
          schema:
            $ref: '#/components/schemas/id'
        - $ref: '#/components/parameters/fromDate'
        - $ref: '#/components/parameters/toDate'
        - $ref: '#/components/parameters/notificationType'
          description: Resend only notifications of this event type
      responses:
        '202':
          description: Accepted resend request
          content:
            application/json:
              schema:
                type: object
                required:
                  - count
                  - message
                properties:
                  count:
                    type: integer
                    description: Number of notifications queued for resend
                    example: 3
                  message:
                    type: string
                    description: Status message
                    example: 3 notifications resent successfully
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /notification/getWebhookNotificationsByConfigIdAndStatus/{id}/{status}:
    get:
      tags:
        - Notifications
      operationId: listWebhookNotificationsByConfigIdAndStatus
      summary: List webhook notifications by configuration ID and status
      description: Retrieve a paginated list of notifications for the provided webhook configuration that match the given delivery status.
      parameters:
        - name: id
          in: path
          required: true
          description: ID of the webhook configuration to retrieve notifications for
          schema:
            $ref: '#/components/schemas/id'
        - name: status
          in: path
          required: true
          description: Delivery status of the notifications to filter by
          schema:
            type: string
            enum:
              - SENT
              - FAILED
              - RESEND
            example: SENT
        - $ref: '#/components/parameters/startDate'
          description: Filter notifications created on or after this date (YYYY-MM-DD)
        - $ref: '#/components/parameters/endDate'
          description: Filter notifications created on or before this date (YYYY-MM-DD)
        - $ref: '#/components/parameters/limit'
          description: Maximum number of notifications to return
        - $ref: '#/components/parameters/lastKey'
          description: Pagination key from the previous response
      responses:
        '200':
          description: List of notifications
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrieveNotificationsResponse'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /report:
    post:
      tags:
        - Reports
      summary: Generate a report
      description: Generate a report for the specified date range
      operationId: generateReport
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReportDto'
              example:
                reportType: ACTIVITY
                parameters:
                  startDate: '2024-01-01'
                  endDate: '2024-01-31'
                  accountId: 212100419d82e00e790f4e0f0c3
                  reportView: MERCHANT
                  transactionType:
                    - AUTHORIZATION
                    - CAPTURE
                  eventType:
                    - AUTHORIZED
                    - SETTLED
                  currencyCode:
                    - EUR
                    - CHF
      responses:
        '200':
          description: Report generation started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Report'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internalServerError'
    get:
      tags:
        - Reports
      summary: List all Reports
      description: Retrieve a list of reports based on the provided filters
      operationId: getReportList
      parameters:
        - $ref: '#/components/parameters/accountId'
          description: Account ID to filter reports by. Can be a Platform, Merchant, Operating or Balance account ID.
        - $ref: '#/components/parameters/startDate'
          description: Filter reports created after this date
        - $ref: '#/components/parameters/endDate'
          description: Filter reports created before this date
        - name: reportType
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/reportType'
      responses:
        '200':
          description: List of reports
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Report'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internalServerError'
  /report/{id}:
    get:
      tags:
        - Reports
      summary: Retrieve a Report
      description: Retrieve detailed information about a specific report
      operationId: getReportById
      parameters:
        - $ref: '#/components/parameters/id'
          description: ID of the report to retrieve
      responses:
        '200':
          description: Detailed report information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Report'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
  /report/{id}/download:
    get:
      tags:
        - Reports
      operationId: downloadReport
      summary: Retrieve Download URL
      description: Get download URL for a specific report
      parameters:
        - name: id
          in: path
          required: true
          description: ID of the report to download
          schema:
            type: string
      responses:
        '200':
          description: Report download information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/file'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/unauthorized'
        '404':
          $ref: '#/components/responses/notFound'
        '500':
          $ref: '#/components/responses/internalServerError'
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
      description: Use API Key ID as username and API Key Secret as password
  schemas:
    name:
      type: string
      description: Name of the resource
      example: My resource
    id:
      type: string
      description: Identifier of the resource
      example: 21210021c2855007efa2d657018
    credentialRole:
      type: string
      enum:
        - ADMIN
        - MEMBER
        - DEVELOPER
        - PROVISIONER
      x-enum-descriptions:
        ADMIN: Full administrative access to all resources
        MEMBER: Read-only access to all resources
        DEVELOPER: Access to payment operations, typically assigned to API keys used for payment integrations
        PROVISIONER: Limited role for provisioning new Merchant and User accounts. Only available for Platform accounts.
      example: DEVELOPER
    ApiKeyCreateRequest:
      type: object
      description: Request to create an API key
      required:
        - name
        - userId
        - role
      properties:
        name:
          $ref: '#/components/schemas/name'
          description: Name of the API key to help identify it
        userId:
          $ref: '#/components/schemas/id'
          description: ID of the user to whom the API key will be assigned
        role:
          $ref: '#/components/schemas/credentialRole'
          description: Role of the API key
      example:
        name: Production API Key
        userId: 21210021c2855007efa2d657018
        role: DEVELOPER
    ApiKeyCreateResponse:
      type: object
      description: Response to create an API key
      required:
        - id
        - secret
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: ID of the API key
        secret:
          type: string
          description: |
            The secret key for API authentication.

            **Note:** This is only included in the response when creating a new API key.
            For security reasons, the secret is not returned in subsequent API calls.
      example:
        id: 21210021c2855007efa2d657018
        secret: sk_test_1234567890abcdef
    errorBase:
      type: object
      required:
        - message
        - details
        - statusCode
        - code
        - version
        - traceIds
      properties:
        message:
          type: string
          description: Standardized human-readable error message
          example: There is an error with the data provided in your request, please see details for more information
        details:
          type: object
          description: Specific error details
          additionalProperties: true
        statusCode:
          type: integer
          description: HTTP status code
          example: 400
        code:
          type: string
          description: Error code
          example: MALFORMED_PARAMETERS
        version:
          type: string
          description: API version
          example: v1
        traceIds:
          type: object
          description: Tracing information
          properties:
            traceId:
              type: string
              example: 1-6876b3f7-3c06da5c11e798d539a9087e
          additionalProperties: true
    validationError:
      allOf:
        - $ref: '#/components/schemas/errorBase'
        - type: object
          properties:
            message:
              enum:
                - There is an error with the data provided in your request, please see details for more information
            statusCode:
              enum:
                - 400
            code:
              enum:
                - MALFORMED_PARAMETERS
            details:
              type: object
              properties:
                error:
                  type: array
                  items:
                    type: string
                  example:
                    - 'Invalid reference: 112101b178d86011ef5d596d016'
    unauthorizedError:
      type: object
      required:
        - Message
      properties:
        Message:
          type: string
          description: Unauthorized access message
          example: User is not authorized to access this resource with an explicit deny
    internalServerError:
      allOf:
        - $ref: '#/components/schemas/errorBase'
        - type: object
          properties:
            message:
              enum:
                - Your request has returned an error, please see details for more information
            statusCode:
              enum:
                - 500
            code:
              enum:
                - API_ERROR
            details:
              type: object
              properties:
                error:
                  type: array
                  items:
                    type: string
                  example:
                    - No error message provided
            traceIds:
              type: object
              example: {}
    accountId:
      type: string
      description: ID of the parent account that owns this entity
      example: 21210021c2855007efa2d657018
    verificationStatus:
      type: string
      enum:
        - UNVERIFIED
        - PENDING
        - VERIFIED
        - CHANGES_REQUESTED
        - SUSPENDED
      x-enum-descriptions:
        UNVERIFIED: The resource is not verified
        PENDING: The resource is pending review
        VERIFIED: The resource is reviewed and verified
        CHANGES_REQUESTED: The resource requires changes before it can be used
        SUSPENDED: The resource is suspended and cannot be used
      example: UNVERIFIED
    fundingInstrumentIncludeOptions:
      type: array
      items:
        type: string
        enum:
          - CHILDREN
        x-enum-descriptions:
          CHILDREN: Include instruments that belong to one of the children of the account id provided
      example:
        - CHILDREN
    paginationMetadata:
      type: object
      properties:
        lastKey:
          type: string
          description: Opaque cursor for the next page. Include this value in the next request to get the next page of results
          example: eyJsYXN0SWQiOiIyMTIxMDAyMWMyODU1MDA3ZWZhMmQ2NTcwMTgiLCJsYXN0Q3JlYXRlZEF0IjoiMjAyNC0wMS0xNVQxNDo0NTowMFoifQ==
        count:
          type: integer
          description: Count of items returned in the response
          example: 20
        hasMoreItems:
          type: boolean
          description: Whether there are more items available
          example: true
      required:
        - count
        - hasMoreItems
    paginatedResponse:
      type: object
      properties:
        data:
          type: array
          description: Array of items
          items:
            type: object
        pagination:
          $ref: '#/components/schemas/paginationMetadata'
      required:
        - data
        - pagination
    createdAt:
      type: string
      format: date-time
      description: Timestamp when the entity was created
      example: '2024-01-15T10:30:00Z'
    updatedAt:
      type: string
      format: date-time
      description: Timestamp when the entity was last updated
      example: '2024-01-15T14:45:00Z'
    base-entity:
      type: object
      required:
        - id
        - createdAt
        - updatedAt
        - accountId
      properties:
        id:
          $ref: '#/components/schemas/id'
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
        accountId:
          $ref: '#/components/schemas/accountId'
    bankAccountDetails:
      type: object
      properties:
        accountNumber:
          type: string
          description: Account number as IBAN.
          example: NL45DEUTD2012036437
          minLength: 1
        accountHolderName:
          type: string
          description: Name of the account holder
          example: John Doe
          minLength: 1
        bankName:
          type: string
          description: Name of the bank or financial institution
          example: Barclays Bank
        bankCode:
          type: string
          description: |
            Bank identification code:
            - BIC/SWIFT code for international transfers
            - Sort code for UK accounts
            - Routing number for US accounts
            - Other local bank codes
          example: NWBKGB2L
        accountNumberType:
          type: string
          enum:
            - IBAN
          description: Type of account number
          default: IBAN
          example: IBAN
        bankCodeType:
          type: string
          enum:
            - BIC
          description: Type of bank code
          default: BIC
          example: BIC
    FundingInstrumentResponse:
      allOf:
        - $ref: '#/components/schemas/base-entity'
        - type: object
          required:
            - name
            - type
            - status
            - bankAccount
            - documentIds
          properties:
            name:
              $ref: '#/components/schemas/name'
              description: Name of the funding instrument
            type:
              type: string
              enum:
                - BANK_ACCOUNT
              description: Type of funding instrument
              example: BANK_ACCOUNT
            status:
              $ref: '#/components/schemas/verificationStatus'
            bankAccount:
              $ref: '#/components/schemas/bankAccountDetails'
              description: |
                Bank account details

                **Required** if type is `BANK_ACCOUNT`
            documentIds:
              type: array
              items:
                $ref: '#/components/schemas/id'
              description: The ids of the documents to be associated with the funding instrument
    FundingInstrumentRequest:
      type: object
      required:
        - name
        - type
        - bankAccount
      properties:
        name:
          $ref: '#/components/schemas/name'
          description: Name of the funding instrument
        type:
          type: string
          enum:
            - BANK_ACCOUNT
          description: Type of funding instrument
          example: BANK_ACCOUNT
        bankAccount:
          $ref: '#/components/schemas/bankAccountDetails'
          description: Details specific to the funding instrument type
          required:
            - accountNumber
            - accountHolderName
        documentIds:
          type: array
          items:
            $ref: '#/components/schemas/id'
          description: The ids of the documents to be associated with the funding instrument
    notFoundError:
      allOf:
        - $ref: '#/components/schemas/errorBase'
        - type: object
          properties:
            message:
              enum:
                - The requested resource cannot be found, please see details for more information
            statusCode:
              enum:
                - 404
            code:
              enum:
                - NOT_FOUND
            details:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
              example:
                transactionError:
                  - Transaction tree not found
    payoutConfigIncludeOptions:
      type: array
      items:
        type: string
        enum:
          - FUNDING_INSTRUMENT
        x-enum-descriptions:
          FUNDING_INSTRUMENT: Funding instrument to payout to
      example:
        - FUNDING_INSTRUMENT
    schedule:
      type: object
      description: Schedule configuration for payouts
      required:
        - unit
      properties:
        unit:
          type: string
          enum:
            - DAY
            - WEEK
            - MONTH
          x-enum-descriptions:
            DAY: Daily payout
            WEEK: Weekly payout
            MONTH: Monthly payout
          description: Unit of the interval
          example: DAY
    bankTransferStatementDescriptor:
      type: string
      description: |
        Description included on the  bank transfer to help identify the transaction on the recipient's bank statement.

        **Disclaimer**: The full value might be truncated or have special characters removed, subject to the payment scheme and recipient's bank handling.

        Payouts to UK bank accounts are limited to 18 characters in length, with the following characters allowed: A-Z, 0-9, space, /, -, .
      maxLength: 140
      pattern: ^[a-zA-Z0-9/\-?:().,'+ ]*$
      example: INVOICE-41252
    simpleStatus:
      type: string
      enum:
        - ACTIVE
        - SUSPENDED
      x-enum-descriptions:
        ACTIVE: The resource is active and can be used
        SUSPENDED: The resource is suspended and cannot be used
      example: ACTIVE
    PayoutConfigResponse:
      type: object
      required:
        - id
        - name
        - balanceAccountId
        - schedule
        - fundingInstrumentId
        - status
        - createdAt
        - updatedAt
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: ID of the payout configuration
        name:
          $ref: '#/components/schemas/name'
          description: Name of the payout configuration
        balanceAccountId:
          $ref: '#/components/schemas/id'
          description: ID of the balance account to payout from
        schedule:
          $ref: '#/components/schemas/schedule'
        statementDescriptor:
          $ref: '#/components/schemas/bankTransferStatementDescriptor'
        fundingInstrumentId:
          $ref: '#/components/schemas/id'
          description: ID of existing funding instrument to payout to
        fundingInstrument:
          $ref: '#/components/schemas/FundingInstrumentResponse'
          description: |
            Funding instrument to payout to.
            **Only** present if `include` query parameter contains `FUNDING_INSTRUMENT`.
        status:
          $ref: '#/components/schemas/simpleStatus'
          description: Status of the payout configuration
        createdAt:
          $ref: '#/components/schemas/createdAt'
          description: Date and time the payout configuration was created
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
          description: Date and time the payout configuration was last updated
    PayoutConfigRequest:
      description: |
        Payout configuration specifying how to payout funds from the balance account.
      oneOf:
        - type: object
          title: Existing Funding Instrument
          required:
            - name
            - schedule
            - fundingInstrumentId
          properties:
            name:
              $ref: '#/components/schemas/name'
              description: Name of the payout configuration
            schedule:
              $ref: '#/components/schemas/schedule'
            statementDescriptor:
              $ref: '#/components/schemas/bankTransferStatementDescriptor'
            fundingInstrumentId:
              $ref: '#/components/schemas/id'
              description: ID of existing funding instrument to payout to
        - type: object
          title: New Funding Instrument
          required:
            - name
            - schedule
            - fundingInstrument
          properties:
            name:
              $ref: '#/components/schemas/name'
              description: Name of the payout configuration
            schedule:
              $ref: '#/components/schemas/schedule'
            statementDescriptor:
              $ref: '#/components/schemas/bankTransferStatementDescriptor'
            fundingInstrument:
              $ref: '#/components/schemas/FundingInstrumentRequest'
              description: New funding instrument to create and payout to
      example:
        name: Payout config
        schedule:
          unit: DAY
        statementDescriptor: PAYOUTXX
        fundingInstrument:
          type: BANK_ACCOUNT
          bankAccount:
            accountNumber: NL91ABNA0417164300
            accountHolderName: John Doe
            bankName: ABNA
    PayoutConfigStandaloneRequest:
      allOf:
        - $ref: '#/components/schemas/PayoutConfigRequest'
        - type: object
          required:
            - balanceAccountId
          properties:
            balanceAccountId:
              $ref: '#/components/schemas/id'
              description: ID of the balance account to payout from
      example:
        name: Payout config
        balanceAccountId: 21210021c2855007efa2d657018
        schedule:
          unit: DAY
        statementDescriptor: PAYOUTXX
        fundingInstrument:
          type: BANK_ACCOUNT
          bankAccount:
            accountNumber: NL91ABNA0417164300
            accountHolderName: John Doe
            bankName: ABNA
    paymentCurrencyCode:
      type: string
      enum:
        - AUD
        - BGN
        - BRL
        - CAD
        - CHF
        - CNY
        - CZK
        - DKK
        - EUR
        - GBP
        - HUF
        - INR
        - ISK
        - JPY
        - MXN
        - NOK
        - PLN
        - RON
        - SEK
        - USD
        - ZAR
      description: ISO 4217 currency codes (alpha3) supported for payments
      example: EUR
    balanceCurrencyCode:
      type: string
      format: currency
      enum:
        - BGN
        - CHF
        - CZK
        - DKK
        - EUR
        - GBP
        - HUF
        - NOK
        - PLN
        - RON
        - SEK
        - USD
      description: Currency codes supported for balance accounts. ISO 4217 currency codes (alpha3)
      example: EUR
    ClearingConfigResponse:
      allOf:
        - $ref: '#/components/schemas/base-entity'
        - type: object
          required:
            - sourceCurrencyCodes
            - clearingCurrencyCode
            - balanceAccountId
          properties:
            sourceCurrencyCodes:
              type: array
              description: List of source currencies which will be cleared to the balance account.
              items:
                $ref: '#/components/schemas/paymentCurrencyCode'
                description: Supported currencies
            clearingCurrencyCode:
              $ref: '#/components/schemas/balanceCurrencyCode'
              description: Currency the funds will be converted to
            balanceAccountId:
              $ref: '#/components/schemas/id'
              description: ID of the balance account to be used for clearing
    ClearingConfigCreateRequest:
      type: object
      required:
        - accountId
        - clearingCurrencyCode
        - sourceCurrencyCodes
        - balanceAccountId
      properties:
        accountId:
          $ref: '#/components/schemas/accountId'
        clearingCurrencyCode:
          $ref: '#/components/schemas/balanceCurrencyCode'
          description: Currency the funds will be converted to
        sourceCurrencyCodes:
          type: array
          description: List of source currencies which will be cleared to the balance account.
          items:
            $ref: '#/components/schemas/paymentCurrencyCode'
            description: Supported currencies
        balanceAccountId:
          $ref: '#/components/schemas/id'
          description: ID of the balance account the funds will be cleared to
    ClearingConfigUpdateRequest:
      type: object
      properties:
        sourceCurrencyCodes:
          type: array
          description: List of source currencies which will be cleared to the balance account.
          items:
            $ref: '#/components/schemas/paymentCurrencyCode'
            description: Supported currencies
        clearingCurrencyCode:
          $ref: '#/components/schemas/balanceCurrencyCode'
          description: Currency the funds will be converted to
    amountWithCurrencyPrecision:
      type: integer
      description: |
        Integer amount in minor units (e.g. cents) specific to the currency.
        Example: 100 for €1.00
      example: 100
    BalanceAccountTransferRequest:
      type: object
      required:
        - amount
        - currencyCode
        - sourceBalanceAccountId
        - destinationBalanceAccountId
        - description
      properties:
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Integer amount of the transfer in minor units (e.g. cents) specific to the currency.
        currencyCode:
          $ref: '#/components/schemas/balanceCurrencyCode'
          description: Currency code for the transfer
        sourceBalanceAccountId:
          $ref: '#/components/schemas/accountId'
          description: ID of the source balance account which will be debited
        destinationBalanceAccountId:
          $ref: '#/components/schemas/accountId'
          description: ID of the destination balance account which will be credited
        description:
          type: string
          description: Description of the transfer
          example: Transfer to bank account
        merchantReference:
          type: string
          description: Reference provided by the client to identify the transfer
          example: client-ref-12345
    BalanceAccountTransferResponse:
      type: object
      required:
        - id
        - status
      properties:
        id:
          $ref: '#/components/schemas/id'
        status:
          type: string
          enum:
            - ACCEPTED
            - ERROR
          x-enum-descriptions:
            ACCEPTED: The transfer has been accepted and is pending processing
            ERROR: The transfer has encountered an error
          example: ACCEPTED
        responseMessage:
          type: string
          description: Response message from the payment processor
          example: Transfer request accepted
    LineItem:
      type: object
      properties:
        name:
          type: string
          description: Name of the line item
          example: Product A
        description:
          type: string
          description: Description of the line item
          example: High-quality product
        quantity:
          type: integer
          minimum: 1
          description: Quantity of the item
          example: 2
        unitPrice:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Unit price of the item
        imageUrl:
          type: string
          format: uri
          description: URL to the image of the item
          example: https://example.com/image.jpg
      required:
        - name
    Metadata:
      type: object
      description: |
        Free-form key-value pairs that can be supplied to tag and correlate resources.
        Constraints:
        - Maximum 20 key-value pairs per request
        - Maximum 20 characters per key
        - Maximum 80 characters per value
      properties:
        invoiceId:
          type: string
          description: Example metadata value identifying the invoice in your system
          example: INV-12345
        customerRef:
          type: string
          description: Example metadata value identifying the customer in your system
          example: CUST-98765
    CommonPaymentRequest:
      type: object
      required:
        - amount
        - currencyCode
        - accountId
      properties:
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Integer amount of the payment in minor units (e.g. cents) specific to the currency.
        currencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for the payment
        accountId:
          $ref: '#/components/schemas/accountId'
          description: ID of the operating account against which the payment will be processed
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/LineItem'
          description: Line items for the payment
        merchantReference:
          type: string
          description: Reference provided by the client to identify the payment
          example: client-ref-12345
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Free-form key-value pairs to tag and correlate this payment
    BalanceAccountPaymentRequestDetails:
      type: object
      required:
        - balanceAccountId
      properties:
        balanceAccountId:
          type: string
          description: ID of the balance account to use for payment
          example: 21210021c2855007efa2d657018
        description:
          type: string
          description: Description of the payment
          example: Payment for services
        pendingDays:
          type: integer
          minimum: 0
          default: 0
          description: Number of days to wait for balance account topup before declining. Set to 0 for instant decline on insufficient funds.
          example: 0
    InitiateBalanceAccountPaymentRequest:
      allOf:
        - $ref: '#/components/schemas/CommonPaymentRequest'
        - type: object
          properties:
            paymentMethodDetails:
              $ref: '#/components/schemas/BalanceAccountPaymentRequestDetails'
              description: Balance account payment method details
      example:
        amount: 1000
        currencyCode: EUR
        accountId: 21210021c2855007efa2d657018
        paymentMethodDetails:
          balanceAccountId: 21210021c2855007efa2d657018
          description: Payment for services
          pendingDays: 5
    CommonBalanceAccountResponseDetails:
      type: object
      required:
        - balanceAccountId
        - transactionVariant
      properties:
        balanceAccountId:
          $ref: '#/components/schemas/accountId'
          description: ID of the balance account used for payment
        transactionVariant:
          type: string
          enum:
            - balanceaccount
          description: Transaction variant for balance account payments
          example: balanceaccount
    topupDetails:
      type: object
      description: Details necessary to topup the balance account
      properties:
        bankTransfer:
          allOf:
            - $ref: '#/components/schemas/bankAccountDetails'
            - type: object
              required:
                - accountNumber
                - accountHolderName
                - bankName
                - bankCode
                - accountNumberType
                - bankCodeType
              description: Details of the bank transfer necessary to topup the balance account
              example:
                accountNumber: GB29NWBK60161331926819
                accountHolderName: John Doe
                bankName: Barclays Bank
                bankCode: NWBKGB2L
                accountNumberType: IBAN
                bankCodeType: BIC
              properties:
                paymentReference:
                  $ref: '#/components/schemas/bankTransferStatementDescriptor'
    TopupBalanceAccountResponseDetails:
      type: object
      required:
        - balanceAccountId
        - transactionVariant
      allOf:
        - $ref: '#/components/schemas/CommonBalanceAccountResponseDetails'
        - type: object
          properties:
            amount:
              $ref: '#/components/schemas/amountWithCurrencyPrecision'
              description: How much funds the customer must still topup to complete the payment
              example: 1000
            currencyCode:
              $ref: '#/components/schemas/paymentCurrencyCode'
              description: Currency code for the payment
            paymentReference:
              type: string
              description: Payment reference which must be provided by the customer for reconciliation. Only provided if explicit matching is required
              example: payment-ref-12345
        - $ref: '#/components/schemas/topupDetails'
    BalanceAccountResponseDetails:
      type: object
      required:
        - balanceAccountId
        - transactionVariant
      anyOf:
        - $ref: '#/components/schemas/TopupBalanceAccountResponseDetails'
          title: Awaiting topup
        - $ref: '#/components/schemas/CommonBalanceAccountResponseDetails'
          title: Payment processed
    InitiateBalanceAccountPaymentResponse:
      type: object
      required:
        - id
        - status
        - details
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Transaction ID
        status:
          type: string
          enum:
            - INITIATED
            - DECLINED
            - AUTHORIZED
            - ERROR
          x-enum-descriptions:
            INITIATED: The payment has been initiated and is pending a topup
            DECLINED: The payment has been declined due to insufficient funds
            AUTHORIZED: The payment has been authorized and processed
            ERROR: The payment has encountered a technical failure
          description: Status of the payment
          example: INITIATED
        action:
          type: string
          enum:
            - PRESENT_DETAILS
          x-enum-descriptions:
            PRESENT_DETAILS: Present topup details for a pending payment
          description: Action required for the payment
          example: PRESENT_DETAILS
        reason:
          type: string
          enum:
            - NOT_ENOUGH_BALANCE
          x-enum-descriptions:
            NOT_ENOUGH_BALANCE: Insufficient funds in the balance account
          description: Reason for the payment status
          example: NOT_ENOUGH_BALANCE
        responseMessage:
          type: string
          description: Response message from the payment processor
          example: Payment initiated successfully
        details:
          $ref: '#/components/schemas/BalanceAccountResponseDetails'
          description: Payment response details
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Metadata associated with this payment
    countryCode:
      type: string
      maxLength: 2
      minLength: 2
      format: country-code
      description: The two-letter ISO 3166-1 alpha-2 country code
      example: NL
    address:
      type: object
      properties:
        countryCode:
          $ref: '#/components/schemas/countryCode'
        city:
          type: string
          description: |
            The name of the city. Required if stateOrProvince is provided. If you specify the city, you must also send postalCode and street.
        postalCode:
          type: string
          description: |
            The postal code. Required if stateOrProvince and/or city is provided. When using alphanumeric postal codes, all letters must be uppercase. For example, 1234 AB or SW1A 1AA.
        stateOrProvince:
          type: string
          description: |
            The two-letter ISO 3166-2 state or province code. For example, CA in the US. If you specify the state or province, you must also send city, postalCode, and street.
        street:
          type: string
          description: |
            The name of the street, and the house or building number. Required if stateOrProvince and/or city is provided.
    MerchantAccountLegalEntityRequest:
      type: object
      title: Organization
      description: Organization legal entity (merchant accounts only support organization type)
      required:
        - type
        - organization
      properties:
        type:
          type: string
          enum:
            - ORGANIZATION
          description: Legal entity type
          example: ORGANIZATION
        organization:
          type: object
          required:
            - legalName
            - registrationNumber
            - type
            - registeredAddress
          properties:
            legalName:
              type: string
              description: Legal name of the organization
              example: Acme Corporation AS
            doingBusinessAs:
              type: string
              description: Trading name if different from legal name
              example: Acme
            registrationNumber:
              type: string
              description: Official registration number
              example: '123456789'
            vatNumber:
              type: string
              description: VAT number
              example: NO123456789MVA
            taxIdNumber:
              type: string
              description: Tax identification number
              example: '123456789'
            type:
              type: string
              enum:
                - PUBLIC_LISTED_COMPANY
                - PRIVATE_LIMITED
                - SOLE_TRADER
                - NON_PROFIT
                - GENERAL_PARTNERSHIP
                - LIMITED_PARTNERSHIP
              description: Type of organization
              example: PRIVATE_LIMITED
            registeredAddress:
              $ref: '#/components/schemas/address'
            principalPlaceOfBusiness:
              $ref: '#/components/schemas/address'
    email:
      type: string
      format: email
      maxLength: 255
      description: Email address
      example: john.doe@example.com
    credentialRoleMerchant:
      type: string
      enum:
        - ADMIN
        - MEMBER
        - DEVELOPER
      x-enum-descriptions:
        ADMIN: Full administrative access to all resources
        MEMBER: Read-only access to all resources
        DEVELOPER: Access to payment operations, typically assigned to API keys used for payment integrations
      example: DEVELOPER
    CreateMerchantUserRequest:
      type: object
      required:
        - account
      properties:
        firstName:
          type: string
          description: The first name of the user
          example: John
        lastName:
          type: string
          description: The last name of the user
          example: Doe
        email:
          $ref: '#/components/schemas/email'
        role:
          $ref: '#/components/schemas/credentialRoleMerchant'
    CreateMerchantAccountRequest:
      type: object
      required:
        - name
        - legalEntity
      properties:
        name:
          type: string
          description: The display name of the merchant account
          example: Acme Corp
        description:
          type: string
          description: The description of the merchant account
          example: Acme Corp is a company that sells products to the public
        legalEntity:
          $ref: '#/components/schemas/MerchantAccountLegalEntityRequest'
          description: Legal entity details for the merchant account (organization only)
        users:
          type: array
          items:
            $ref: '#/components/schemas/CreateMerchantUserRequest'
    MerchantAccountLegalEntityResponse:
      type: object
      title: Organization
      description: Organization legal entity response
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Unique identifier of the legal entity
        type:
          type: string
          enum:
            - ORGANIZATION
          example: ORGANIZATION
        organization:
          type: object
          properties:
            legalName:
              type: string
              description: Legal name of the organization
              example: Acme Corporation AS
            doingBusinessAs:
              type: string
              description: Trading name if different from legal name
              example: Acme
            registrationNumber:
              type: string
              description: Official registration number
              example: '123456789'
            vatNumber:
              type: string
              description: VAT number
              example: NO123456789MVA
            taxIdNumber:
              type: string
              description: Tax identification number
              example: '123456789'
            type:
              type: string
              enum:
                - PUBLIC_LISTED_COMPANY
                - PRIVATE_LIMITED
                - SOLE_TRADER
                - NON_PROFIT
                - GENERAL_PARTNERSHIP
                - LIMITED_PARTNERSHIP
              example: PRIVATE_LIMITED
            registeredAddress:
              $ref: '#/components/schemas/address'
            principalPlaceOfBusiness:
              $ref: '#/components/schemas/address'
    User:
      type: object
      description: A user of the merchant account
      required:
        - email
        - role
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: The ID of the user
        email:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        role:
          $ref: '#/components/schemas/credentialRoleMerchant'
    capabilityType:
      type: string
      enum:
        - PAYMENTS
        - PAYOUTS
      x-enum-descriptions:
        PAYMENTS: Payments capability
        PAYOUTS: Payouts capability
      example: PAYMENTS
    capabilityStatus:
      type: string
      enum:
        - INACTIVE
        - ACTIVE
      x-enum-descriptions:
        INACTIVE: |
          The capability is inactive and cannot be used. Review the plans requirements to activate the capability.
        ACTIVE: The capability is active and can be used, within possible `activeConstraints` if defined.
      example: ACTIVE
    capabilityPlanName:
      type: string
      enum:
        - PAYMENTS_LIMITED
        - PAYMENTS_STANDARD
        - PAYOUTS_STANDARD
        - PAYOUTS_EXTERNAL
      x-enum-descriptions:
        PAYMENTS_LIMITED: Limited payments plan for up to €10k volume / 30 days processing
        PAYMENTS_STANDARD: Fully enabled payments plan without constraints
        PAYOUTS_STANDARD: Fully enabled payouts plan for merchant accounts (automatically granted when PAYMENTS_STANDARD is approved)
        PAYOUTS_EXTERNAL: Fully enabled payouts plan for external balance accounts
      example: PAYMENTS_LIMITED
    CapabilityPlanStatus:
      type: string
      enum:
        - UNREQUESTED
        - REQUESTED
        - CHANGES_REQUIRED
        - APPROVED
        - REJECTED
      x-enum-descriptions:
        UNREQUESTED: The plan is not requested
        REQUESTED: The plan is requested and is being reviewed by Embed
        CHANGES_REQUIRED: |
          The plan is requested with changes required. After the changes are made it needs to be re-requested to be reviewed again.
        APPROVED: The plan is approved
        REJECTED: The plan is rejected without an ability to re-request it.
      example: REQUESTED
    portalUrl:
      type: string
      description: The URL of the portal to collect data or documents.
      example: https://portal.embed.com/onboarding
    portalType:
      type: string
      description: The type of the portal to collect data
      enum:
        - DETAILS
        - DOCUMENTS
        - IDENTITY_VERIFICATION
      x-enum-descriptions:
        DETAILS: The portal for providing business details
        DOCUMENTS: The portal for providing business documents
        IDENTITY_VERIFICATION: The portal for providing a identity verification for the business representative
      example: DETAILS
    redirectUrl:
      type: string
      description: The URL to redirect to after a capability plan portal is submitted
      example: https://my.business.com/capability-plan-portal-submitted
    CapabilityPlanPortal:
      type: object
      required:
        - url
        - type
      properties:
        url:
          $ref: '#/components/schemas/portalUrl'
        type:
          $ref: '#/components/schemas/portalType'
        redirectUrl:
          $ref: '#/components/schemas/redirectUrl'
    reviewComment:
      type: string
      description: A comment from a reviewer of the capability plan request
      example: |
        The legal entity details are not complete.
        Please provide the following information:
        - Legal entity name
        - Legal entity address
    PaymentsLimitedPlanConstraints:
      title: Payments limited plan
      type: object
      properties:
        maxProcessingVolume:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: |
            The maximum processing volume in EUR allowed for the account in which the `PAYMENTS` capability is active.
          example: 10000
        endDate:
          type: string
          format: date-time
          description: The last date until which `PAYMENTS` capability is active.
          example: '2025-12-31T23:59:59Z'
    PaymentsStandardPlanConstraints:
      title: Payments standard plan
      type: object
      properties: {}
      maxProperties: 0
    PayoutsStandardPlanConstraints:
      title: Payouts standard plan
      type: object
      properties: {}
      maxProperties: 0
    PayoutsExternalPlanConstraints:
      title: Payouts external plan
      type: object
      properties: {}
      maxProperties: 0
    CapabilityPlanConstraints:
      oneOf:
        - $ref: '#/components/schemas/PaymentsLimitedPlanConstraints'
        - $ref: '#/components/schemas/PaymentsStandardPlanConstraints'
        - $ref: '#/components/schemas/PayoutsStandardPlanConstraints'
        - $ref: '#/components/schemas/PayoutsExternalPlanConstraints'
    RequirementCommon:
      type: object
      description: Shared attributes for a capability request document requirement
      required:
        - type
        - path
      properties:
        type:
          type: string
        path:
          type: string
          description: Full path to the field within the resource in JSONPath query language.
        message:
          type: string
          description: Description of the requirement
    CapabilityRequirementField:
      title: Field requirement
      allOf:
        - $ref: '#/components/schemas/RequirementCommon'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              const: FIELD
    CapabilityRequirementDocumentIndividual:
      title: Individual document requirement
      allOf:
        - $ref: '#/components/schemas/RequirementCommon'
        - type: object
          required:
            - type
            - documentCategory
            - documentType
          properties:
            type:
              type: string
              const: DOCUMENT
            documentCategory:
              type: string
              const: INDIVIDUAL
              description: The category of the document
            documentType:
              type: string
              description: The type of the document
              enum:
                - IDENTITY_DOCUMENT
              x-enum-descriptions:
                IDENTITY_DOCUMENT: Government-issued identity document
    CapabilityRequirementDocumentOrganization:
      title: Organization document requirement
      allOf:
        - $ref: '#/components/schemas/RequirementCommon'
        - type: object
          required:
            - type
            - documentCategory
            - documentType
          properties:
            type:
              type: string
              const: DOCUMENT
            documentCategory:
              type: string
              const: COMPANY
              description: The category of the document
            documentType:
              type: string
              enum:
                - PROOF_OF_ADDRESS
                - REGISTRATION_DOCUMENT
                - VAT_DOCUMENT
                - PROOF_OF_ORGANIZATION_TAX_INFO
                - PROOF_OF_OWNERSHIP
                - PROOF_OF_INDUSTRY
                - PROOF_OF_SIGNATORY
                - PROOF_OF_FUNDING_OR_WEALTH_SOURCE
                - CONSTITUTIONAL_DOCUMENT
              x-enum-descriptions:
                PROOF_OF_ADDRESS: Document proving the organization's registered address
                REGISTRATION_DOCUMENT: Official registration document for the organization
                VAT_DOCUMENT: Value Added Tax registration or compliance document
                PROOF_OF_ORGANIZATION_TAX_INFO: Document proving the organization's tax information
                PROOF_OF_OWNERSHIP: Document proving ownership structure of the organization
                PROOF_OF_INDUSTRY: Document proving the industry or business sector
                PROOF_OF_SIGNATORY: Document proving signatory authority for an organization
                PROOF_OF_FUNDING_OR_WEALTH_SOURCE: Document proving the legitimate source of funds or wealth
                CONSTITUTIONAL_DOCUMENT: Foundational document for sole proprietorships, trusts, or partnerships
              description: The type of the document
    CapabilityRequirementAssociationIndividual:
      title: Individual association requirement
      allOf:
        - $ref: '#/components/schemas/RequirementCommon'
        - type: object
          required:
            - type
            - associationCategory
            - associationType
          properties:
            type:
              type: string
              const: ASSOCIATION
            associationCategory:
              type: string
              const: IndividualAssociation
              description: An association with an individual
            associationType:
              type: string
              enum:
                - DIRECTOR
                - SIGNATORY
                - UBO_THROUGH_OWNERSHIP
                - UBO_THROUGH_CONTROL
                - SOLE_PROPRIETORSHIP
                - ACCOUNT_OWNER
              x-enum-descriptions:
                DIRECTOR: Business director
                SIGNATORY: A person with signing authority
                UBO_THROUGH_OWNERSHIP: Ultimate Beneficial Owner through ownership
                UBO_THROUGH_CONTROL: Ultimate Beneficial Owner through control
                SOLE_PROPRIETORSHIP: Sole proprietorship
                ACCOUNT_OWNER: Business representative
    CapabilityRequirementAssociationOrganization:
      title: Organization association requirement
      allOf:
        - $ref: '#/components/schemas/RequirementCommon'
        - type: object
          required:
            - type
            - associationCategory
            - associationType
          properties:
            type:
              type: string
              const: ASSOCIATION
            associationCategory:
              type: string
              const: OrganizationAssociation
              description: An association with an organization
            associationType:
              type: string
              enum:
                - ULTIMATE_PARENT_ORGANIZATION
              x-enum-descriptions:
                ULTIMATE_PARENT_ORGANIZATION: An ultimate parent organization of the legal entity
    CapabilityRequirementAgreementSignature:
      title: Agreement signature requirement
      allOf:
        - $ref: '#/components/schemas/RequirementCommon'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              const: AGREEMENT_SIGNATURE
            documentCategory:
              type: string
              enum:
                - INTERNAL
            documentType:
              type: string
              enum:
                - TERMS_AND_CONDITIONS
                - OTHER_SIGN_OFF_REQUIRED
              x-enum-descriptions:
                TERMS_AND_CONDITIONS: Terms and conditions
                OTHER_SIGN_OFF_REQUIRED: Other documents required to be signed
              description: The type of the document
            isDisqualifierPath:
              type: boolean
              description: If true, no results should be returned when querying the resource by the path.
              example: true
    CapabilityRequirementCapabilityPlan:
      title: Capability plan requirement
      allOf:
        - $ref: '#/components/schemas/RequirementCommon'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              const: CAPABILITY_PLAN
            capabilityType:
              type: string
              enum:
                - PAYMENTS
                - PAYOUTS
              x-enum-descriptions:
                PAYMENTS: Payments capability
                PAYOUTS: Payouts capability
              description: The type of the capability
            planType:
              type: string
              enum:
                - PAYMENTS_LIMITED
                - PAYMENTS_STANDARD
                - PAYOUTS_STANDARD
                - PAYOUTS_EXTERNAL
              x-enum-descriptions:
                PAYMENTS_LIMITED: Limited payments plan for up to €10k volume / 30 days processing
                PAYMENTS_STANDARD: Fully enabled payments plan without constraints
                PAYOUTS_STANDARD: Fully enabled payouts plan for merchant accounts (automatically granted when PAYMENTS_STANDARD is approved)
                PAYOUTS_EXTERNAL: Fully enabled payouts plan for external balance accounts
              description: The type of the plan
            planStatus:
              type: string
              enum:
                - REQUESTED
                - APPROVED
                - REJECTED
              x-enum-descriptions:
                REQUESTED: The plan has been requested
                APPROVED: The plan has been approved
                REJECTED: The plan has been rejected
              description: The status of the plan
    CapabilityRequirementDescription:
      oneOf:
        - $ref: '#/components/schemas/CapabilityRequirementField'
        - $ref: '#/components/schemas/CapabilityRequirementDocumentIndividual'
        - $ref: '#/components/schemas/CapabilityRequirementDocumentOrganization'
        - $ref: '#/components/schemas/CapabilityRequirementAssociationIndividual'
        - $ref: '#/components/schemas/CapabilityRequirementAssociationOrganization'
        - $ref: '#/components/schemas/CapabilityRequirementAgreementSignature'
        - $ref: '#/components/schemas/CapabilityRequirementCapabilityPlan'
    CapabilityRequirements:
      title: Capability Requirements
      type: object
      required:
        - resourceType
      properties:
        resourceType:
          type: string
          enum:
            - LEGAL_ENTITY
            - ACCOUNT
          description: The type of the resource for which there are missing requirements
          x-enum-descriptions:
            LEGAL_ENTITY: Legal entity
            ACCOUNT: Account
          example: LEGAL_ENTITY
        resourceId:
          type: string
          description: The ID of the resource for which there are missing requirements
          example: 21210021c2855007efa2d657018
        missing:
          type: array
          items:
            $ref: '#/components/schemas/CapabilityRequirementDescription'
          example:
            - type: FIELD
              path: $.organization.legalName
              message: The organization legal name is required
            - type: DOCUMENT
              documentCategory: INDIVIDUAL
              documentType: PROOF_OF_ADDRESS
              path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])].documents[?(@.category == 'INDIVIDUAL' && @.type == 'PROOF_OF_ADDRESS')]
              message: Proof of residency for a business representative is required
            - type: ASSOCIATION
              associationCategory: IndividualAssociation
              associationType: ACCOUNT_OWNER
              path: $.associatedLegalEntities[?(@.associations[?(@.category == 'IndividualAssociation' && @.type == 'ACCOUNT_OWNER')])]
              message: The legal entity is missing an association for an authorized representative
    CapabilityPlan:
      type: object
      required:
        - planType
        - status
        - createdAt
        - updatedAt
      properties:
        planType:
          $ref: '#/components/schemas/capabilityPlanName'
          description: Identifier of the plan
          example: PAYMENTS_LIMITED
        status:
          $ref: '#/components/schemas/CapabilityPlanStatus'
        portal:
          $ref: '#/components/schemas/CapabilityPlanPortal'
        reviewComment:
          $ref: '#/components/schemas/reviewComment'
        constraints:
          $ref: '#/components/schemas/CapabilityPlanConstraints'
        requirements:
          type: array
          items:
            $ref: '#/components/schemas/CapabilityRequirements'
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
    Capability:
      type: object
      required:
        - accountId
        - status
        - type
        - activePlans
        - createdAt
        - updatedAt
      properties:
        type:
          $ref: '#/components/schemas/capabilityType'
        accountId:
          $ref: '#/components/schemas/accountId'
        status:
          $ref: '#/components/schemas/capabilityStatus'
        activePlans:
          type: array
          description: The active plans for the capability
          items:
            $ref: '#/components/schemas/capabilityPlanName'
        plans:
          type: array
          description: Plans describing the status, constraints and requirements of each capability configuration
          items:
            $ref: '#/components/schemas/CapabilityPlan'
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
    CreateMerchantAccountResponse:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/id'
        name:
          type: string
          description: The name of the merchant account
        legalEntity:
          $ref: '#/components/schemas/MerchantAccountLegalEntityResponse'
          description: The legal entity of the merchant account
        operatingAccountId:
          $ref: '#/components/schemas/id'
          description: The ID of the default operating account
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
          description: The users of the merchant account
        capabilities:
          type: array
          items:
            $ref: '#/components/schemas/Capability'
          description: The capabilities of the merchant account
    balanceAccountType:
      type: string
      enum:
        - STANDARD
        - EXTERNAL
      x-enum-descriptions:
        STANDARD: Balance account which holds funds for the merchant or platform
        EXTERNAL: Balance account which holds funds for an external party of the merchant or platform. E.g. a customer or a supplier.
      example: STANDARD
    externalReference:
      type: string
      description: Reference provided by the client to identify the resource
      example: client-ref-12345
    balanceAccountListIncludeOptions:
      type: array
      items:
        type: string
        enum:
          - BALANCE
          - TOPUP_DETAILS
          - CHILDREN
          - CLEARING_CONFIGS
          - LEGAL_ENTITY
          - FUNDING_INSTRUMENT
          - CAPABILITIES
        x-enum-descriptions:
          BALANCE: Balance of the balance account
          TOPUP_DETAILS: Details necessary to topup the balance account
          CHILDREN: Include balance accounts that belong to one of the children of the account id provided
          CLEARING_CONFIGS: Clearing configs associated with the balance account
          LEGAL_ENTITY: Legal entity associated with the balance account
          FUNDING_INSTRUMENT: Funding instrument associated with the balance account
          CAPABILITIES: Capabilities of the balance account
      example:
        - BALANCE
        - TOPUP_DETAILS
        - CHILDREN
        - FUNDING_INSTRUMENT
    region:
      enum:
        - EEA
        - UK
      description: Region of the resource
      example: EEA
    balance:
      type: object
      description: Balance of the balance account
      properties:
        availableBalance:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
        currencyCode:
          $ref: '#/components/schemas/balanceCurrencyCode'
    StandardBalanceAccountResponse:
      type: object
      title: Standard balance account
      description: A standard balance account for receiving merchant funds
      properties:
        id:
          $ref: '#/components/schemas/id'
        accountId:
          $ref: '#/components/schemas/accountId'
        type:
          type: string
          enum:
            - STANDARD
          example: STANDARD
        status:
          $ref: '#/components/schemas/simpleStatus'
        name:
          $ref: '#/components/schemas/name'
        region:
          $ref: '#/components/schemas/region'
        currencyCode:
          $ref: '#/components/schemas/balanceCurrencyCode'
        externalReference:
          $ref: '#/components/schemas/externalReference'
        payoutConfig:
          $ref: '#/components/schemas/PayoutConfigResponse'
        clearingConfigIds:
          type: array
          description: IDs of clearing configs associated with this balance account
          items:
            $ref: '#/components/schemas/id'
        topupDetails:
          $ref: '#/components/schemas/topupDetails'
        balance:
          $ref: '#/components/schemas/balance'
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
    phoneNumber:
      type: string
      description: A phone number, including the country code in international format (E.164).
      pattern: ^\\+[1-9][0-9]{1,14}$
      example: '+3112345678'
    ExternalBalanceAccountLegalEntityIndividual:
      type: object
      title: Individual
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Unique identifier of the legal entity
        type:
          type: string
          enum:
            - INDIVIDUAL
          example: INDIVIDUAL
        individual:
          type: object
          properties:
            firstName:
              type: string
              description: First name
              example: Lars
            lastName:
              type: string
              description: Last name
              example: Andersson
            email:
              $ref: '#/components/schemas/email'
            phoneNumber:
              $ref: '#/components/schemas/phoneNumber'
            dateOfBirth:
              type: string
              description: Date of birth in YYYY-MM-DD format
              example: '1985-03-15'
            residentialAddress:
              $ref: '#/components/schemas/address'
            nationality:
              $ref: '#/components/schemas/countryCode'
    ExternalBalanceAccountLegalEntityOrganization:
      type: object
      title: Organization
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Unique identifier of the legal entity
        type:
          type: string
          enum:
            - ORGANIZATION
          example: ORGANIZATION
        organization:
          type: object
          properties:
            legalName:
              type: string
              description: Legal name of the organization
              example: CPMS Green Energy Solutions ApS
            doingBusinessAs:
              type: string
              description: Trading name if different from legal name
            registrationNumber:
              type: string
              description: Official registration number
              example: DK12345678
            vatNumber:
              type: string
              description: VAT number
            taxIdNumber:
              type: string
              description: Tax identification number
            type:
              type: string
              enum:
                - PUBLIC_LISTED_COMPANY
                - PRIVATE_LIMITED
                - SOLE_TRADER
                - NON_PROFIT
                - GENERAL_PARTNERSHIP
                - LIMITED_PARTNERSHIP
              example: PRIVATE_LIMITED
            registeredAddress:
              $ref: '#/components/schemas/address'
            principalPlaceOfBusiness:
              $ref: '#/components/schemas/address'
    ExternalBalanceAccountLegalEntity:
      type: object
      title: Legal entity
      description: Legal entity details without associations
      discriminator:
        propertyName: type
        mapping:
          INDIVIDUAL: '#/components/schemas/ExternalBalanceAccountLegalEntityIndividual'
          ORGANIZATION: '#/components/schemas/ExternalBalanceAccountLegalEntityOrganization'
      oneOf:
        - $ref: '#/components/schemas/ExternalBalanceAccountLegalEntityIndividual'
          title: Individual
        - $ref: '#/components/schemas/ExternalBalanceAccountLegalEntityOrganization'
          title: Organization
    ExternalBalanceAccountCapabilityRequirementDescription:
      description: Requirement item types supported for external balance account capabilities
      oneOf:
        - $ref: '#/components/schemas/CapabilityRequirementField'
        - $ref: '#/components/schemas/CapabilityRequirementDocumentIndividual'
        - $ref: '#/components/schemas/CapabilityRequirementDocumentOrganization'
        - $ref: '#/components/schemas/CapabilityRequirementAssociationIndividual'
        - $ref: '#/components/schemas/CapabilityRequirementAssociationOrganization'
    ExternalBalanceAccountCapabilityRequirements:
      title: External balance account capability requirements
      type: object
      description: Requirements for external balance account capabilities
      required:
        - resourceType
      properties:
        resourceType:
          type: string
          enum:
            - LEGAL_ENTITY
          description: The resource type
          example: LEGAL_ENTITY
        resourceId:
          type: string
          description: The ID of the legal entity with missing requirements
          example: 212106610000100ff6a45dbb027
        missing:
          type: array
          items:
            $ref: '#/components/schemas/ExternalBalanceAccountCapabilityRequirementDescription'
          description: List of missing requirements
    ExternalBalanceAccountCapabilityPlan:
      type: object
      title: PAYOUTS_EXTERNAL plan
      description: The PAYOUTS_EXTERNAL plan for external balance accounts
      properties:
        planType:
          type: string
          enum:
            - PAYOUTS_EXTERNAL
          description: Plan type (always PAYOUTS_EXTERNAL)
          example: PAYOUTS_EXTERNAL
        status:
          type: string
          enum:
            - UNREQUESTED
            - REQUESTED
            - CHANGES_REQUIRED
            - APPROVED
            - REJECTED
          description: Current status of the plan
          example: UNREQUESTED
        requirements:
          type: array
          items:
            $ref: '#/components/schemas/ExternalBalanceAccountCapabilityRequirements'
          description: Onboarding requirements for this plan
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
    ExternalBalanceAccountCapability:
      type: object
      title: PAYOUTS capability
      description: PAYOUTS capability for external balance accounts
      properties:
        type:
          type: string
          enum:
            - PAYOUTS
          description: Capability type (always PAYOUTS for external balance accounts)
          example: PAYOUTS
        accountId:
          $ref: '#/components/schemas/accountId'
        status:
          type: string
          enum:
            - INACTIVE
            - ACTIVE
          description: Current status of the capability
          example: INACTIVE
        activePlans:
          type: array
          items:
            type: string
            enum:
              - PAYOUTS_EXTERNAL
          description: List of active plans
          example: []
        plans:
          type: array
          items:
            $ref: '#/components/schemas/ExternalBalanceAccountCapabilityPlan'
          description: Available capability plans
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
    ExternalBalanceAccountResponse:
      type: object
      title: External balance account
      description: An external balance account for third parties with onboarding capabilities
      properties:
        id:
          $ref: '#/components/schemas/id'
        accountId:
          $ref: '#/components/schemas/accountId'
        type:
          type: string
          enum:
            - EXTERNAL
          example: EXTERNAL
        status:
          $ref: '#/components/schemas/simpleStatus'
        name:
          $ref: '#/components/schemas/name'
        region:
          $ref: '#/components/schemas/region'
        currencyCode:
          $ref: '#/components/schemas/balanceCurrencyCode'
        externalReference:
          $ref: '#/components/schemas/externalReference'
        payoutConfig:
          $ref: '#/components/schemas/PayoutConfigResponse'
        legalEntity:
          $ref: '#/components/schemas/ExternalBalanceAccountLegalEntity'
          description: Legal entity details of the external balance account holder
        capabilities:
          type: array
          items:
            $ref: '#/components/schemas/ExternalBalanceAccountCapability'
        topupDetails:
          $ref: '#/components/schemas/topupDetails'
        balance:
          $ref: '#/components/schemas/balance'
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
    ClearingConfigRequest:
      type: object
      description: |
        Clearing configuration specifying which funds will be cleared to the balance account.
      properties:
        sourceCurrencyCodes:
          type: array
          description: List of source currencies which will be cleared to the balance account.
          items:
            $ref: '#/components/schemas/paymentCurrencyCode'
            description: Supported currencies
    CreateStandardBalanceAccountRequest:
      type: object
      title: Standard balance account
      description: Request to create a standard balance account for a merchant
      required:
        - type
        - accountId
        - currencyCode
        - name
        - region
      properties:
        type:
          type: string
          enum:
            - STANDARD
          description: Balance account type
          example: STANDARD
        name:
          $ref: '#/components/schemas/name'
        accountId:
          $ref: '#/components/schemas/accountId'
        region:
          $ref: '#/components/schemas/region'
        currencyCode:
          $ref: '#/components/schemas/balanceCurrencyCode'
        externalReference:
          $ref: '#/components/schemas/externalReference'
        payoutConfig:
          $ref: '#/components/schemas/PayoutConfigRequest'
        clearingConfig:
          $ref: '#/components/schemas/ClearingConfigRequest'
    ExternalBalanceAccountLegalEntityIndividualRequest:
      type: object
      title: Individual
      required:
        - type
        - individual
      properties:
        type:
          type: string
          enum:
            - INDIVIDUAL
          description: Legal entity type
          example: INDIVIDUAL
        individual:
          type: object
          required:
            - firstName
            - lastName
          properties:
            firstName:
              type: string
              description: First name
              example: Lars
            lastName:
              type: string
              description: Last name
              example: Andersson
            email:
              $ref: '#/components/schemas/email'
            phoneNumber:
              $ref: '#/components/schemas/phoneNumber'
            dateOfBirth:
              type: string
              description: Date of birth in YYYY-MM-DD format
              example: '1985-03-15'
            residentialAddress:
              $ref: '#/components/schemas/address'
            nationality:
              $ref: '#/components/schemas/countryCode'
    ExternalBalanceAccountLegalEntityOrganizationRequest:
      type: object
      title: Organization
      required:
        - type
        - organization
      properties:
        type:
          type: string
          enum:
            - ORGANIZATION
          description: Legal entity type
          example: ORGANIZATION
        organization:
          type: object
          required:
            - legalName
            - registrationNumber
            - type
            - registeredAddress
          properties:
            legalName:
              type: string
              description: Legal name of the organization
              example: CPMS Green Energy Solutions ApS
            doingBusinessAs:
              type: string
              description: Trading name if different from legal name
            registrationNumber:
              type: string
              description: Official registration number
              example: DK12345678
            vatNumber:
              type: string
              description: VAT number
            taxIdNumber:
              type: string
              description: Tax identification number
            type:
              type: string
              enum:
                - PUBLIC_LISTED_COMPANY
                - PRIVATE_LIMITED
                - SOLE_TRADER
                - NON_PROFIT
                - GENERAL_PARTNERSHIP
                - LIMITED_PARTNERSHIP
              description: Type of organization
              example: PRIVATE_LIMITED
            registeredAddress:
              $ref: '#/components/schemas/address'
            principalPlaceOfBusiness:
              $ref: '#/components/schemas/address'
    ExternalBalanceAccountLegalEntityRequest:
      type: object
      title: Legal entity
      description: Legal entity details without associations
      discriminator:
        propertyName: type
        mapping:
          INDIVIDUAL: '#/components/schemas/ExternalBalanceAccountLegalEntityIndividualRequest'
          ORGANIZATION: '#/components/schemas/ExternalBalanceAccountLegalEntityOrganizationRequest'
      oneOf:
        - $ref: '#/components/schemas/ExternalBalanceAccountLegalEntityIndividualRequest'
          title: Individual
        - $ref: '#/components/schemas/ExternalBalanceAccountLegalEntityOrganizationRequest'
          title: Organization
    CreateExternalBalanceAccountRequest:
      type: object
      title: External balance account
      description: Request to create an external balance account for a third party (CPO, site host, etc.)
      required:
        - type
        - accountId
        - currencyCode
        - name
        - region
        - legalEntity
      properties:
        type:
          type: string
          enum:
            - EXTERNAL
          description: Balance account type
          example: EXTERNAL
        name:
          $ref: '#/components/schemas/name'
        accountId:
          $ref: '#/components/schemas/accountId'
        region:
          $ref: '#/components/schemas/region'
        currencyCode:
          $ref: '#/components/schemas/balanceCurrencyCode'
        externalReference:
          $ref: '#/components/schemas/externalReference'
        payoutConfig:
          $ref: '#/components/schemas/PayoutConfigRequest'
        legalEntity:
          $ref: '#/components/schemas/ExternalBalanceAccountLegalEntityRequest'
          description: Legal entity details for the external balance account holder (no associations)
    CreateBalanceAccountRequest:
      title: Create balance account request
      description: Request to create either a standard or external balance account
      discriminator:
        propertyName: type
        mapping:
          STANDARD: '#/components/schemas/CreateStandardBalanceAccountRequest'
          EXTERNAL: '#/components/schemas/CreateExternalBalanceAccountRequest'
      oneOf:
        - $ref: '#/components/schemas/CreateStandardBalanceAccountRequest'
          title: Standard balance account
        - $ref: '#/components/schemas/CreateExternalBalanceAccountRequest'
          title: External balance account
    BalanceAccountResponse:
      title: Balance account
      description: Response containing either a standard or external balance account
      discriminator:
        propertyName: type
        mapping:
          STANDARD: '#/components/schemas/StandardBalanceAccountResponse'
          EXTERNAL: '#/components/schemas/ExternalBalanceAccountResponse'
      oneOf:
        - $ref: '#/components/schemas/StandardBalanceAccountResponse'
          title: Standard balance account
        - $ref: '#/components/schemas/ExternalBalanceAccountResponse'
          title: External balance account
    balanceAccountIncludeOptions:
      type: array
      items:
        type: string
        enum:
          - BALANCE
          - TOPUP_DETAILS
          - CLEARING_CONFIGS
          - LEGAL_ENTITY
          - FUNDING_INSTRUMENT
          - CAPABILITIES
        x-enum-descriptions:
          BALANCE: Balance of the balance account
          TOPUP_DETAILS: Details necessary to topup the balance account
          CLEARING_CONFIGS: Clearing configs associated with the balance account
          LEGAL_ENTITY: Legal entity associated with the balance account
          FUNDING_INSTRUMENT: Funding instrument associated with the balance account
          CAPABILITIES: Capabilities of the balance account
      example:
        - BALANCE
        - TOPUP_DETAILS
        - FUNDING_INSTRUMENT
    UpdateBalanceAccountRequest:
      type: object
      title: Update balance account
      description: Request to update a balance account (standard or external)
      properties:
        name:
          $ref: '#/components/schemas/name'
        externalReference:
          $ref: '#/components/schemas/externalReference'
        payoutConfig:
          $ref: '#/components/schemas/PayoutConfigRequest'
        clearingConfig:
          $ref: '#/components/schemas/ClearingConfigRequest'
          description: Clearing configuration (only applies to standard balance accounts)
    balanceAccountTransactionType:
      type: string
      enum:
        - TOPUP
        - TRANSFER
        - PAYMENT
        - PAYOUT
        - CLEARING_TRANSACTION
        - PENDING_PAYMENT
      x-enum-descriptions:
        TOPUP: Funds added to the balance account
        TRANSFER: Transfer between balance accounts
        PAYMENT: Payment made from the balance account
        PAYOUT: Funds paid out to an external instrument
        CLEARING_TRANSACTION: Transaction cleared from the balance account
        PENDING_PAYMENT: Payment is pending
      example: TOPUP
    balanceAccountTransactionIncludeOptions:
      type: array
      items:
        type: string
        enum:
          - PENDING_PAYMENTS
        x-enum-descriptions:
          PENDING_PAYMENTS: Include pending payments in the response
      description: Comma-separated list of additional objects to include in the response
      example:
        - PENDING_PAYMENTS
    BalanceAccountTransactionDetails:
      type: object
      description: Details about the balance account transaction
      required:
        - balanceAccountId
        - transactionId
      properties:
        balanceAccountId:
          $ref: '#/components/schemas/accountId'
          description: ID of the balance account
        reference:
          type: string
          description: Reference for the transaction
          example: reference-12345
        description:
          type: string
          description: Description of the transaction
          example: Balance Account Topup
        counterPartyDetails:
          type: string
          description: Counter party details for the transaction (e.g., IBAN)
          example: NL95INGB6956299087
        transactionId:
          $ref: '#/components/schemas/id'
          description: ID of the transaction
    BalanceAccountTransactionItem:
      type: object
      description: Balance account transaction item
      required:
        - balanceAccountId
        - createdAt
        - transactionId
        - amount
        - currencyCode
        - balanceAccountTransactionType
        - journalType
        - transactionDetails
      properties:
        balanceAccountId:
          $ref: '#/components/schemas/accountId'
          description: ID of the balance account
        createdAt:
          $ref: '#/components/schemas/createdAt'
          description: Timestamp when the transaction was created
        transactionId:
          $ref: '#/components/schemas/id'
          description: ID of the transaction
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Transaction amount in minor units
        currencyCode:
          $ref: '#/components/schemas/balanceCurrencyCode'
          description: Currency code for the transaction
        balanceAccountTransactionType:
          $ref: '#/components/schemas/balanceAccountTransactionType'
          description: Type of the balance account transaction
        journalType:
          type: string
          enum:
            - TOPUP
            - WITHDRAWAL
          x-enum-descriptions:
            TOPUP: Funds added to the balance account
            WITHDRAWAL: Funds withdrawn from the balance account
          description: Direction of the money movement
          example: TOPUP
        counterPartyDetails:
          type: string
          description: Counter party details for the transaction (e.g., IBAN)
          example: NL95INGB6956299087
        description:
          type: string
          description: Description of the transaction
          example: Balance Account Topup
        reference:
          type: string
          description: Reference for the transaction
          example: reference-12345
        transactionDetails:
          $ref: '#/components/schemas/BalanceAccountTransactionDetails'
          description: Detailed information about the transaction
      example:
        balanceAccountId: 21210661298ac010520dd502015
        createdAt: '2025-07-29T17:06:36.107Z'
        transactionId: 212101b1875690124ce08790017
        amount: 1500
        currencyCode: EUR
        balanceAccountTransactionType: TOPUP
        journalType: TOPUP
        counterPartyDetails: NL95INGB6956299087
        description: Balance Account Topup
        reference: reference-12345
        transactionDetails:
          balanceAccountId: 21210661298ac010520dd502015
          reference: reference-12345
          description: Balance Account Topup
          counterPartyDetails: NL95INGB6956299087
          transactionId: 212101b1875690124ce08790017
    BalanceAccountTransactionListResponse:
      type: array
      description: List of balance account transactions
      items:
        $ref: '#/components/schemas/BalanceAccountTransactionItem'
      example:
        - balanceAccountId: 21210661298ac010520dd502015
          createdAt: '2025-07-29T17:06:36.107Z'
          transactionId: 212101b1875690124ce08790017
          amount: 1500
          currencyCode: EUR
          balanceAccountTransactionType: TOPUP
          journalType: TOPUP
          counterPartyDetails: NL95INGB6956299087
          description: Balance Account Topup
          reference: reference-12345
          transactionDetails:
            balanceAccountId: 21210661298ac010520dd502015
            reference: reference-12345
            description: Balance Account Topup
            counterPartyDetails: NL95INGB6956299087
            transactionId: 212101b1875690124ce08790017
    getCapabilityIncludeParameter:
      type: string
      enum:
        - PLANS
      x-enum-descriptions:
        PLANS: Include capability plans with their requirements
      example: PLANS
    ListAccountCapabilitiesResponse:
      type: array
      description: List of capabilities for the account
      items:
        $ref: '#/components/schemas/Capability'
    MerchantAccountCapability:
      type: object
      title: Merchant account capability
      description: Capability for a merchant account (PAYMENTS or PAYOUTS)
      required:
        - accountId
        - status
        - type
        - activePlans
        - createdAt
        - updatedAt
      properties:
        type:
          type: string
          enum:
            - PAYMENTS
            - PAYOUTS
          description: Capability type
          example: PAYMENTS
        accountId:
          $ref: '#/components/schemas/accountId'
        status:
          $ref: '#/components/schemas/capabilityStatus'
        activePlans:
          type: array
          description: The active plans for the capability
          items:
            type: string
            enum:
              - PAYMENTS_LIMITED
              - PAYMENTS_STANDARD
              - PAYOUTS_STANDARD
        plans:
          type: array
          description: Plans with their status, constraints and requirements
          items:
            $ref: '#/components/schemas/CapabilityPlan'
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
    models_ExternalBalanceAccountCapabilityPlan:
      type: object
      title: Payotus external plan
      description: The Payouts external plan for external balance accounts
      required:
        - planType
        - status
        - createdAt
        - updatedAt
      properties:
        planType:
          type: string
          enum:
            - PAYOUTS_EXTERNAL
          description: Plan type
          example: PAYOUTS_EXTERNAL
        status:
          $ref: '#/components/schemas/CapabilityPlanStatus'
        requirements:
          type: array
          items:
            $ref: '#/components/schemas/ExternalBalanceAccountCapabilityRequirements'
          description: Onboarding requirements for this plan
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
    models_ExternalBalanceAccountCapability:
      type: object
      title: External balance account capability
      description: PAYOUTS capability for an external balance account
      required:
        - accountId
        - status
        - type
        - activePlans
        - createdAt
        - updatedAt
      properties:
        type:
          type: string
          enum:
            - PAYOUTS
          description: Capability type
          example: PAYOUTS
        accountId:
          $ref: '#/components/schemas/accountId'
        status:
          $ref: '#/components/schemas/capabilityStatus'
        activePlans:
          type: array
          description: The active plans for the capability
          items:
            type: string
            enum:
              - PAYOUTS_EXTERNAL
        plans:
          type: array
          description: Plans with their status and requirements
          items:
            $ref: '#/components/schemas/models_ExternalBalanceAccountCapabilityPlan'
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
    CapabilityResponse:
      title: Capability response
      description: Capability response (merchant account or external balance account)
      oneOf:
        - $ref: '#/components/schemas/MerchantAccountCapability'
          title: Merchant account capability
        - $ref: '#/components/schemas/models_ExternalBalanceAccountCapability'
          title: External balance account capability
    requestType:
      type: string
      enum:
        - API
        - PORTAL
        - PORTAL_ID
      x-enum-descriptions:
        API: Default request type. The requirements will be validated and must be met before the plan can be requested.
        PORTAL: A link to a hosted form will be generated to collect details required for the capability plan. The plan will be requested upon form submission if all requirements are met.
        PORTAL_ID: A link to a hosted form will be generated to collect a identity verification for the business representative.
      example: API
      default: API
    MerchantAccountCapabilityRequest:
      type: object
      title: Merchant account capability request
      description: |
        Request a capability plan for a merchant account. Plans must be requested in order: first PAYMENTS_LIMITED, then PAYMENTS_STANDARD. The PAYOUTS_STANDARD plan is automatically granted when PAYMENTS_STANDARD is approved.
      required:
        - plan
      properties:
        plan:
          type: string
          enum:
            - PAYMENTS_LIMITED
            - PAYMENTS_STANDARD
          description: The capability plan to request. PAYMENTS_LIMITED must be requested first, then PAYMENTS_STANDARD.
          example: PAYMENTS_LIMITED
        requestType:
          $ref: '#/components/schemas/requestType'
        redirectUrl:
          $ref: '#/components/schemas/redirectUrl'
    ExternalBalanceAccountCapabilityRequest:
      type: object
      title: External balance account capability request
      description: Request a capability plan for an external balance account
      required:
        - plan
      properties:
        plan:
          type: string
          enum:
            - PAYOUTS_EXTERNAL
          description: The capability plan to request
          example: PAYOUTS_EXTERNAL
        requestType:
          type: string
          enum:
            - API
          description: Request type
          example: API
          default: API
    CapabilityRequestParameters:
      title: Capability request
      description: Request parameters for a capability plan (merchant account or external balance account)
      oneOf:
        - $ref: '#/components/schemas/MerchantAccountCapabilityRequest'
          title: Merchant account capability request
        - $ref: '#/components/schemas/ExternalBalanceAccountCapabilityRequest'
          title: External balance account capability request
    URL:
      type: string
      format: uri
      description: A URL
      example: https://www.example.com
    file:
      type: object
      description: A file is a single file that is associated with a document. It can be downloaded via the `url`.
      properties:
        url:
          $ref: '#/components/schemas/URL'
          description: The URL from which the file can be downloaded
        expiresAt:
          type: string
          format: date-time
          description: The date and time the download url expires
          example: '2025-01-01T00:00:00Z'
      required:
        - url
        - expiresAt
    DocumentType:
      type: string
      enum:
        - PROOF_OF_ADDRESS
        - REGISTRATION_DOCUMENT
        - VAT_DOCUMENT
        - PROOF_OF_ORGANIZATION_TAX_INFO
        - PROOF_OF_OWNERSHIP
        - PROOF_OF_INDUSTRY
        - PROOF_OF_SIGNATORY
        - PROOF_OF_FUNDING_OR_WEALTH_SOURCE
        - IDENTITY_DOCUMENT
        - DRIVERS_LICENSE
        - PASSPORT
        - LIVE_SELFIE
        - PROOF_OF_NATIONAL_ID_NUMBER
        - PROOF_OF_ADDRESS
        - PROOF_OF_INDIVIDUAL_TAX_ID
        - PROOF_OF_RELATIONSHIP
        - CONSTITUTIONAL_DOCUMENT
        - BANK_STATEMENT
      x-enum-descriptions:
        PROOF_OF_ADDRESS: Document proving registered or residential address (utility bill, lease agreement, etc.)
        REGISTRATION_DOCUMENT: Official registration document for the organization
        VAT_DOCUMENT: Value Added Tax registration or compliance document
        PROOF_OF_ORGANIZATION_TAX_INFO: Document proving the organization's tax information
        PROOF_OF_OWNERSHIP: Document proving ownership structure of the organization
        PROOF_OF_INDUSTRY: Document proving the industry or business sector
        PROOF_OF_SIGNATORY: Document proving signatory authority for an organization
        PROOF_OF_FUNDING_OR_WEALTH_SOURCE: Document proving the legitimate source of funds or wealth
        IDENTITY_DOCUMENT: Government-issued identity document
        DRIVERS_LICENSE: Government-issued driver's license
        PASSPORT: Government-issued passport
        LIVE_SELFIE: Live selfie for identity verification
        PROOF_OF_NATIONAL_ID_NUMBER: Document proving national identification number
        PROOF_OF_INDIVIDUAL_TAX_ID: Document proving individual tax identification number
        PROOF_OF_RELATIONSHIP: Document proving relationship to the organization or account
        CONSTITUTIONAL_DOCUMENT: Constitutional or founding document (for sole proprietorship, trust, or unincorporated partnership)
        BANK_STATEMENT: Bank statement showing the legal entity name and account number
    Document:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: The unique identifier of the document
        accountId:
          $ref: '#/components/schemas/id'
          description: The account id of the account to which the document is scoped
        files:
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/file'
        type:
          $ref: '#/components/schemas/DocumentType'
          description: The type of document (varies by category)
        name:
          type: string
          description: The name of the document
          example: Bank statement for account 1234567890
        description:
          type: string
          description: Optional additional metadata or description about the document
          example: Account number shown in the top right corner
        details:
          type: object
          description: Specific details extracted from the document
      required:
        - id
        - accountId
        - type
        - files
    fileUploadType:
      type: string
      enum:
        - BASE_64
      x-enum-descriptions:
        BASE_64: Direct file upload by providing the file content in base64 format
      description: The type of file upload. Only BASE_64 is supported at the moment.
      example: BASE_64
    directFile:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/fileUploadType'
        content:
          type: string
          description: The base64 encoded content of the file
          example: JVBERi0xLjQKJcOkw7zDtsO...
      required:
        - content
        - type
    DocumentCategory:
      type: string
      enum:
        - INDIVIDUAL
        - COMPANY
        - FUNDING_INSTRUMENT
      x-enum-descriptions:
        INDIVIDUAL: A document related to an individual
        COMPANY: A document related to a company
        FUNDING_INSTRUMENT: A document related to a funding instrument
      example: INDIVIDUAL
    DocumentRequest:
      type: object
      description: A document is a file that is associated with an account and can be used to provide evidence. You can either upload the files directly by providing the files in base64 format, or via requesting a number of presigned URLs to upload the files to.
      properties:
        accountId:
          $ref: '#/components/schemas/id'
          description: The account id of the account to which the document is scoped
        files:
          type: array
          minItems: 1
          items:
            oneOf:
              - $ref: '#/components/schemas/directFile'
                title: Direct file upload
          description: The total maximum file size **limit is 6MB**
          required:
            - name
        category:
          $ref: '#/components/schemas/DocumentCategory'
          description: The category of the document
        type:
          $ref: '#/components/schemas/DocumentType'
          description: The type of document (varies by category)
        name:
          type: string
          description: The name of the document
          example: Bank statement
        description:
          type: string
          description: Optional additional metadata or description about the document
          example: Account number shown in the top right corner
        target:
          type: object
          properties:
            type:
              type: string
              enum:
                - LEGAL_ENTITY
                - FUNDING_INSTRUMENT
              description: The type of target to which the document is associated
            id:
              $ref: '#/components/schemas/id'
              description: The id of the target to which the document is associated
          required:
            - type
            - id
          description: The target with which the document is associated. Equivalent to adding a document to the target as a separate step.
      required:
        - accountId
        - type
        - files
        - category
    legalEntityType:
      type: string
      enum:
        - INDIVIDUAL
        - ORGANIZATION
      description: Type of legal entity
      example: ORGANIZATION
    OrganizationAssociation:
      type: object
      properties:
        associatedWith:
          $ref: '#/components/schemas/id'
          description: The unique identifier of the associated organization entity
        category:
          type: string
          enum:
            - OrganizationAssociation
          description: The category of the association
          example: OrganizationAssociation
        ownershipPercentage:
          type: number
          minimum: 0
          maximum: 100
          description: The percentage ownership (0-100)
          example: 100
        type:
          type: string
          enum:
            - ULTIMATE_PARENT_COMPANY
          description: The relationship type
          example: ULTIMATE_PARENT_COMPANY
      required:
        - type
        - associatedWith
        - category
    IndividualAssociation:
      type: object
      properties:
        associatedWith:
          $ref: '#/components/schemas/id'
          description: The unique identifier of the associated individual entity
        category:
          type: string
          enum:
            - IndividualAssociation
          description: The category of the association
          example: IndividualAssociation
        jobTitle:
          type: string
          description: The individual's job title
          example: Chief Executive Officer
        ownershipPercentage:
          type: number
          minimum: 0
          maximum: 100
          description: The percentage ownership (0-100)
          example: 25
        type:
          type: string
          enum:
            - DIRECTOR
            - SIGNATORY
            - UBO_THROUGH_OWNERSHIP
            - UBO_THROUGH_CONTROL
            - SOLE_PROPRIETORSHIP
            - ACCOUNT_OWNER
          x-enum-descriptions:
            DIRECTOR: Business director
            SIGNATORY: A person with signing authority
            UBO_THROUGH_OWNERSHIP: Ultimate Beneficial Owner through ownership
            UBO_THROUGH_CONTROL: Ultimate Beneficial Owner through control
            SOLE_PROPRIETORSHIP: Sole proprietorship
            ACCOUNT_OWNER: Business representative
          description: The type of the association
          example: DIRECTOR
      required:
        - category
        - associatedWith
        - type
    Association:
      oneOf:
        - $ref: '#/components/schemas/OrganizationAssociation'
          title: Organization Association
        - $ref: '#/components/schemas/IndividualAssociation'
          title: Individual Association
    BaseLegalEntityRequest:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/legalEntityType'
        associations:
          type: array
          items:
            $ref: '#/components/schemas/Association'
      required:
        - type
    TaxInformation:
      type: object
      properties:
        countryCode:
          $ref: '#/components/schemas/countryCode'
          example: 'NO'
        taxIdNumber:
          type: string
          description: The tax ID number (TIN) of the organization or individual.
          example: '12345678901'
      required:
        - countryCode
        - taxIdNumber
    Individual:
      type: object
      required:
        - firstName
        - lastName
      properties:
        firstName:
          type: string
          description: The individual's first name. Must not be blank.
          example: John
        lastName:
          type: string
          description: The individual's last name. Must not be blank.
          example: Doe
        dateOfBirth:
          type: string
          description: The individual's date of birth, in YYYY-MM-DD format. Optional but highly recommended.
          example: '1985-03-15'
        residentialAddress:
          $ref: '#/components/schemas/address'
          description: The individual's primary residential address. Country code is optional but highly recommended.
          example:
            street: 123 Main Street
            city: Oslo
            postalCode: '0123'
            countryCode: 'NO'
        email:
          $ref: '#/components/schemas/email'
          description: The primary email address of the individual.
        nationality:
          $ref: '#/components/schemas/countryCode'
          description: The individual's primary nationality.
          example: 'NO'
        phoneNumber:
          $ref: '#/components/schemas/phoneNumber'
          description: The individual's primary phone number.
          example: '+4712345678'
        taxInformation:
          type: array
          description: The tax information of the individual.
          items:
            $ref: '#/components/schemas/TaxInformation'
          example:
            - countryCode: 'NO'
              taxIdNumber: '12345678901'
    LegalEntityIndividualRequest:
      title: Individual
      allOf:
        - $ref: '#/components/schemas/BaseLegalEntityRequest'
        - type: object
          properties:
            type:
              const: INDIVIDUAL
            individual:
              $ref: '#/components/schemas/Individual'
          required:
            - individual
    MCC:
      type: string
      enum:
        - '0000'
        - '0742'
        - '1520'
        - '4111'
        - '4121'
        - '4784'
        - '4789'
        - '5074'
        - '5261'
        - '5399'
        - '5411'
        - '5441'
        - '5499'
        - '5511'
        - '5552'
        - '5611'
        - '5641'
        - '5651'
        - '5655'
        - '5661'
        - '5691'
        - '5699'
        - '5732'
        - '5734'
        - '5812'
        - '5813'
        - '5814'
        - '5921'
        - '5944'
        - '5945'
        - '5992'
        - '5995'
        - '5999'
        - '6300'
        - '6513'
        - '7011'
        - '7230'
        - '7298'
        - '7523'
        - '7832'
        - '7994'
        - '7995'
        - '7997'
        - '7999'
        - '8931'
        - '8999'
      x-enum-descriptions:
        '1520': General Contractors-Residential And Commercial
        '4111': Local/suburban Commuter Passenger Transportation
        '4121': Taxi & Limousine Services
        '4784': Tolls and Bridge Fees
        '4789': Transportation Services
        '5074': Hardware, Equipment, and Supplies
        '5261': Garden Centers & Plant Nurseries
        '5399': General Merchandise
        '5411': Grocery Stores & Supermarkets
        '5441': Candy, Sweets & Chocolate Shops
        '5499': Specialty Food Stores
        '5511': Car And Truck Dealers, Service, Repairs, Parts, and Leasing
        '5552': Electric Vehicle Charging
        '5611': Men's Clothing Stores
        '5641': Children's Clothing Stores
        '5651': Family Clothing Stores
        '5655': Sportswear & Outdoor Apparel
        '5661': Shoe Stores
        '5691': Unisex Fashion & Apparel
        '5699': Apparel and Accessory Stores
        '5732': Electronic Sales
        '5734': Computer Software Stores
        '5812': Restaurants & Cafés
        '5813': Bars & Pubs (Alcohol)
        '5814': Fast Food Restaurants
        '5921': Package Stores – Beer, Wine, And Liquor
        '5944': Jewelry & Watch Stores
        '5945': Toy, Game & Hobby Stores
        '5992': Florists
        '5995': Pet Shops & Pet Supplies
        '5999': Specialty Retail Stores
        '6300': Insurance Providers & Brokers
        '6513': Rental Property Managers & Real Estate Agents
        '7011': Lodging – Hotels, Motels, Resorts, Central Reservation Services
        '7230': Hair Salons, Barber Shops & Beauty Services
        '7298': Health And Beauty Shops
        '7523': Parking Lots, Parking Meters and Garages
        '7832': Motion Picture Theaters
        '7994': Video Game Arcades/Establishments
        '7995': Betting, Lottery, and Gambling
        '7997': Membership Clubs (Sports, Recreation, Athletic), Country Clubs, And Private Golf Courses
        '7999': Recreation Services
        '8931': Accounting, Auditing, And Bookkeeping Services
        '8999': Professional Services not classified elsewhere
        '0000': Other
        '0742': Veterinary Services
      description: The MCC code of this business line
      example: '5734'
    SalesChannel:
      type: string
      enum:
        - POS
        - E_COMMERCE
      description: A list of channels where goods or services are sold
    BusinessLine:
      type: object
      properties:
        mcc:
          $ref: '#/components/schemas/MCC'
          description: The MCC code of this business line
          example: '5734'
        salesChannels:
          type: array
          items:
            $ref: '#/components/schemas/SalesChannel'
          description: A list of channels where goods or services are sold
        webData:
          oneOf:
            - type: object
              title: URLs
              properties:
                exempt:
                  type: boolean
                  enum:
                    - false
                  example: false
                urls:
                  type: array
                  items:
                    $ref: '#/components/schemas/URL'
                  description: List of website URLs where goods are sold
                  example:
                    - https://www.example.com
                    - https://shop.example.com
              required:
                - exempt
                - urls
            - type: object
              title: Exemption reason
              properties:
                exempt:
                  type: boolean
                  enum:
                    - true
                  example: true
                reason:
                  type: string
                  description: Description of why webData is exempt, e.g. No web presence
                  example: No web presence - physical retail only
              required:
                - exempt
                - reason
      required:
        - mcc
        - salesChannels
        - webData
    Organization:
      type: object
      required:
        - legalName
      properties:
        legalName:
          type: string
          description: The organization's legal name. (Formally called businessName)
          example: Acme Corporation AS
        doingBusinessAs:
          type: string
          description: The organization's trading name, if different from the registered legal name.
          example: Acme
        registrationNumber:
          type: string
          description: The organization's registration number. (Formally companyRegistrationNumber)
          example: '123456789'
        vatNumber:
          type: string
          description: The organization's VAT number. Needs to be present if tinNumber is empty.
          example: NO123456789MVA
        taxIdNumber:
          type: string
          description: Tax number. Needs to be present if vatNumber is empty.
          example: '123456789'
        type:
          type: string
          enum:
            - PUBLIC_LISTED_COMPANY
            - PRIVATE_LIMITED
            - SOLE_TRADER
            - NON_PROFIT
            - GENERAL_PARTNERSHIP
            - LIMITED_PARTNERSHIP
          x-enum-descriptions:
            PUBLIC_LISTED_COMPANY: Public (listed) Company
            PRIVATE_LIMITED: Private Limited
            SOLE_TRADER: Sole Trader
            NON_PROFIT: Foundation/Non-Profit
            GENERAL_PARTNERSHIP: General Partnership
            LIMITED_PARTNERSHIP: Limited Partnership
          example: PRIVATE_LIMITED
        registeredAddress:
          $ref: '#/components/schemas/address'
          required:
            - countryCode
          description: The organization's officially registered address.
          example:
            street: 456 Business Avenue
            city: Oslo
            postalCode: '0456'
            countryCode: 'NO'
        principalPlaceOfBusiness:
          $ref: '#/components/schemas/address'
          required:
            - countryCode
          description: The organization's principal place of business.
          example:
            street: 789 Commerce Street
            city: Bergen
            postalCode: '5001'
            countryCode: 'NO'
        businessLines:
          type: array
          description: |
            The businessLines of an organization.
            Max size of the array is 1, currently only one businessLine is supported.
          items:
            $ref: '#/components/schemas/BusinessLine'
          maxItems: 1
          example:
            - mcc: '5734'
              salesChannels:
                - ECOM
              webData:
                exempt: false
                urls:
                  - https://www.acme.com
                  - https://shop.acme.com
    LegalEntityOrganizationRequest:
      title: Organization
      allOf:
        - $ref: '#/components/schemas/BaseLegalEntityRequest'
        - type: object
          properties:
            type:
              const: ORGANIZATION
            organization:
              $ref: '#/components/schemas/Organization'
          required:
            - organization
    LegalEntityRequest:
      type: object
      discriminator:
        propertyName: type
        mapping:
          INDIVIDUAL: '#/components/schemas/LegalEntityIndividualRequest'
          ORGANIZATION: '#/components/schemas/LegalEntityOrganizationRequest'
      oneOf:
        - $ref: '#/components/schemas/LegalEntityIndividualRequest'
          title: Individual
        - $ref: '#/components/schemas/LegalEntityOrganizationRequest'
          title: Organization
    LegalEntityOrganization:
      title: Organization
      allOf:
        - $ref: '#/components/schemas/LegalEntityOrganizationRequest'
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Unique identifier of the legal entity
        associatedLegalEntities:
          type: array
          oneOf:
            - $ref: '#/components/schemas/LegalEntityOrganization'
              title: Organization
            - $ref: '#/components/schemas/LegalEntityIndividual'
              title: Individual
        documents:
          type: array
          items:
            $ref: '#/components/schemas/Document'
      required:
        - id
        - type
        - organization
    LegalEntityIndividual:
      allOf:
        - type: object
          properties:
            id:
              $ref: '#/components/schemas/id'
              description: Unique identifier of the legal entity
            associatedLegalEntities:
              type: array
              oneOf:
                - $ref: '#/components/schemas/LegalEntityOrganization'
                  title: Organization
                - $ref: '#/components/schemas/LegalEntityIndividual'
                  title: Individual
            documents:
              type: array
              items:
                $ref: '#/components/schemas/Document'
          required:
            - id
        - $ref: '#/components/schemas/LegalEntityIndividualRequest'
    LegalEntity:
      oneOf:
        - $ref: '#/components/schemas/LegalEntityIndividual'
          title: Individual
        - $ref: '#/components/schemas/LegalEntityOrganization'
          title: Organization
      example:
        id: 21210021c2855007efa2d657018
        type: ORGANIZATION
        associations:
          - category: OrganizationAssociation
            associatedWith: 21210021c2855007efa2d657018
            ownershipPercentage: 100
            type: ULTIMATE_PARENT_COMPANY
        organization:
          legalName: Acme Corporation AS
          doingBusinessAs: Acme
          registrationNumber: 123456789
          vatNumber: NO123456789MVA
          taxIdNumber: 123456789
    getLegalEntityIncludeParameters:
      type: string
      enum:
        - ASSOCIATED_LEGAL_ENTITIES
        - DOCUMENTS
      x-enum-descriptions:
        ASSOCIATED_LEGAL_ENTITIES: Include associated legal entities
        DOCUMENTS: Include documents
    Signature:
      type: object
      description: Payload for signing terms and conditions.
      properties:
        email:
          type: string
          format: email
          example: john.doe@example.com
          description: Email address of the signer
        firstName:
          type: string
          example: John
          description: First name of the signer
        lastName:
          type: string
          example: Doe
          description: Last name of the signer
        signedAt:
          type: string
          format: date-time
          default: now
          description: Optional date of signature, defaults to now.
          example: '2025-01-01T00:00:00Z'
      required:
        - email
        - firstName
        - lastName
    DocumentSignatureRequest:
      type: object
      description: Sign document request payload.
      properties:
        signature:
          $ref: '#/components/schemas/Signature'
      required:
        - signature
    OnboardMerchantAccountRequest:
      type: object
      description: Request parameters for onboarding a merchant account
      required:
        - parentAccountId
        - name
        - description
        - onboardingEmail
      properties:
        parentAccountId:
          $ref: '#/components/schemas/accountId'
          description: Platform account ID
        name:
          type: string
          description: Name of the merchant
        description:
          type: string
          description: Description of the merchant
        onboardingEmail:
          $ref: '#/components/schemas/email'
          description: Email address to which the onboarding email will be sent
        userLastName:
          type: string
          description: Last name of the merchant user
        userFirstName:
          type: string
          description: First name of the merchant user
        countryCode:
          $ref: '#/components/schemas/countryCode'
          description: Country code of the merchant user
    OnboardMerchantAccountResponse:
      type: object
      description: Response parameters for onboarding a merchant account
      required:
        - accountId
        - operatingAccountId
      properties:
        accountId:
          $ref: '#/components/schemas/accountId'
          description: The ID of the merchant account which has been created
        operatingAccountId:
          $ref: '#/components/schemas/accountId'
          description: The ID of the default operating account which has been created
        userId:
          $ref: '#/components/schemas/id'
          description: The ID of the merchant user which has been created
        legalEntityId:
          $ref: '#/components/schemas/id'
          description: The ID of the legal entity which has been created
    BasePaymentRequest:
      type: object
      description: Common properties for payment initiation requests
      required:
        - amount
        - currencyCode
        - accountId
      properties:
        checkoutId:
          type: string
          description: ID of the checkout session (optional)
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
        currencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
        lineItems:
          type: array
          description: Details about the products sold or services provided
          items:
            $ref: '#/components/schemas/LineItem'
        merchantReference:
          type: string
          description: A free-form reference to identify the transaction in your system
        ipAddress:
          type: string
          format: ipv4
          description: IP address of the customer initiating the payment
        accountId:
          type: string
          description: Operating Account ID to which the payment will be credited
        seonDeviceFingerprint:
          type: string
          description: Device fingerprint for fraud detection
        expiresAt:
          type: string
          format: date-time
          description: When the payment expires (defaults to 7 days from now)
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Free-form key-value pairs to tag and correlate this payment
    IdealPaymentRequest:
      allOf:
        - $ref: '#/components/schemas/BasePaymentRequest'
        - type: object
          description: Request parameters for initiating an iDEAL payment
          required:
            - currencyCode
            - paymentMethodDetails
          properties:
            currencyCode:
              type: string
              description: Currency code associated with the amount. Determines the base currency of the payment.
              enum:
                - EUR
            paymentMethodDetails:
              type: object
              required:
                - description
                - redirectUrl
              properties:
                description:
                  type: string
                  description: Description of the payment, will be displayed on the customer's statement
                redirectUrl:
                  type: string
                  description: URL to which the customer should be sent after the payment. Any payment results will be sent to this URL.
      example:
        amount: 1000
        currencyCode: EUR
        accountId: 21210021c2855007efa2d657018
        paymentMethodDetails:
          redirectUrl: https://www.charge.com/payment-result
          description: Payment for services
    TransactionStatus:
      type: string
      description: Status of a transaction
      enum:
        - AUTHORIZED
        - DECLINED
        - ERROR
        - POSSIBLE_FRAUD
        - INITIATED
    PaymentResponseBase:
      type: object
      description: Payment response
      required:
        - id
        - status
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Transaction ID
        status:
          $ref: '#/components/schemas/TransactionStatus'
        reason:
          type: string
          description: Reason for the payment status
          enum:
            - ACQUIRER_DECLINED
            - ACQUIRER_ERROR
            - ACQUIRER_UNAVAILABLE
            - INVALID_AMOUNT
            - INVALID_REQUEST
            - MALFORMED_PARAMETERS
            - INVALID_TRANSACTION_STATUS
            - NOT_ENOUGH_BALANCE
            - NOT_SUPPORTED
            - FULL_AMOUNT_CAPTURED
            - POSSIBLE_FRAUD
            - TRANSACTION_IN_PROGRESS
        details:
          type: object
          description: Additional details about the payment
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Metadata associated with this payment
    PaymentResponse:
      allOf:
        - $ref: '#/components/schemas/PaymentResponseBase'
        - type: object
          description: Shopper action response
          properties:
            action:
              type: string
              enum:
                - REDIRECT_SHOPPER
                - AWAIT_EXTERNAL_ACTION
                - PRESENT_DETAILS
            id:
              $ref: '#/components/schemas/id'
              description: Transaction identifier
            status:
              type: string
              enum:
                - AUTHORIZED
                - DECLINED
                - ERROR
                - INPROGRESS
              description: |
                Transaction status:
                - AUTHORIZED: Payment successfully authorized
                - DECLINED: Payment declined by issuer/acquirer
                - ERROR: Technical error occurred
                - INPROGRESS: 3DS authentication required
                - INITIATED: Payment initiated and requires further action to become `AUTHORIZED`
              example: AUTHORIZED
            details:
              type: object
              properties:
                transactionVariant:
                  type: string
                  enum:
                    - card
                  description: Payment method variant
                  example: card
                acquirerResponseMessage:
                  type: string
                  description: Message from the acquirer
                  example: Transaction has been executed successfully.
                acquirerResponseCode:
                  type: string
                  description: Response code from the acquirer
                  example: '00'
                message:
                  type: string
                  description: Additional information about the transaction
                  example: Payment authorized successfully
                declineReason:
                  type: string
                  enum:
                    - INSUFFICIENT_FUNDS
                    - INVALID_CARD
                    - EXPIRED_CARD
                    - CARD_BLOCKED
                    - ISSUER_DECLINED
                    - FRAUD_SUSPECTED
                    - LIMIT_EXCEEDED
                    - GENERIC_DECLINE
                  description: Reason for decline (when status is DECLINED)
                  example: INSUFFICIENT_FUNDS
                errorType:
                  type: string
                  enum:
                    - INVALID_CARD_DATA
                    - PROCESSING_ERROR
                    - ACQUIRER_ERROR
                    - NETWORK_ERROR
                    - CONFIGURATION_ERROR
                  description: Type of error (when status is ERROR)
                  example: INVALID_CARD_DATA
                card:
                  type: object
                  description: Card information (sensitive data masked)
                  properties:
                    bin:
                      type: string
                      description: Bank Identification Number (first 6 digits)
                      example: '411111'
                    lastFour:
                      type: string
                      description: Last four digits of the card
                      example: '1111'
                    expiryMonth:
                      type: integer
                      description: Card expiry month
                      example: 12
                    expiryYear:
                      type: integer
                      description: Card expiry year
                      example: 2025
                    cardholderName:
                      type: string
                      description: Cardholder name
                      example: John Doe
                    brand:
                      type: string
                      description: Card brand/scheme
                      example: Visa
          required:
            - id
            - status
    IdealPaymentResponse:
      allOf:
        - $ref: '#/components/schemas/PaymentResponse'
        - type: object
          properties:
            status:
              type: string
              enum:
                - INITIATED
        - type: object
          properties:
            action:
              type: string
              enum:
                - REDIRECT_SHOPPER
            details:
              type: object
              properties:
                url:
                  type: string
                  description: URL where customer **must** be redirect to complete payment
                paymentId:
                  type: string
                  description: Payment identifier
                transactionVariant:
                  type: string
                  description: Type of payment method used
                  enum:
                    - ideal
                acquirerResponseCode:
                  type: string
                  description: Response code from payment processor
                reason:
                  type: string
                expiresAt:
                  type: string
                  format: date-time
                  description: When this payment expires
    OpenBankingPaymentRequest:
      allOf:
        - $ref: '#/components/schemas/BasePaymentRequest'
        - type: object
          description: Request parameters for initiating an Open Banking payment
          required:
            - paymentMethodDetails
          properties:
            currencyCode:
              type: string
              description: Currency code (only EUR supported)
              enum:
                - EUR
            paymentMethodDetails:
              type: object
              required:
                - redirectUrl
              properties:
                redirectUrl:
                  type: string
                  description: URL to which the customer should be sent after the payment. Any payment results will be sent to this URL.
      example:
        amount: 1000
        currencyCode: EUR
        accountId: 21210021c2855007efa2d657018
        paymentMethodDetails:
          redirectUrl: https://www.charge.com/payment-result
          description: Payment for services
    OpenBankingPaymentResponse:
      allOf:
        - $ref: '#/components/schemas/PaymentResponse'
        - type: object
          properties:
            details:
              type: object
              properties:
                transactionVariant:
                  type: string
                  description: Payment method used
                  enum:
                    - openbanking
                reference:
                  type: string
                responseMessage:
                  type: string
                errorCode:
                  type: string
                paymentId:
                  type: string
                expiration:
                  type: string
                linkToken:
                  type: string
                payee:
                  type: string
                recipientId:
                  type: string
                acquirerName:
                  type: string
                acquirerAccountId:
                  type: string
                redirectUrl:
                  type: string
    captureWhen:
      type: string
      enum:
        - INSTANT
        - MANUAL
      x-enum-descriptions:
        INSTANT: Capture immediately
        MANUAL: Capture manually
      example: INSTANT
    cardTransactionType:
      type: string
      enum:
        - ONE_OFF
        - FIRST_RECURRING
        - SUBSEQUENT_RECURRING
        - FIRST_UNSCHEDULED
        - SUBSEQUENT_UNSCHEDULED
        - SUBSEQUENT_UNSCHEDULED_CUSTOMER_INITIATED
      x-enum-descriptions:
        ONE_OFF: One-off transaction
        FIRST_RECURRING: The first in a series of recurring transactions
        SUBSEQUENT_RECURRING: A subsequent recurring transaction
        FIRST_UNSCHEDULED: The first in a series of unscheduled transactions
        SUBSEQUENT_UNSCHEDULED: A subsequent unscheduled transaction
        SUBSEQUENT_UNSCHEDULED_CUSTOMER_INITIATED: A subsequent unscheduled transaction initiated by cardholder
      example: ONE_OFF
    authorizationType:
      type: string
      enum:
        - PRE_AUTH
        - FINAL_AUTH
        - ACCOUNT_STATUS
      x-enum-descriptions:
        PRE_AUTH: Pre-authorization
        FINAL_AUTH: Final authorization
        ACCOUNT_STATUS: Account status
      example: PRE_AUTH
    preAuthorizationType:
      type: string
      enum:
        - INCREMENTAL
        - STANDARD
      x-enum-descriptions:
        INCREMENTAL: Incremental pre-authorization
        STANDARD: Standard pre-authorization
      example: INCREMENTAL
    tokenCrypto:
      type: string
      description: |
        Related to Apple Pay and Google Pay.
        This is a 32-character hexadecimal string.
    tokenEci:
      type: string
      description: |
        Related to Apple Pay and Google Pay.
        This is a 2-character hexadecimal string.
    walletType:
      type: string
      enum:
        - APPLE_PAY
        - GOOGLE_PAY
      x-enum-descriptions:
        APPLE_PAY: Apple Pay wallet
        GOOGLE_PAY: Google Pay wallet
      example: APPLE_PAY
    dynamicDescriptor:
      type: string
      description: Dynamic statement descriptor for the transaction
      example: My Company
      minLength: 5
      maxLength: 18
      pattern: ^[a-zA-Z0-9 ]*$
    threedsData:
      type: object
      description: 3D Secure data
      properties:
        threedsVersion:
          type: string
          description: 3D Secure version
        threedsData:
          type: string
          description: 3D Secure data
        threedsDstTrxid:
          type: string
          description: 3D Secure destination transaction ID
      example:
        threedsVersion: 2.1.0
        threedsData: 3D Secure data
        threedsDstTrxid: 3D Secure destination transaction ID
    CardPaymentMethodRequestDetails:
      type: object
      description: Details about the card used for payment
      properties:
        cardDetails:
          type: object
          description: Card details
          required:
            - cardNumber
            - expiryMonth
            - expiryYear
          properties:
            cardNumber:
              type: string
              description: Card number
            expiryMonth:
              type: integer
              description: Expiry month
            expiryYear:
              type: integer
              description: Expiry year
            cardHolderName:
              type: string
              description: Card holder name
            cvc:
              type: string
              description: CVC
        captureWhen:
          $ref: '#/components/schemas/captureWhen'
        transactionType:
          $ref: '#/components/schemas/cardTransactionType'
          description: Transaction type
          default: ONE_OFF
        initialTransactionId:
          $ref: '#/components/schemas/id'
          description: ID of the initial transaction. Required if subsequent and no transaction id is provided.
        networkTransactionReference:
          type: string
          description: Reference of the transaction in the network. Required if subsequent and no transaction id is provided.
        authorizationType:
          $ref: '#/components/schemas/authorizationType'
          description: Authorization type
          default: FINAL_AUTH
        preAuthorizationType:
          $ref: '#/components/schemas/preAuthorizationType'
        maximumAuthorizationAmount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Maximum amount that can be authorized in minor units
        tokenCrypto:
          $ref: '#/components/schemas/tokenCrypto'
        tokenEci:
          $ref: '#/components/schemas/tokenEci'
        walletType:
          $ref: '#/components/schemas/walletType'
        dynamicDescriptor:
          $ref: '#/components/schemas/dynamicDescriptor'
        threedsId:
          $ref: '#/components/schemas/id'
          description: ID of the 3DS transaction. Required if 3DS is enabled.
        threedsData:
          $ref: '#/components/schemas/threedsData'
          description: 3DS data. Either threedsId or threedsData may be provided, but not both.
      example:
        cardDetails:
          cardNumber: '4242424242424242'
          expiryMonth: 12
          expiryYear: 2025
          cardHolderName: John Doe
          cvc: '123'
        captureWhen: INSTANT
        authorizationType: FINAL_AUTH
    AuthorizePaymentRequest:
      allOf:
        - $ref: '#/components/schemas/BasePaymentRequest'
        - type: object
          required:
            - amount
            - currencyCode
            - accountId
            - paymentMethodDetails
          properties:
            amount:
              $ref: '#/components/schemas/amountWithCurrencyPrecision'
            currencyCode:
              $ref: '#/components/schemas/paymentCurrencyCode'
            merchantReference:
              type: string
              maxLength: 50
              description: Merchant's reference for the transaction
              example: ORDER-12345
            ipAddress:
              type: string
              format: ipv4
              description: Customer's IP address (required for 3DS and fraud detection)
              example: 192.168.1.1
            accountId:
              $ref: '#/components/schemas/id'
              description: Operating account identifier
            paymentMethodDetails:
              type: object
              description: Payment method specific details for card authorization
              required:
                - card
              properties:
                card:
                  $ref: '#/components/schemas/CardPaymentMethodRequestDetails'
      example:
        amount: 1000
        currencyCode: EUR
        accountId: 21210021c2855007efa2d657018
        paymentMethodDetails:
          card:
            authorizationType: AUTHORIZE
            cardDetails:
              cardNumber: '4242424242424242'
              expiryMonth: 12
              expiryYear: 2025
              cardHolderName: John Doe
              cvc: '123'
              captureWhen: INSTANT
    CardPaymentResponse:
      allOf:
        - $ref: '#/components/schemas/PaymentResponseBase'
        - type: object
          properties:
            details:
              type: object
              properties:
                transactionVariant:
                  type: string
                  enum:
                    - card
                acquirerResponseCode:
                  type: string
                  description: Response code from payment processor
                acquirerResponseMessage:
                  type: string
                  description: Response message from payment processor
                authorizationCode:
                  type: string
                  description: Authorization code from payment processor
                card:
                  type: object
                  properties:
                    bin:
                      type: string
                      description: First 6 digits of card number
                    lastFour:
                      type: string
                      description: Last 4 digits of card number
                    expiryMonth:
                      type: integer
                      description: Card expiry month (1-12)
                    expiryYear:
                      type: integer
                      description: Card expiry year
                    cardholderName:
                      type: string
                      description: Name of the cardholder
                    brand:
                      type: string
                      description: Card brand (e.g., VISA, MASTERCARD)
    IncrementAuthorizationRequest:
      type: object
      description: Request parameters for incrementing an authorized payment
      required:
        - transactionId
        - amount
      properties:
        transactionId:
          type: integer
          description: Amount to increment
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: |-
            The additional amount to be authorized on top of the previously authorized amount.
            Processed in the currency of the original transaction.
            **Note:** The amount will be added to the previously authorized amount.
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Additional metadata to attach to this increment operation
      example:
        transactionId: 21210021c2855007efa2d657018
        amount: 1000
    IncrementAuthorizationResponse:
      type: object
      description: Response from incrementing an authorized payment
      properties:
        id:
          type: string
          description: Transaction ID
        status:
          type: string
          description: Status of the payment
          enum:
            - AUTHORIZED
            - DECLINED
        details:
          type: object
          properties:
            transactionVariant:
              type: string
              description: Type of payment method used
              enum:
                - card
            acquirerResponseCode:
              type: string
              description: Response code from payment processor
    SplitPayment:
      type: object
      description: Details to be provided in case of a split payment, each item in the array represents a single account to which the payment will be split.
      properties:
        accountId:
          type: string
          description: ID of the operating account
        amount:
          type: integer
          description: Amount of this portion of the payment as a numeric value including decimals. E.g. 1 EUR is expressed as 100
        commission:
          type: string
          description: Commission to be assigned to the Platform
        paymentReference:
          type: string
          description: Payment reference for this portion of the payment
        lineItems:
          type: array
          description: Details about the products sold or services provided for this portion
          items:
            $ref: '#/components/schemas/LineItem'
    TwintPaymentRequest:
      type: object
      description: Request parameters for initiating a TWINT payment
      required:
        - amount
        - currencyCode
        - accountId
        - paymentMethodDetails
      properties:
        amount:
          type: integer
          description: Amount of the payment as a numeric value including decimals. E.g. 1 CHF is expressed as 100
        currencyCode:
          type: string
          description: Currency code associated with the amount. Determines the base currency of the payment.
          enum:
            - CHF
        accountId:
          type: string
          description: Operating Account ID to which the payment will be credited
        paymentMethodDetails:
          type: object
          required:
            - redirectUrl
          properties:
            redirectUrl:
              type: string
              description: URL to which the customer should be sent after the payment. Any payment results will be sent to this URL.
        merchantReference:
          type: string
          description: A free-form reference, typically used to identify the transaction in your system
        lineItems:
          $ref: '#/components/schemas/LineItem'
        ipAddress:
          type: string
          description: IP address of the customer initiating the payment
        splitPaymentConfig:
          type: array
          description: Details to be provided in case of a split payment, each item in the array represents an account to which the payment will be split
          items:
            $ref: '#/components/schemas/SplitPayment'
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Free-form key-value pairs to tag and correlate this payment
    TwintPaymentResponse:
      type: object
      description: Response from initiating a TWINT payment
      properties:
        id:
          type: string
          description: Transaction identifier
        status:
          type: string
          description: Status of the payment
          enum:
            - INITIATED
        action:
          type: string
          enum:
            - REDIRECT_SHOPPER
        details:
          type: object
          properties:
            url:
              type: string
              description: URL where customer should be redirected
            paymentId:
              type: string
              description: Payment identifier
    PaymentContractChargeRequest:
      type: object
      description: Request parameters for creating a charge using a payment contract
      required:
        - paymentContractId
        - amount
        - currencyCode
        - accountId
      properties:
        paymentContractId:
          type: string
          description: The ID of the payment contract
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
        currencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
        merchantReference:
          type: string
          maxLength: 50
          description: Merchant's reference for the transaction
          example: ORDER-12345
        lineItems:
          type: array
          description: Details about the products sold or services provided
          items:
            $ref: '#/components/schemas/LineItem'
        accountId:
          $ref: '#/components/schemas/id'
          description: Operating account identifier
        paymentMethodDetails:
          type: object
          description: The payment method details
          properties:
            card:
              type: object
              description: Additional configuration for card transactions
              properties:
                authorizationType:
                  $ref: '#/components/schemas/authorizationType'
                preAuthorizationType:
                  $ref: '#/components/schemas/preAuthorizationType'
                captureWhen:
                  $ref: '#/components/schemas/captureWhen'
            sepadd:
              type: object
              description: Additional configuration for SEPA Direct Debit transactions
              properties:
                description:
                  type: string
                  description: The description of the payment to be displayed on the customer's statement
            bacsdd:
              type: object
              description: Additional configuration for BACS Direct Debit transactions
              properties:
                description:
                  type: string
                  description: The description of the payment to be displayed on the customer's bank statement
    SepaDirectDebitPaymentResponse:
      allOf:
        - $ref: '#/components/schemas/PaymentResponse'
        - type: object
          properties:
            details:
              type: object
              properties:
                transactionVariant:
                  type: string
                  description: Type of payment method used
                  enum:
                    - sepadd
                paymentReference:
                  type: string
                  description: Transaction identifier
                virtualIban:
                  type: string
                  description: Virtual IBAN assigned for this payment
                merchantName:
                  type: string
                  description: Name of the merchant
                responseMessage:
                  type: string
                  description: Response message from the payment processor
                errorCode:
                  type: string
                  description: Response code from the payment processor
                bankName:
                  type: string
                  description: Name of the bank
                bankCountry:
                  type: string
                  description: Country of the bank
    CapturePaymentRequest:
      type: object
      description: Request parameters for capturing a payment
      required:
        - transactionId
        - amount
      properties:
        transactionId:
          type: string
          description: ID of the transaction to be captured
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
        lineItems:
          type: array
          description: Details about the products sold or services provided
          items:
            $ref: '#/components/schemas/LineItem'
        isFinalCapture:
          type: boolean
          description: Will default to true if not provided.
          default: true
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Additional metadata to attach to this capture operation
    CardResponseDetails:
      type: object
      properties:
        transactionVariant:
          type: string
          enum:
            - card
        transactionChannel:
          type: string
        acquirerResponseCode:
          type: string
        acquirerResponseMessage:
          type: string
        authorizationCode:
          type: string
        paymentContractId:
          type: string
        card:
          type: object
          properties:
            bin:
              type: string
            lastFour:
              type: string
            expiryMonth:
              type: integer
            expiryYear:
              type: integer
            cardholderName:
              type: string
            brand:
              type: string
    SepaResponseDetails:
      type: object
      properties:
        transactionVariant:
          type: string
          enum:
            - sepa
        paymentReference:
          type: string
        virtualIban:
          type: string
        merchantName:
          type: string
        responseMessage:
          type: string
        errorCode:
          type: string
        bankName:
          type: string
        bankCountry:
          type: string
    OpenBankingResponseDetails:
      type: object
      properties:
        transactionVariant:
          type: string
          enum:
            - openbanking
        reference:
          type: string
        responseMessage:
          type: string
        errorCode:
          type: string
        paymentId:
          type: string
        expiration:
          type: string
        linkToken:
          type: string
        payee:
          type: string
        recipientId:
          type: string
        acquirerName:
          type: string
        acquirerAccountId:
          type: string
        redirectUrl:
          type: string
    IdealResponseDetails:
      type: object
      properties:
        transactionVariant:
          type: string
          enum:
            - ideal
        paymentId:
          type: string
        acquirerResponseCode:
          type: string
        reason:
          type: string
        url:
          type: string
        expiresAt:
          type: string
          format: date-time
    VippsResponseDetails:
      type: object
      properties:
        transactionVariant:
          type: string
          enum:
            - vipps
        paymentId:
          type: string
        acquirerResponseCode:
          type: string
        reason:
          type: string
        url:
          type: string
        expiresAt:
          type: string
          format: date-time
    TwintResponseDetails:
      type: object
      properties:
        transactionVariant:
          type: string
          enum:
            - twint
        paymentId:
          type: string
        acquirerResponseCode:
          type: string
        reason:
          type: string
        url:
          type: string
        expiresAt:
          type: string
          format: date-time
    CapturePaymentResponse:
      type: object
      description: Response from a capture payment request
      properties:
        id:
          type: string
          description: Transaction ID
        status:
          type: string
          description: Status of the capture operation
          enum:
            - INITIATED
        details:
          oneOf:
            - $ref: '#/components/schemas/CardResponseDetails'
            - $ref: '#/components/schemas/SepaResponseDetails'
            - $ref: '#/components/schemas/OpenBankingResponseDetails'
            - $ref: '#/components/schemas/IdealResponseDetails'
            - $ref: '#/components/schemas/VippsResponseDetails'
            - $ref: '#/components/schemas/TwintResponseDetails'
          description: Payment details
    CancelPaymentRequest:
      type: object
      description: Request parameters for canceling a payment
      required:
        - transactionId
        - amount
      properties:
        transactionId:
          type: string
          description: ID of the authorized transaction to cancel
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Additional metadata to attach to this cancel operation
      example:
        transactionId: 21210021c2855007efa2d657018
        amount: 1000
    CancelPaymentResponse:
      type: object
      description: Response from a cancel payment request
      properties:
        txId:
          type: string
          description: Original transaction ID
        cancelId:
          type: string
          description: ID of the cancel operation
        status:
          type: string
          description: Status of the cancellation
          enum:
            - CANCELLED
    RefundPaymentRequest:
      type: object
      description: Request parameters for refunding a payment
      required:
        - transactionId
        - amount
      properties:
        transactionId:
          type: string
          description: ID of the transaction to be refunded
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
        merchantReference:
          type: string
          description: A free-form reference to identify the refund in your system
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Additional metadata to attach to this refund operation
      example:
        transactionId: 21210021c2855007efa2d657018
        amount: 1000
        merchantReference: ORDER-12345
    RefundPaymentResponse:
      type: object
      description: Response from a refund payment request
      properties:
        txId:
          type: string
          description: Original transaction ID
        refundId:
          type: string
          description: ID of the refund operation
        status:
          type: string
          description: Status of the refund
          enum:
            - INITIATED
            - DECLINED
    TwintQrCodeRequest:
      type: object
      description: Request parameters for getting or creating a TWINT QR code
      required:
        - amount
        - operatingAccountId
        - merchantReference
      properties:
        amount:
          type: integer
          description: Amount of the payment as a numeric value including decimals. E.g. 1 CHF is expressed as 100
        operatingAccountId:
          type: string
          description: Operating Account ID linked to the QR-code to which the payments will be credited
        merchantReference:
          type: string
          description: Any internal reference of the merchant to uniquely identify a specific QR-code
    TwintQrCodeResponse:
      type: object
      description: Response from getting or creating a TWINT QR code
      properties:
        id:
          type: string
          description: Unique identifier for the QR code
        qr:
          type: string
          description: Base64 encoded QR code image
        url:
          type: string
          description: URL encoded within the QR code
    transactionStatus:
      type: string
      enum:
        - INITIATED
        - AUTHORIZED
        - DECLINED
        - SETTLED
        - SETTLED_EXTERNALLY
        - CLEARED
        - PAID_OUT
        - ERROR
        - POSSIBLE_FRAUD
        - EXPIRED
        - ZERO_AUTH
        - CANCELLED
        - ACCEPTED
        - COMPLETED
        - FAILED
        - TOPUP
      x-enum-descriptions:
        INITIATED: Transaction has been initiated but not yet processed
        AUTHORIZED: Transaction has been authorized by the payment processor
        DECLINED: Transaction was declined by the payment processor
        SETTLED: Transaction has been settled
        SETTLED_EXTERNALLY: Transaction has been settled externally
        CLEARED: Funds have been made available in the associated balance accounts
        PAID_OUT: Transaction has been paid out to the merchant
        ERROR: Transaction encountered an error
        POSSIBLE_FRAUD: Transaction flagged for possible fraud
        EXPIRED: Transaction has expired
        ZERO_AUTH: Zero amount authorization transaction
        CANCELLED: Transaction has been cancelled
        ACCEPTED: Transfer has been accepted
        COMPLETED: Transfer or clearing transaction has been completed and credited to a balance account
        FAILED: Transaction has failed
        TOPUP: Transaction amount has been credited to the balance account
      example: AUTHORIZED
    transactionVariant:
      type: string
      enum:
        - card
        - openbanking
        - sepa
        - sepadd
        - ideal
        - vipps
        - balanceaccount
        - twint
        - swift
      x-enum-descriptions:
        card: Card payment
        openbanking: Open Banking payment
        sepa: SEPA Credit Transfer
        sepadd: SEPA Direct Debit
        ideal: iDEAL payment
        vipps: Vipps payment
        balanceaccount: Balance account payment
        twint: Twint payment
        swift: Swift payment
      example: card
    transactionType:
      type: string
      enum:
        - AUTHORIZATION
        - AUTHORIZATION_ADJUSTMENT
        - CAPTURE
        - CANCEL
        - REFUND
        - DISPUTE
        - CHARGEBACK
        - CHARGEBACK_REVERSAL
        - PRE_ARBITRATION
        - ARBITRATION
        - PAYOUT_TRANSACTION
        - BALANCE_ACCOUNT_TRANSFER
        - CLEARING_TRANSACTION
      x-enum-descriptions:
        AUTHORIZATION: Initial authorization of funds
        AUTHORIZATION_ADJUSTMENT: Adjustment to an existing authorization
        CAPTURE: Capture of previously authorized funds
        CANCEL: Cancellation of a transaction
        REFUND: Refund of captured funds
        DISPUTE: Dispute initiated against a transaction
        CHARGEBACK: Chargeback initiated against a transaction
        CHARGEBACK_REVERSAL: Reversal of a chargeback
        PRE_ARBITRATION: Pre-arbitration stage of dispute resolution
        ARBITRATION: Arbitration stage of dispute resolution
        PAYOUT_TRANSACTION: Payout transaction
        BALANCE_ACCOUNT_TRANSFER: Transfer between balance accounts
        CLEARING_TRANSACTION: Clearing transaction
      example: AUTHORIZATION
    transactionChannel:
      type: string
      enum:
        - ECOM
        - POS
        - POS_EXTERNAL
      x-enum-descriptions:
        ECOM: E-commerce transaction
        POS: Point of sale transaction
        POS_EXTERNAL: External point of sale transaction
      example: ECOM
    merchantReference:
      type: string
      description: A free-form reference to identify the resource in your system
      example: client-ref-12345
    iban:
      type: string
      description: International Bank Account Number (IBAN)
      pattern: ^[A-Z]{2}[0-9]{2}[A-Z0-9]{4}[0-9]{7}([A-Z0-9]?){0,16}$
      example: NL91ABNA0417164300
    TransactionListItemResponse:
      type: object
      description: Transaction list item response
      properties:
        createdAt:
          $ref: '#/components/schemas/createdAt'
          description: When the transaction was created
        updatedAt:
          $ref: '#/components/schemas/createdAt'
          description: When the transaction was last updated
        id:
          $ref: '#/components/schemas/id'
          description: Unique identifier for the transaction
        checkoutId:
          $ref: '#/components/schemas/id'
          description: ID of the checkout that created this transaction
        initialTransactionId:
          $ref: '#/components/schemas/id'
          description: ID of the initial transaction
        status:
          $ref: '#/components/schemas/transactionStatus'
          description: Current status of the transaction
        channel:
          $ref: '#/components/schemas/transactionChannel'
          description: Channel used for the transaction
        type:
          $ref: '#/components/schemas/transactionType'
          description: Type of the most recent operation
        paymentMethod:
          $ref: '#/components/schemas/transactionVariant'
          description: Payment method used
        balanceAccountId:
          $ref: '#/components/schemas/id'
          description: Balance Account ID
        balanceAccountName:
          $ref: '#/components/schemas/name'
          description: Balance Account name
          example: Topup balance account
        balanceAccountTransactionType:
          $ref: '#/components/schemas/balanceAccountTransactionType'
          description: Type of balance account transaction
        operatingAccountId:
          $ref: '#/components/schemas/id'
          description: Operating account used to process the transaction
        merchantAccountId:
          $ref: '#/components/schemas/id'
          description: Merchant account where the operating account belongs to
        platformAccountId:
          $ref: '#/components/schemas/id'
          description: Platform account where the merchant account belongs to
        operatingAccountName:
          $ref: '#/components/schemas/name'
          example: Yonge and Dundass ABC
        merchantAccountName:
          $ref: '#/components/schemas/name'
          example: Toronto ABC
        platformAccountName:
          $ref: '#/components/schemas/name'
          example: Canada ABC
        merchantReference:
          $ref: '#/components/schemas/merchantReference'
          description: Merchant reference
        metadata:
          type: object
          description: Free-form key-value pairs specified for the transaction
        currencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Three-letter currency code
        latestAmount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Current transaction amount in minor units
        totalAuthorizedAmount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Total amount authorized
        totalCancelledAmount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Total amount cancelled
        totalCapturedAmount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Total amount captured
        totalRefundedAmount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Total amount refunded
        totalDisputedAmount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Total amount disputed
        shopperCountryCode:
          $ref: '#/components/schemas/countryCode'
          description: Country code of the customer
        accountHolderName:
          $ref: '#/components/schemas/name'
          description: Card holder name or account holder name from bank based transaction, such as iDEAL, Open Banking, Sepa, etc..
          example: Vince Carter
        accountNumber:
          $ref: '#/components/schemas/iban'
          description: Masked International Bank Account Number (IBAN)
        cardDetails:
          type: object
          description: Card information (sensitive data masked)
          properties:
            issuerName:
              type: string
              description: Name of the issuer
              example: Visa Inc.
            issuerCountryCode:
              $ref: '#/components/schemas/countryCode'
              description: Country code from issuing card
            lastFour:
              type: string
              description: Last four digits of the card
              example: '1111'
            bin:
              type: string
              description: Bank Identification Number (first 6 digits)
              example: '411111'
            walletType:
              $ref: '#/components/schemas/walletType'
              description: Wallet type, such as Apple Pay or Google Pay
            cardType:
              type: string
              description: Card type variant
              example: COMMERCIAL
            cardProduct:
              type: string
              description: Card product variant
              example: DEBIT
            region:
              type: string
              description: Card region variant
              example: DOMESTIC
            brand:
              type: string
              description: Card brand variant
              example: Visa
            subBrand:
              type: string
              description: Card sub brand variant
              example: Visa Signature
        declineCode:
          type: string
          description: Reason code for decline (when status is DECLINED)
          example: '05'
        declineMessage:
          type: string
          description: Reason code description for decline (when status is DECLINED)
          example: Do not honour - The transaction is declined with no specific reason.
        disputeCode:
          type: string
          description: Reason code for disputed transactions
          example: '4837'
        disputeMessage:
          type: string
          description: Dispute reason code description for disputed transactions
          example: No Cardholder Authorization
    RefundResponse:
      type: object
      description: Response for refund operations
      properties:
        refundId:
          $ref: '#/components/schemas/id'
          description: ID of the refund
        status:
          $ref: '#/components/schemas/transactionStatus'
          description: Current status of the refund
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Refund amount in minor units
        currencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Three-letter currency code
        txId:
          $ref: '#/components/schemas/id'
          description: ID of the original transaction
        createdAt:
          $ref: '#/components/schemas/createdAt'
          description: When the refund was created
        acquirer:
          type: string
          description: Payment processor handling the refund
        merchantReference:
          $ref: '#/components/schemas/merchantReference'
          description: Merchant reference
        metadata:
          type: object
          description: Free-form key-value pairs specified for the transaction
      example:
        refundId: 21210021c2855007efa2d657018
        status: INITIATED
        amount: 1000
        currencyCode: EUR
        txId: 21210021c2855007efa2d657019
        createdAt: '2024-01-15T10:30:00Z'
        acquirer: 21210021c2855007efa2d657020
    formattedAmount:
      type: string
      description: Formatted amount with decimals and currency symbol
      example: €100.00
    CommonTransactionDetailsResponse:
      type: object
      description: Common transaction details response
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Unique identifier for the transaction
        checkoutId:
          $ref: '#/components/schemas/id'
          description: ID of the checkout that created this transaction
        createdAt:
          $ref: '#/components/schemas/createdAt'
          description: When the transaction was created
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
          description: When the transaction was last updated
        accountId:
          $ref: '#/components/schemas/id'
          description: Operating account or Balance Account ID
        currencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Three-letter currency code
        latestStatus:
          $ref: '#/components/schemas/transactionStatus'
          description: Current status of the transaction
        latestTransactionType:
          $ref: '#/components/schemas/transactionType'
          description: Type of the most recent operation
        latestAmount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Current transaction amount in minor units
        formattedLatestAmount:
          $ref: '#/components/schemas/formattedAmount'
          description: Formatted current amount with currency symbol
        shopperCountryCode:
          $ref: '#/components/schemas/countryCode'
          description: Country code of the customer
        metadata:
          type: object
          description: Free-form key-value pairs specified for the transaction
    BalanceAccountDetails:
      type: object
      description: Balance account specific details for the transaction
      properties:
        topupBalanceAccountId:
          $ref: '#/components/schemas/id'
          description: ID of the topup balance account
        isMatched:
          type: boolean
          description: Whether the transaction is matched
        isAdvanceTopup:
          type: boolean
          description: Whether this is an advance topup
        balanceAccountTransactionType:
          $ref: '#/components/schemas/balanceAccountTransactionType'
          description: Type of balance account transaction
        releaseFunds:
          type: boolean
          description: Whether funds should be released
      example:
        topupBalanceAccountId: 21210021c2855007efa2d657020
        isMatched: true
        isAdvanceTopup: false
        balanceAccountTransactionType: TOPUP
        releaseFunds: true
    cardDetails:
      type: object
      description: Card details for user reporting (masked/redacted information)
      required:
        - lastFour
        - bin
        - expiryYear
      properties:
        lastFour:
          type: string
          description: Last 4 digits of card number
          example: '4242'
        cardFundingSource:
          type: string
          enum:
            - CREDIT
            - DEBIT
          x-enum-descriptions:
            CREDIT: Credit card
            DEBIT: Debit card
            PREPAID: Prepaid card
          description: Card funding source
          example: CREDIT
        bin:
          type: string
          description: First 6 digits of card number
          example: '424242'
        cardRegionType:
          type: string
          enum:
            - INTRAREGIONAL
            - INTERREGIONAL
            - DOMESTIC
          x-enum-descriptions:
            INTRAREGIONAL: Intra-regional card (European)
            INTERREGIONAL: Inter-regional card (International)
            DOMESTIC: Domestic card (Local)
          description: Region classification
          example: INTERREGIONAL
        expiryMonth:
          type: integer
          minimum: 1
          maximum: 12
          description: Card expiry month (1-12)
          example: 12
        expiryYear:
          type: integer
          description: Card expiry year
          example: 2025
        cardType:
          type: string
          enum:
            - CONSUMER
            - COMMERCIAL
          description: Type of card
          example: CONSUMER
        cardBrand:
          type: string
          description: Card brand (e.g. Mastercard)
          example: Visa
        cardSubBrand:
          type: string
          description: Specific card product (e.g. Gold Mastercard Card)
          example: Classic
        cardholderName:
          type: string
          description: Name of the cardholder
          example: John Doe
        cardIssuerName:
          type: string
          description: Name of the card issuing bank
      example:
        lastFour: '4242'
        cardFundingSource: CREDIT
        bin: '424242'
        cardRegionType: INTERREGIONAL
        expiryMonth: 12
        expiryYear: 2025
        cardType: CONSUMER
        cardBrand: Visa
        cardSubBrand: Classic
        cardholderName: John Doe
        cardIssuerName: Visa Inc.
    CardPaymentMethodResponseDetails:
      type: object
      description: Details about the card used for payment
      properties:
        cardDetails:
          $ref: '#/components/schemas/cardDetails'
        cardToken:
          type: string
          description: Tokenized card details
        captureWhen:
          $ref: '#/components/schemas/captureWhen'
        transactionType:
          $ref: '#/components/schemas/cardTransactionType'
        initialTransactionId:
          $ref: '#/components/schemas/id'
          description: ID of the initial transaction
        networkTransactionReference:
          type: string
          description: Reference of the transaction in the network
        authorizationType:
          $ref: '#/components/schemas/authorizationType'
        preAuthorizationType:
          $ref: '#/components/schemas/preAuthorizationType'
        maximumAuthorizationAmount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Maximum amount that can be authorized in minor units
        tokenCrypto:
          $ref: '#/components/schemas/tokenCrypto'
        tokenEci:
          $ref: '#/components/schemas/tokenEci'
        walletType:
          $ref: '#/components/schemas/walletType'
        dynamicDescriptor:
          $ref: '#/components/schemas/dynamicDescriptor'
      example:
        cardDetails:
          bin: '424242'
          lastFour: '4242'
          expiryMonth: 12
          expiryYear: 2025
          cardholderName: John Doe
          cardType: CONSUMER
          cardBrand: Visa
        captureWhen: INSTANT
        authorizationType: FINAL_AUTH
    OpenBankingPaymentMethodResponseDetails:
      type: object
      description: Details about the open banking payment method used
      properties:
        encryptedData:
          type: string
          description: Encrypted payment data from the bank
          example: encrypted_payment_data_12345
        linkToken:
          type: string
          description: Token for linking the payment to the bank
          example: link_token_67890
        acquirerAccountId:
          type: string
          description: ID of the acquiring bank account
          example: 21210021c2855007efa2d657020
        reference:
          type: string
          description: Payment reference from the bank
          example: bank_ref_12345
        paymentId:
          type: string
          description: Unique payment identifier from the bank
          example: payment_67890
        externalReference:
          type: string
          description: External reference provided by the merchant
          example: order-12345
        shopperName:
          type: string
          description: Name of the shopper as provided to the bank
          example: John Doe
        shopperIban:
          $ref: '#/components/schemas/iban'
          description: IBAN of the shopper's account
        debtorIban:
          $ref: '#/components/schemas/iban'
          description: IBAN of the debtor's account
        debtorName:
          type: string
          description: Name of the debtor
          example: John Doe
        redirectUrl:
          $ref: '#/components/schemas/URL'
          description: URL to redirect the customer after payment
      example:
        encryptedData: encrypted_payment_data_12345
        linkToken: link_token_67890
        acquirerAccountId: 21210021c2855007efa2d657020
        reference: bank_ref_12345
        paymentId: payment_67890
        externalReference: order-12345
        shopperName: John Doe
        shopperIban: NL91ABNA0417164300
        debtorIban: NL91ABNA0417164300
        debtorName: John Doe
        redirectUrl: https://example.com/payment/success
    SepaPaymentMethodResponseDetails:
      type: object
      description: Details about the SEPA payment method used
      properties:
        externalCustomerReference:
          type: string
          description: External reference provided by the customer
          example: customer-ref-12345
        merchantReference:
          type: string
          description: Reference provided by the merchant
          example: order-12345
        paymentReference:
          type: string
          description: Payment reference for the SEPA transfer
          example: sepa-ref-67890
        virtualIban:
          $ref: '#/components/schemas/iban'
          description: Virtual IBAN for the SEPA payment
        shopperIban:
          $ref: '#/components/schemas/iban'
          description: IBAN of the shopper's account
        shopperName:
          type: string
          description: Name of the shopper
          example: John Doe
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Payment amount in minor units
      example:
        externalCustomerReference: customer-ref-12345
        merchantReference: order-12345
        paymentReference: sepa-ref-67890
        virtualIban: NL91ABNA0417164300
        shopperIban: NL91ABNA0417164300
        shopperName: John Doe
        amount: 1000
    bic:
      type: string
      description: Bank Identifier Code (BIC/SWIFT)
      pattern: ^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$
      example: ABNANL2A
    SwiftPaymentMethodResponseDetails:
      type: object
      description: Details about the SWIFT payment method used
      properties:
        merchantReference:
          type: string
          description: Reference provided by the merchant
          example: order-12345
        paymentReference:
          type: string
          description: Payment reference for the SWIFT transfer
          example: swift-ref-67890
        virtualIban:
          $ref: '#/components/schemas/iban'
          description: Virtual IBAN for the SWIFT payment
        shopperIban:
          $ref: '#/components/schemas/iban'
          description: IBAN of the shopper's account
        shopperAccountNumber:
          type: string
          description: Shopper's bank account number
        shopperBIC:
          $ref: '#/components/schemas/bic'
          description: BIC of the shopper's bank
        shopperName:
          type: string
          description: Name of the shopper
          example: John Doe
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Payment amount in minor units
      example:
        merchantReference: order-12345
        paymentReference: swift-ref-67890
        shopperIban: NL91ABNA0417164300
        shopperBIC: ABNANL2A
        shopperName: John Doe
        amount: 1000
    firstName:
      type: string
      description: First name
      example: John
    lastName:
      type: string
      description: Last name
      example: Doe
    IdealPaymentMethodResponseDetails:
      type: object
      description: Details about the iDEAL payment method used
      properties:
        paymentId:
          type: string
          description: Unique payment identifier for the iDEAL transaction
          example: ideal_payment_12345
        paymentStatus:
          type: string
          enum:
            - PENDING
            - SUCCESS
            - FAILED
            - EXPIRED
          description: Current status of the iDEAL payment
          example: SUCCESS
        bic:
          $ref: '#/components/schemas/bic'
          description: Bank Identifier Code of the selected bank
        expirationDate:
          type: string
          format: date-time
          description: Expiration date and time of the iDEAL payment
          example: '2024-01-15T23:59:59Z'
        guaranteedAmount:
          type: string
          description: Amount guaranteed by the bank
          example: '1000'
        aspspPaymentId:
          type: string
          description: Payment ID from the Account Servicing Payment Service Provider
          example: aspsp_payment_67890
        debtorIban:
          $ref: '#/components/schemas/iban'
          description: IBAN of the debtor's account
        debtorName:
          type: string
          description: Full name of the debtor
          example: John Doe
        debtorFirstName:
          $ref: '#/components/schemas/firstName'
          description: First name of the debtor
        debtorLastName:
          $ref: '#/components/schemas/lastName'
          description: Last name of the debtor
        debtorPhoneNumber:
          $ref: '#/components/schemas/phoneNumber'
          description: Phone number of the debtor
        debtorEmail:
          $ref: '#/components/schemas/email'
          description: Email address of the debtor
        description:
          type: string
          description: Payment description shown to the customer
          example: 'Payment for order #12345'
        redirectUrl:
          $ref: '#/components/schemas/URL'
          description: URL to redirect the customer after payment
      example:
        paymentId: ideal_payment_12345
        paymentStatus: SUCCESS
        bic: ABNANL2A
        expirationDate: '2024-01-15T23:59:59Z'
        guaranteedAmount: '1000'
        aspspPaymentId: aspsp_payment_67890
        debtorIban: NL91ABNA0417164300
        debtorName: John Doe
        debtorFirstName: John
        debtorLastName: Doe
        debtorPhoneNumber: '+31612345678'
        debtorEmail: john.doe@example.com
        description: 'Payment for order #12345'
        redirectUrl: https://example.com/payment/success
    PaymentContractResponse:
      type: object
      description: Response from creating/retrieving a payment contract
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: The unique identifier of the payment contract.
        version:
          type: integer
          example: 1
          description: The version number of the payment contract.
        accountId:
          $ref: '#/components/schemas/id'
          description: The ID of the account this payment contract belongs to.
        paymentContractType:
          type: string
          description: The type of payment contract (e.g., RECURRING).
          enum:
            - RECURRING
            - UNSCHEDULED_CHARGE
          x-enum-descriptions:
            RECURRING: A recurring payment contract with a fixed amount and frequency.
            UNSCHEDULED_CHARGE: Unscheduled payments are similar to recurring, but they do not require a fixed amount or schedule.
        transactionVariant:
          type: string
          description: The type of transaction (e.g., sepadd).
          enum:
            - sepadd
        initialTransactionId:
          $ref: '#/components/schemas/id'
          description: The ID of the initial transaction (only for card payments).
        recurringDetails:
          type: object
          description: Details for recurring payments, if applicable.
          properties:
            amount:
              $ref: '#/components/schemas/amountWithCurrencyPrecision'
              description: The recurring payment amount.
            currencyCode:
              $ref: '#/components/schemas/paymentCurrencyCode'
              description: The currency code for the amount.
        paymentMethodDetails:
          type: object
          description: The payment method details.
          properties:
            card:
              type: object
              description: Card payment method details for payment contracts
              required:
                - cardToken
              properties:
                cardToken:
                  type: string
                  description: Tokenized card details
                  example: tok_1234567890
                networkTransactionReference:
                  type: string
                  description: Reference of the transaction in the network
                  example: net_ref_12345
              example:
                cardToken: tok_1234567890
                networkTransactionReference: net_ref_12345
            bacsdd:
              type: object
              description: BACS Direct Debit payment method details.
              properties:
                debitScheme:
                  type: string
                  description: Debit scheme for the mandate.
                  enum:
                    - BACS
                  default: BACS
                debtorDetails:
                  type: object
                  description: Details of the debtor (payer).
                  required:
                    - email
                    - address
                  properties:
                    email:
                      type: string
                      description: Email of the debtor.
                      example: john.doe@example.com
                    address:
                      type: object
                      description: Address of the debtor.
                      required:
                        - street
                        - city
                        - postalCode
                        - countryCode
                      properties:
                        street:
                          type: string
                          description: Street of the debtor's address.
                        city:
                          type: string
                          description: City of the debtor's address.
                        postalCode:
                          type: string
                          description: Postal code of the debtor's address.
                        countryCode:
                          type: string
                          description: Country code of the debtor's address.
                        stateOrProvince:
                          type: string
                          description: State or province of the debtor's address.
                    firstName:
                      type: string
                      description: First name of the debtor.
                    lastName:
                      type: string
                      description: Last name of the debtor.
                    companyName:
                      type: string
                      description: Company name of the debtor.
                      example: John Doe Ltd
                bankAccountDetails:
                  type: object
                  description: Details of the bank account.
                  required:
                    - accountNumber
                    - accountHolderName
                    - bankCode
                    - bankCodeType
                  properties:
                    accountNumber:
                      type: string
                      description: Account number of the debtor's bank account.
                    accountNumberType:
                      type: string
                      description: Type of the account number.
                      enum:
                        - IBAN
                        - UK_DOMESTIC
                    accountHolderName:
                      type: string
                      description: Name of the account holder.
                    bankName:
                      type: string
                      description: Name of the bank.
                    bankCode:
                      type: string
                      description: Code of the bank.
                    bankCodeType:
                      type: string
                      description: Type of the bank code.
                      enum:
                        - SORT_CODE
                        - BIC
                mandateReference:
                  type: string
                  description: Reference of the mandate.
                  example: SAKFJIOASDFKJASDF
            sepadd:
              type: object
              description: SEPA Direct Debit payment method details.
              properties:
                debitScheme:
                  type: string
                  description: The debit scheme used (e.g., SEPA_CORE).
                  enum:
                    - SEPA_CORE
                    - SEPA_B2B
                  x-enum-descriptions:
                    SEPA_CORE: SEPA Core scheme.
                    SEPA_B2B: SEPA B2B scheme - **requires debtor to submit mandate details to their bank**.
                debtorDetails:
                  type: object
                  description: The debtor's details.
                  properties:
                    name:
                      $ref: '#/components/schemas/name'
                      description: The debtor's name.
                      example: John Doe
                    iban:
                      $ref: '#/components/schemas/iban'
                      description: The debtor's IBAN.
                signatureDate:
                  type: string
                  format: date-time
                  example: '2021-01-01T00:00:00Z'
                  description: The date when the mandate was signed.
                mandateReference:
                  type: string
                  description: Reference of the mandate. For SepaDD, **must** be provided to the debtor and be submitted by the debtor to their bank to authorize the debit.
                  example: SAKFJIOASDFKJASDF
        notificationDetails:
          type: object
          required:
            - debtorName
            - lastFour
            - mandateReference
            - creditorIdentifier
            - creditorName
            - creditorAddress
            - creditorPostalCode
            - creditorCity
            - creditorCountry
          description: Details recommended to be included in notifications to shoppers for Direct Debit payments
          properties:
            creditorIdentifier:
              type: string
              const: NL78ZZZ865726790000
              description: The scheme identifier of the creditor which will appear in the shoppers bank. CID for SepaDD and SUN for BacsDD. For SepaDD, **must** be provided to the debtor and be submitted by the debtor to their bank to authorize the debit.
            creditorName:
              type: string
              const: Stichting Custodian Embed
              description: The name of the creditor which will appear in the shoppers bank. For SepaDD, **must** be provided to the debtor and be submitted by the debtor to their bank to authorize the debit.
            creditorAddress:
              type: string
              const: Meeuwenlaan 100
              description: The address of the creditor which will appear in the shoppers bank.
            creditorPostalCode:
              type: string
              const: 1021JL
              description: The postal code of the creditor which will appear in the shoppers bank.
            creditorCity:
              type: string
              const: Amsterdam
              description: The city of the creditor which will appear in the shoppers bank.
            creditorCountry:
              type: string
              const: Netherlands
              description: The country of the creditor which will appear in the shoppers bank.
            mandateReference:
              type: string
              example: SAKFJIOASDFKJASDF
              description: The reference of the mandate which will appear in the shoppers bank. For SepaDD, **must** be provided to the debtor and be submitted by the debtor to their bank to authorize the debit.
            debtorName:
              type: string
              example: John Doe
              description: The name of the debtor
            lastFour:
              type: string
              example: '1234'
              description: Last four characters of the debtor's account which will be debited.
        createdAt:
          type: string
          format: date-time
          description: The date and time when the payment contract was created.
        updatedAt:
          type: string
          format: date-time
          description: The date and time when the payment contract was last updated.
        file:
          type: object
          description: A pdf file of the mandate associated with the payment contract.
          properties:
            url:
              type: string
              format: uri
              description: The URL from which the file can be downloaded
            expiresAt:
              type: string
              format: date-time
              description: The date and time the download url expires (default is 60 minutes)
    SepaDDPaymentMethodResponseDetails:
      type: object
      description: Details about the SEPA Direct Debit payment method used
      properties:
        paymentContract:
          $ref: '#/components/schemas/PaymentContractResponse'
      example:
        paymentContract:
          id: 21210021c2855007efa2d657020
          version: 1
          accountId: 21210021c2855007efa2d657021
          paymentContractType: UNSCHEDULED_CHARGE
          transactionVariant: sepadd
          initialTransactionId: 21210021c2855007efa2d657022
          paymentMethodDetails:
            sepadd:
              debitScheme: SEPA_CORE
              debtorDetails:
                name: John Doe
                iban: NL91ABNA0417164300
              signatureDate: '2024-01-15'
          createdAt: '2024-01-15T10:30:00Z'
          updatedAt: '2024-01-15T10:35:00Z'
    VippsPaymentMethodResponseDetails:
      type: object
      description: Details about the Vipps payment method used
      properties:
        captureWhen:
          $ref: '#/components/schemas/captureWhen'
      example:
        captureWhen: INSTANT
    TwintPaymentMethodResponseDetails:
      type: object
      description: Details about the Twint payment method used
      properties:
        paymentId:
          type: string
          description: Unique Twint payment identifier
          example: twint_payment_12345
        returnUrl:
          type: string
          format: uri
          description: URL to return to after payment completion
          example: https://example.com/payment/return
        paymentUrl:
          type: string
          format: uri
          description: URL for the Twint payment page
          example: https://payment.twint.ch/pay/12345
        merchantUuid:
          type: string
          description: Unique identifier for the merchant in Twint system
          example: merchant_uuid_12345
        reference:
          type: string
          description: Payment reference for the Twint transaction
          example: twint_ref_67890
        terminalId:
          type: string
          description: Terminal identifier for the Twint payment
          example: terminal_12345
      example:
        paymentId: twint_payment_12345
        returnUrl: https://example.com/payment/return
        paymentUrl: https://payment.twint.ch/pay/12345
        merchantUuid: merchant_uuid_12345
        reference: twint_ref_67890
        terminalId: terminal_12345
    BalanceAccountMethodResponseDetails:
      type: object
      description: Details about the balance account transfer payment method
      required:
        - sourceBalanceAccountId
        - destinationBalanceAccountId
        - description
      properties:
        sourceBalanceAccountId:
          type: string
          description: ID of the source balance account
          example: 21210021c2855007efa2d657020
        destinationBalanceAccountId:
          type: string
          description: ID of the destination balance account
          example: 21210021c2855007efa2d657021
        description:
          type: string
          description: Description of the balance account transfer
          example: Transfer from operating account to settlement account
      example:
        sourceBalanceAccountId: 21210021c2855007efa2d657020
        destinationBalanceAccountId: 21210021c2855007efa2d657021
        description: Transfer from operating account to settlement account
    BalanceAccountPaymentMethodResponseDetails:
      type: object
      description: Details about the balance account payment method used
      required:
        - balanceAccountId
      properties:
        balanceAccountId:
          type: string
          description: ID of the balance account used for payment
          example: 21210021c2855007efa2d657020
        description:
          type: string
          description: Description of the balance account payment
          example: Payment from operating account
        expireAt:
          type: string
          format: date-time
          description: Expiration date and time for the payment
          example: '2024-01-22T10:30:00Z'
      example:
        balanceAccountId: 21210021c2855007efa2d657020
        description: Payment from operating account
        expireAt: '2024-01-22T10:30:00Z'
    BacsDDPaymentMethodResponseDetails:
      type: object
      description: Details about the BACS Direct Debit payment method used
      properties:
        paymentContract:
          $ref: '#/components/schemas/PaymentContractResponse'
      example:
        paymentContract:
          id: 21210021c2855007efa2d657020
          version: 1
          accountId: 21210021c2855007efa2d657021
          paymentContractType: UNSCHEDULED_CHARGE
          transactionVariant: bacsdd
          initialTransactionId: 21210021c2855007efa2d657022
          paymentMethodDetails:
            bacsdd:
              debitScheme: BACS
              debtorDetails:
                email: john.doe@example.com
                address:
                  street: 123 Main St
                  city: Anytown
                  postalCode: '12345'
                  countryCode: US
                firstName: John
                lastName: Doe
                companyName: John Doe Ltd
              bankAccountDetails:
                accountNumber: '1234567890'
                accountNumberType: UK_DOMESTIC
                accountHolderName: Queen Elizabeth
                bankName: Bank of the Queen
                bankCode: '123456'
                bankCodeType: SORT_CODE
              mandateReference: 9HZ37ST
          createdAt: '2024-01-15T10:30:00Z'
          updatedAt: '2024-01-15T10:35:00Z'
    paymentMethodResponseDetails:
      type: object
      description: Details specific to the payment method used
      oneOf:
        - type: object
          description: Card payment method details
          title: Card details
          properties:
            card:
              $ref: '#/components/schemas/CardPaymentMethodResponseDetails'
        - type: object
          title: Open Banking details
          properties:
            openBanking:
              $ref: '#/components/schemas/OpenBankingPaymentMethodResponseDetails'
        - type: object
          title: SEPA Credit Transfer details
          properties:
            sepa:
              $ref: '#/components/schemas/SepaPaymentMethodResponseDetails'
        - type: object
          title: SWIFT details
          properties:
            swift:
              $ref: '#/components/schemas/SwiftPaymentMethodResponseDetails'
        - type: object
          title: iDEAL details
          properties:
            ideal:
              $ref: '#/components/schemas/IdealPaymentMethodResponseDetails'
        - type: object
          title: SEPA Direct Debit details
          properties:
            sepadd:
              $ref: '#/components/schemas/SepaDDPaymentMethodResponseDetails'
        - type: object
          title: Vipps details
          properties:
            vipps:
              $ref: '#/components/schemas/VippsPaymentMethodResponseDetails'
        - type: object
          title: Twint details
          properties:
            twint:
              $ref: '#/components/schemas/TwintPaymentMethodResponseDetails'
        - type: object
          title: Balance account details
          properties:
            balanceAccount:
              $ref: '#/components/schemas/BalanceAccountMethodResponseDetails'
        - type: object
          title: Balance account payment details
          properties:
            balanceAccountPayment:
              $ref: '#/components/schemas/BalanceAccountPaymentMethodResponseDetails'
        - type: object
          title: BACS Direct Debit details
          properties:
            bacsdd:
              $ref: '#/components/schemas/BacsDDPaymentMethodResponseDetails'
    riskLevel:
      type: string
      enum:
        - LOW
        - MEDIUM
        - HIGH
      x-enum-descriptions:
        LOW: Low risk transaction
        MEDIUM: Medium risk transaction
        HIGH: High risk transaction
      description: Risk level assessment for fraud checking
      example: LOW
    triggeredRule:
      type: object
      description: A fraud rule that was triggered during transaction processing
      properties:
        id:
          type: string
          description: Unique identifier for the triggered rule
          example: rule_001
        name:
          type: string
          description: Human-readable name of the triggered rule
          example: Suspicious velocity check
      required:
        - id
    fraudCheckResult:
      type: object
      description: Result of fraud check performed on a transaction
      properties:
        riskLevel:
          $ref: '#/components/schemas/riskLevel'
          description: Risk level assessment for the transaction
        status:
          type: string
          enum:
            - DECLINED
            - APPROVED
          description: Fraud check status (only present for high-risk transactions)
          example: APPROVED
        triggeredRules:
          type: array
          description: List of fraud rules that were triggered
          items:
            $ref: '#/components/schemas/triggeredRule'
          example:
            - id: rule_001
              name: High velocity rule
        additionalData:
          type: object
          description: Additional fraud check data
      required:
        - riskLevel
        - triggeredRules
    fxRateSource:
      type: string
      enum:
        - MANUAL
        - AUTOMATIC
        - FIXED
      description: Source of the FX rate
      example: AUTOMATIC
      x-enum-descriptions:
        MANUAL: Manually entered FX rate
        AUTOMATIC: Automatically fetched FX rate
        FIXED: Fixed FX rate
    fxRate:
      type: object
      description: Foreign exchange rate information
      required:
        - id
        - sourceCurrency
        - targetCurrency
        - rate
        - activeFrom
        - snapshotId
        - source
        - pspSpread
        - createdAt
        - reversedRate
      properties:
        id:
          type: number
          description: Unique identifier for the FX rate
          example: 12345
        sourceCurrency:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Source currency code
        targetCurrency:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Target currency code
        rate:
          type: number
          description: Exchange rate from source to target currency
          example: 1.085
        activeFrom:
          type: string
          format: date-time
          description: Date and time when this rate becomes active
          example: '2024-01-15T10:30:00Z'
        snapshotId:
          type: number
          description: Snapshot identifier for this rate
          example: 67890
        source:
          $ref: '#/components/schemas/fxRateSource'
          description: Source of the FX rate
        pspSpread:
          type: number
          description: PSP spread applied to the rate
          example: 0.0025
        createdAt:
          type: string
          format: date-time
          description: Date and time when this rate was created
          example: '2024-01-15T10:30:00Z'
        reversedRate:
          type: number
          description: Reversed exchange rate (target to source)
          example: 0.9217
      example:
        id: 12345
        sourceCurrency: EUR
        targetCurrency: USD
        rate: 1.085
        activeFrom: '2024-01-15T10:30:00Z'
        snapshotId: 67890
        source: AUTOMATIC
        pspSpread: 0.0025
        createdAt: '2024-01-15T10:30:00Z'
        reversedRate: 0.9217
    TransactionEventDetails:
      type: object
      description: Transaction event details
      properties:
        fraudCheckResult:
          $ref: '#/components/schemas/fraudCheckResult'
          description: Fraud check result
        cardDetails:
          $ref: '#/components/schemas/cardDetails'
          description: Card details
        responseMessage:
          type: string
          description: Response message from payment processor
          example: Transaction approved
        responseCode:
          type: string
          description: Response code from payment processor
          example: '000'
        reasonCode:
          type: string
          description: Dispute reason code
          example: MD06
        reasonDescription:
          type: string
          description: Dispute reason description
          example: Return of funds requested by end customer
        settlementId:
          type: string
          description: Settlement ID
          example: settlement_12345
        txVariant:
          type: string
          description: Transaction variant
          example: card
        cardProduct:
          type: string
          description: Card product type
          example: Classic
        cardType:
          type: string
          description: Card type
          example: CONSUMER
        cardRegionType:
          type: string
          description: Card region type
          example: INTERREGIONAL
        initialTransactionId:
          type: string
          description: Initial transaction ID
          example: 21210021c2855007efa2d657018
        cardBrandCode:
          type: string
          description: Card brand code
          example: VI
        cardBrand:
          type: string
          description: Card brand
          example: Visa
        cardHolderCountry:
          type: string
          description: Card holder country
          example: NL
        acquirerFeeAmount:
          type: number
          description: Acquirer fee amount in minor units
          example: 25
        acquirerFeeDecimals:
          type: number
          description: Number of decimal places for acquirer fee
          example: 2
        acquirerFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for acquirer fee
        platformFeeAmount:
          type: number
          description: Platform fee amount in minor units (Platform only)
          example: 15
        platformFeeDecimals:
          type: number
          description: Number of decimal places for platform fee (Platform only)
          example: 2
        platformFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for platform fee (Platform only)
        platformFeeFormatted:
          type: string
          description: Formatted platform fee with currency symbol (Platform only)
          example: '-€0.15'
        platformPriceRecordId:
          type: string
          description: Platform price record ID
          example: '7'
        merchantNetAmount:
          type: number
          description: Merchant net amount in minor units
          example: 960
        merchantNetDecimals:
          type: number
          description: Number of decimal places for merchant net amount
          example: 2
        merchantNetCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for merchant net amount
        merchantNetAmountFormatted:
          type: string
          description: Formatted merchant net amount with currency symbol
          example: €9.60
        merchantNetFxFee:
          type: number
          description: Merchant net FX fee in minor units
          example: 5
        merchantNetFxFeeDecimals:
          type: number
          description: Number of decimal places for merchant net FX fee
          example: 2
        merchantNetFxFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for merchant net FX fee
        merchantNetFxFeeFormatted:
          type: string
          description: Formatted merchant net FX fee with currency symbol
          example: €0.05
        txNetAmountInPlatformCurrency:
          type: number
          description: Transaction net amount in platform currency in minor units
          example: 985
        txNetAmountInPlatformCurrencyDecimals:
          type: number
          description: Number of decimal places for transaction net amount in platform currency
          example: 2
        txNetAmountInPlatformPricingCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for transaction net amount in platform currency
        txNetAmountInPlatformCurrencyFormatted:
          type: string
          description: Formatted transaction net amount in platform currency with currency symbol
          example: €9.85
        txGrossAmountInPlatformCurrency:
          type: number
          description: Transaction gross amount in platform currency in minor units
          example: 1000
        txGrossAmountInPlatformCurrencyDecimals:
          type: number
          description: Number of decimal places for transaction gross amount in platform currency
          example: 2
        txGrossAmountInPlatformPricingCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for transaction gross amount in platform currency
        txGrossAmountInPlatformCurrencyFormatted:
          type: string
          description: Formatted transaction gross amount in platform currency with currency symbol
          example: €10.00
        txNetAmountInTransactionCurrency:
          type: number
          description: Transaction net amount in transaction currency in minor units
          example: 960
        txNetAmountInTransactionCurrencyDecimals:
          type: number
          description: Number of decimal places for transaction net amount in transaction currency
          example: 2
        txNetAmountInTransactionCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for transaction net amount in transaction currency
        txNetAmountInTransactionCurrencyFormatted:
          type: string
          description: Formatted transaction net amount in transaction currency with currency symbol
          example: €9.60
        txNetAmountBeforeFx:
          type: number
          description: Transaction net amount before FX in minor units
          example: 960
        txNetAmountBeforeFxDecimals:
          type: number
          description: Number of decimal places for transaction net amount before FX
          example: 2
        txNetAmountBeforeFxCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for transaction net amount before FX
        txNetAmountBeforeFxFormatted:
          type: string
          description: Formatted transaction net amount before FX with currency symbol
          example: €9.60
        pspToMerchantFxFeePricePercentageFee:
          type: number
          description: PSP to merchant FX fee price percentage fee (Platform only)
          example: 0.5
        splitPaymentCommissionAmount:
          type: number
          description: Split payment commission amount in minor units
          example: 10
        splitPaymentCommissionAmountDecimals:
          type: number
          description: Number of decimal places for split payment commission amount
          example: 2
        splitPaymentCommissionAmountCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for split payment commission amount
        splitPaymentCommissionFormatted:
          type: string
          description: Formatted split payment commission with currency symbol
          example: €0.10
        splitPaymentCommissionBeforeFx:
          type: number
          description: Split payment commission before FX in minor units
          example: 10
        splitPaymentCommissionBeforeFxDecimals:
          type: number
          description: Number of decimal places for split payment commission before FX
          example: 2
        splitPaymentCommissionBeforeFxCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for split payment commission before FX
        splitPaymentCommissionBeforeFxFormatted:
          type: string
          description: Formatted split payment commission before FX with currency symbol
          example: €0.10
        platformFeeGrossBeforeFxFee:
          type: number
          description: Platform fee gross before FX fee in minor units
          example: 15
        platformFeeGrossBeforeFxFeeDecimals:
          type: number
          description: Number of decimal places for platform fee gross before FX fee
          example: 2
        platformFeeGrossBeforeFxFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for platform fee gross before FX fee
        platformFeeGrossBeforeFxFeeFormatted:
          type: string
          description: Formatted platform fee gross before FX fee with currency symbol
          example: '-€0.15'
        pspGrossBeforeFxFee:
          type: number
          description: PSP gross before FX fee in minor units (Platform only)
          example: 25
        pspGrossBeforeFxFeeDecimals:
          type: number
          description: Number of decimal places for PSP gross before FX fee (Platform only)
          example: 2
        pspGrossBeforeFxFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for PSP gross before FX fee (Platform only)
        pspGrossBeforeFxFeeFormatted:
          type: string
          description: Formatted PSP gross before FX fee with currency symbol (Platform only)
          example: '-€0.25'
        pspMerchantFxFee:
          type: number
          description: PSP merchant FX fee in minor units (Platform only)
          example: 5
        pspMerchantFxFeeDecimals:
          type: number
          description: Number of decimal places for PSP merchant FX fee (Platform only)
          example: 2
        pspMerchantFxFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for PSP merchant FX fee (Platform only)
        pspMerchantFxFeeFormatted:
          type: string
          description: Formatted PSP merchant FX fee with currency symbol (Platform only)
          example: '-€0.05'
        pspPlatformFxFee:
          type: number
          description: PSP platform FX fee in minor units (Platform only)
          example: 3
        pspPlatformFxFeeDecimals:
          type: number
          description: Number of decimal places for PSP platform FX fee (Platform only)
          example: 2
        pspPlatformFxFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for PSP platform FX fee (Platform only)
        pspPlatformFxFeeFormatted:
          type: string
          description: Formatted PSP platform FX fee with currency symbol (Platform only)
          example: '-€0.03'
        platformNetFxFee:
          type: number
          description: Platform net FX fee in minor units (Platform only)
          example: 2
        platformNetFxFeeDecimals:
          type: number
          description: Number of decimal places for platform net FX fee (Platform only)
          example: 2
        platformNetFxFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for platform net FX fee (Platform only)
        platformNetFxFeeFormatted:
          type: string
          description: Formatted platform net FX fee with currency symbol (Platform only)
          example: €0.02
        platformFeeAfterFxFee:
          type: number
          description: Platform fee after FX fee in minor units
          example: 15
        platformFeeAfterFxFeeDecimals:
          type: number
          description: Number of decimal places for platform fee after FX fee
          example: 2
        platformFeeAfterFxFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for platform fee after FX fee
        platformFeeAfterFxFeeFormatted:
          type: string
          description: Formatted platform fee after FX fee with currency symbol
          example: '-€0.15'
        platformInterchangeFee:
          type: number
          description: Platform interchange fee in minor units (Platform/Merchant only)
          example: 5
        platformInterchangeFeeDecimals:
          type: number
          description: Number of decimal places for platform interchange fee (Platform/Merchant only)
          example: 2
        platformInterchangeFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for platform interchange fee (Platform/Merchant only)
        platformInterchangeFeeFormatted:
          type: string
          description: Formatted platform interchange fee with currency symbol (Platform/Merchant only)
          example: '-€0.05'
        platformSchemeFee:
          type: number
          description: Platform scheme fee in minor units (Platform/Merchant only)
          example: 3
        platformSchemeFeeDecimals:
          type: number
          description: Number of decimal places for platform scheme fee (Platform/Merchant only)
          example: 2
        platformSchemeFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for platform scheme fee (Platform/Merchant only)
        platformSchemeFeeFormatted:
          type: string
          description: Formatted platform scheme fee with currency symbol (Platform/Merchant only)
          example: '-€0.01'
        platformPricingModel:
          type: string
          description: Platform pricing model (Platform/Merchant only)
          example: INTERCHANGE_PLUS
        merchantFxFeePricePercentageFee:
          type: number
          description: Merchant FX fee price percentage fee
          example: 0.5
        fungPriceFixedFee:
          type: number
          description: Fung price fixed fee (Platform only)
          example: 10
        fungPricePercentageFee:
          type: number
          description: Fung price percentage fee (Platform only)
          example: 0.3
        fungFeeAmount:
          type: number
          description: Fung fee amount in minor units (Platform only)
          example: 13
        fungFeeDecimals:
          type: number
          description: Number of decimal places for fung fee (Platform only)
          example: 2
        fungFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for fung fee (Platform only)
        fungFeeFormatted:
          type: string
          description: Formatted fung fee with currency symbol (Platform only)
          example: '-€0.13'
        fungPriceRecordId:
          type: number
          description: Fung price record ID (Platform only)
          example: 456
        fungFeeAfterFx:
          type: number
          description: Fung fee after FX in minor units (Platform only)
          example: 13
        fungFeeAfterFxDecimals:
          type: number
          description: Number of decimal places for fung fee after FX (Platform only)
          example: 2
        fungFeeAfterFxCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for fung fee after FX (Platform only)
        fungFeeAfterFxFormatted:
          type: string
          description: Formatted fung fee after FX with currency symbol (Platform only)
          example: '-€0.13'
        platformPriceFixedFee:
          type: number
          description: Platform price fixed fee (Platform only)
          example: 5
        platformPricePercentageFee:
          type: number
          description: Platform price percentage fee (Platform only)
          example: 0.2
        platformNetFeeAmount:
          type: number
          description: Platform net fee amount in minor units (Platform only)
          example: 7
        platformNetFeeDecimals:
          type: number
          description: Number of decimal places for platform net fee amount (Platform only)
          example: 2
        platformNetFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for platform net fee amount (Platform only)
        platformNetFormatted:
          type: string
          description: Formatted platform net fee with currency symbol (Platform only)
          example: €0.07
        platformNetBeforeFx:
          type: number
          description: Platform net before FX in minor units (Platform only)
          example: 7
        platformNetBeforeFxDecimals:
          type: number
          description: Number of decimal places for platform net before FX (Platform only)
          example: 2
        platformNetBeforeFxCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for platform net before FX (Platform only)
        platformNetBeforeFxFormatted:
          type: string
          description: Formatted platform net before FX with currency symbol (Platform only)
          example: €0.07
        platformNetFxRate:
          $ref: '#/components/schemas/fxRate'
          description: Platform net FX rate (Platform only)
        txToPspPriceFxRate:
          $ref: '#/components/schemas/fxRate'
          description: Transaction to PSP price FX rate (Platform only)
        txToPlatformPriceFxRate:
          $ref: '#/components/schemas/fxRate'
          description: Transaction to platform price FX rate
        merchantNetFxRate:
          $ref: '#/components/schemas/fxRate'
          description: Merchant net FX rate
        splitPaymentCommissionFxRate:
          $ref: '#/components/schemas/fxRate'
          description: Split payment commission FX rate
        txGrossAmountInPspCurrency:
          type: number
          description: Transaction gross amount in PSP currency in minor units (Platform only)
          example: 1000
        txGrossAmountInPspCurrencyDecimals:
          type: number
          description: Number of decimal places for transaction gross amount in PSP currency (Platform only)
          example: 2
        txGrossAmountInPspCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for transaction gross amount in PSP currency (Platform only)
        txGrossAmountInPspCurrencyFormatted:
          type: string
          description: Formatted transaction gross amount in PSP currency with currency symbol (Platform only)
          example: €10.00
        platformFxFeePricePercentageFee:
          type: number
          description: Platform FX fee price percentage fee (Platform only)
          example: 0.1
        pspToMerchantFxFeePriceRecordId:
          type: number
          description: PSP to merchant FX fee price record ID (Platform only)
          example: 789
        pspInterchangeFee:
          type: number
          description: PSP interchange fee in minor units (Platform only)
          example: 8
        pspInterchangeFeeDecimals:
          type: number
          description: Number of decimal places for PSP interchange fee (Platform only)
          example: 2
        pspInterchangeFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for PSP interchange fee (Platform only)
        pspInterchangeFeeFormatted:
          type: string
          description: Formatted PSP interchange fee with currency symbol (Platform only)
          example: '-€0.08'
        pspSchemeFee:
          type: number
          description: PSP scheme fee in minor units (Platform only)
          example: 5
        pspSchemeFeeDecimals:
          type: number
          description: Number of decimal places for PSP scheme fee (Platform only)
          example: 2
        pspSchemeFeeCurrencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Currency code for PSP scheme fee (Platform only)
        pspSchemeFeeFormatted:
          type: string
          description: Formatted PSP scheme fee with currency symbol (Platform only)
          example: '-€0.05'
        pspPricingModel:
          type: string
          description: PSP pricing model (Platform only)
          example: INTERCHANGE_PLUS
    TransactionEvent:
      type: object
      description: Event representing a state change in the transaction
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Unique identifier for the event
        status:
          $ref: '#/components/schemas/transactionStatus'
        details:
          $ref: '#/components/schemas/TransactionEventDetails'
          description: Additional details specific to this event
        createdAt:
          $ref: '#/components/schemas/createdAt'
      example:
        id: 21210021c2855007efa2d657018
        status: AUTHORIZED
        details:
          responseMessage: Transaction approved
          responseCode: '000'
        createdAt: '2024-01-15T10:30:00Z'
    TransactionChild:
      type: object
      description: Child transaction representing a specific operation (auth, capture, etc)
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Unique identifier for this operation
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Amount in minor units
        currencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
          description: Three-letter currency code
        formattedAmount:
          $ref: '#/components/schemas/formattedAmount'
          description: Formatted amount with currency symbol
        transactionType:
          $ref: '#/components/schemas/transactionType'
          description: Type of operation
        transactionVariant:
          $ref: '#/components/schemas/transactionVariant'
          description: Payment method used
        transactionChannel:
          $ref: '#/components/schemas/transactionChannel'
          description: Channel used for the transaction
        merchantReference:
          $ref: '#/components/schemas/externalReference'
          description: Merchant's reference for this transaction
        acquirerAccountId:
          $ref: '#/components/schemas/id'
          description: ID of acquirer account used to process the transaction
        paymentMethodDetails:
          $ref: '#/components/schemas/paymentMethodResponseDetails'
          description: Payment method details
        events:
          type: array
          description: List of events for this operation
          items:
            $ref: '#/components/schemas/TransactionEvent'
        createdAt:
          $ref: '#/components/schemas/createdAt'
          description: When this operation was created
        metadata:
          type: object
          description: Free-form key-value pairs specified for the transaction
      example:
        id: 21210021c2855007efa2d657018
        amount: 1000
        currencyCode: EUR
        formattedAmount: €10.00
        transactionType: AUTHORIZATION
        transactionVariant: card
        merchantReference: order-12345
        createdAt: '2024-01-15T10:30:00Z'
    TransactionDetailsMerchantResponse:
      allOf:
        - $ref: '#/components/schemas/CommonTransactionDetailsResponse'
        - type: object
          description: Detailed transaction information including all operations and events
          properties:
            totalAuthAmount:
              $ref: '#/components/schemas/amountWithCurrencyPrecision'
              description: Total authorized amount in minor units
            expiresAt:
              $ref: '#/components/schemas/createdAt'
              description: Expiry time for the transaction. Defaults to 7 days after creation.
            balanceAccountDetails:
              $ref: '#/components/schemas/BalanceAccountDetails'
              description: Balance account specific details for the transaction
            children:
              type: array
              description: List of operations (auth, capture, etc)
              items:
                $ref: '#/components/schemas/TransactionChild'
    TransactionDetailsPlatformResponse:
      allOf:
        - $ref: '#/components/schemas/CommonTransactionDetailsResponse'
        - type: object
          description: Detailed transaction information including all operations and events
          properties:
            merchantAccountId:
              $ref: '#/components/schemas/id'
              description: Merchant account ID
            totalAuthAmount:
              $ref: '#/components/schemas/amountWithCurrencyPrecision'
              description: Total authorized amount in minor units
            expiresAt:
              $ref: '#/components/schemas/createdAt'
              description: Expiry time for the transaction. Defaults to 7 days after creation.
            balanceAccountDetails:
              $ref: '#/components/schemas/BalanceAccountDetails'
              description: Balance account specific details for the transaction
            children:
              type: array
              description: List of operations (auth, capture, etc)
              items:
                $ref: '#/components/schemas/TransactionChild'
      example:
        id: 21210021c2855007efa2d657018
        checkoutId: 21210021c2855007efa2d657019
        createdAt: '2024-01-15T10:30:00Z'
        updatedAt: '2024-01-15T10:35:00Z'
        currencyCode: EUR
        accountId: 21210021c2855007efa2d657020
        merchantAccountId: 21210021c2855007efa2d657021
        latestStatus: AUTHORIZED
        latestTransactionType: AUTHORIZATION
        latestAmount: 1000
        formattedLatestAmount: €10.00
        shopperCountryCode: NL
        totalAuthAmount: 1000
        expiresAt: '2024-01-22T10:30:00Z'
        children:
          - id: 21210021c2855007efa2d657028
            amount: 1000
            currencyCode: EUR
            formattedAmount: €10.00
            transactionType: AUTHORIZATION
            transactionVariant: card
            transactionChannel: ECOM
            merchantReference: order-12345
            acquirerAccountId: 21210021c2855007efa2d657029
            paymentMethodDetails:
              card:
                cardDetails:
                  bin: '424242'
                  lastFour: '4242'
                  expiryMonth: 12
                  expiryYear: 2025
                  cardholderName: John Doe
                  cardType: CONSUMER
                  cardBrand: Visa
                  cardSubBrand: Classic
                  cardRegionType: INTERREGIONAL
                  cardFundingSource: CREDIT
                cardToken: tok_1234567890
                captureWhen: INSTANT
                transactionType: FIRST_UNSCHEDULED
                authorizationType: FINAL_AUTH
                preAuthorizationType: STANDARD
                maximumAuthorizationAmount: 1000
                walletType: APPLE_PAY
                dynamicDescriptor: My Company
            events:
              - id: 21210021c2855007efa2d657030
                status: INITIATED
                details:
                  responseMessage: Transaction initiated
                  responseCode: '000'
                createdAt: '2024-01-15T10:30:00Z'
              - id: 21210021c2855007efa2d657031
                status: AUTHORIZED
                details:
                  responseMessage: Transaction approved
                  responseCode: '000'
                createdAt: '2024-01-15T10:31:00Z'
            createdAt: '2024-01-15T10:30:00Z'
    description:
      type: string
      description: Free-form text description of the resource to help identify it.
      example: My resource
    city:
      type: string
      description: The name of the city
      example: Amsterdam
    OperatingAccountCreateRequest:
      type: object
      required:
        - name
        - description
        - parentResourceId
      properties:
        name:
          $ref: '#/components/schemas/name'
        parentResourceId:
          $ref: '#/components/schemas/id'
          description: Merchant Account ID under which the Operating Account will be created.
        description:
          $ref: '#/components/schemas/description'
          description: Free-form text description of the Operating Account to help identify it.
        details:
          type: object
          description: Additional metadata about the Operating Account.
          properties:
            address:
              type: string
              description: Street address, zip code of the Operating Account.
            city:
              $ref: '#/components/schemas/city'
            countryCode:
              $ref: '#/components/schemas/countryCode'
              description: Country code of the Operating Account.
            mcc:
              $ref: '#/components/schemas/MCC'
              description: Merchant Category Code (MCC) of the Operating Account. You should use the MCC that best describes the business of the Operating Account. Find your MCC [here](/accept-payments/merchant-category-codes).
              deprecated: true
            websites:
              type: array
              items:
                $ref: '#/components/schemas/URL'
              description: List of websites associated with the Operating Account.
            userEmail:
              $ref: '#/components/schemas/email'
              description: Email that will be saved in your account details.
            subMerchantId:
              $ref: '#/components/schemas/id'
              description: Required for accounts processing iDEAL payments. Following compliance approval of the mcc and website address, a submerchant ID will be generated and can be saved here. More information on the iDEAL process can be found [here](/payment-methods/ideal).
    OperatingAccountResponse:
      allOf:
        - $ref: '#/components/schemas/OperatingAccountCreateRequest'
        - type: object
          required:
            - accountResourceId
            - createdAt
            - updatedAt
          properties:
            accountResourceId:
              $ref: '#/components/schemas/id'
              description: ID of the Operating Account
            createdAt:
              $ref: '#/components/schemas/createdAt'
              description: Date and time the Operating Account was created.
            updatedAt:
              $ref: '#/components/schemas/updatedAt'
              description: Date and time the Operating Account was last updated
    OperatingAccountUpdateRequest:
      type: object
      required:
        - accountResourceId
      properties:
        accountResourceId:
          $ref: '#/components/schemas/id'
          description: ID of the Operating Account to be updated.
        name:
          $ref: '#/components/schemas/name'
        description:
          $ref: '#/components/schemas/description'
        details:
          type: object
          description: Additional metadata about the Operating Account.
          properties:
            address:
              type: string
              description: Street address, zip code of the Operating Account.
            city:
              $ref: '#/components/schemas/city'
            countryCode:
              $ref: '#/components/schemas/countryCode'
              description: Country code of the Operating Account.
            mcc:
              $ref: '#/components/schemas/MCC'
              description: Merchant Category Code (MCC) of the Operating Account. You should use the MCC that best describes the business of the Operating Account. Find your MCC [here](/accept-payments/merchant-category-codes).
              deprecated: true
            websites:
              type: array
              items:
                $ref: '#/components/schemas/URL'
              description: List of websites associated with the Operating Account.
            userEmail:
              $ref: '#/components/schemas/email'
              description: Email that will be saved in your account details.
            subMerchantId:
              $ref: '#/components/schemas/id'
              description: Required for accounts processing iDEAL payments. Following compliance approval of the mcc and website address, a submerchant ID will be generated and can be saved here. More information on the iDEAL process can be found [here](/payment-methods/ideal).
    properties_User:
      type: object
      required:
        - email
        - account
      properties:
        email:
          $ref: '#/components/schemas/email'
        account:
          type: object
          required:
            - type
            - accountId
          properties:
            type:
              type: string
              description: The type of the account.
              enum:
                - OPERATOR
            accountId:
              $ref: '#/components/schemas/accountId'
              description: The ID of the account that the user belongs to.
        lastName:
          $ref: '#/components/schemas/lastName'
        firstName:
          $ref: '#/components/schemas/firstName'
      example:
        email: john.doe@example.com
        account:
          type: OPERATOR
          accountId: 21210021c2855007efa2d657018
        lastName: Doe
        firstName: John
    Role:
      type: object
      required:
        - role
        - description
      properties:
        role:
          description: The role of the user
          $ref: '#/components/schemas/credentialRole'
        description:
          type: string
          description: The description of the role
          example: Access to developer tools
    models_User:
      type: object
      required:
        - userResourceId
        - details
        - status
        - createdAt
        - role
      properties:
        userResourceId:
          description: The ID of the user
          $ref: '#/components/schemas/id'
        details:
          $ref: '#/components/schemas/properties_User'
        status:
          type: string
          description: The status of the user account
          $ref: '#/components/schemas/simpleStatus'
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the entity was created
          example: '2024-01-15T10:30:00Z'
        role:
          $ref: '#/components/schemas/Role'
    PaymentContractCreateRequest:
      type: object
      description: Request parameters for creating a payment contract
      required:
        - accountId
        - paymentContractType
        - transactionVariant
        - paymentMethodDetails
      properties:
        accountId:
          $ref: '#/components/schemas/id'
          description: Id of the merchant or operating account for which the payment contract is created. Must be a valid reference ID of type Account_Operating or Balance_Account.
        paymentContractType:
          type: string
          description: Type of payment contract.
          x-enum-descriptions:
            RECURRING: A recurring payment contract with a fixed amount and frequency.
            UNSCHEDULED_CHARGE: Unscheduled payments are similar to recurring, but they do not require a fixed amount or schedule.
          enum:
            - RECURRING
            - UNSCHEDULED_CHARGE
        transactionVariant:
          type: string
          description: Type of transaction.
          enum:
            - sepadd
            - bacsdd
        paymentMethodDetails:
          type: object
          description: Details of the payment method.
          properties:
            sepadd:
              type: object
              description: SEPA Direct Debit payment method details.
              properties:
                debitScheme:
                  type: string
                  description: Debit scheme for the mandate.
                  enum:
                    - SEPA_CORE
                    - SEPA_B2B
                  x-enum-descriptions:
                    SEPA_CORE: SEPA Core scheme.
                    SEPA_B2B: SEPA B2B scheme - **requires debtor to submit mandate details to their bank**.
                  default: SEPA_CORE
                debtorDetails:
                  type: object
                  description: Details of the debtor (payer).
                  required:
                    - name
                    - iban
                  properties:
                    name:
                      type: string
                      pattern: ^[a-zA-Z0-9/?:().',+ ]+$
                      maxLength: 35
                      description: Name of the debtor. (max 35 characters)
                      example: John Doe
                    iban:
                      $ref: '#/components/schemas/iban'
                      description: IBAN of the debtor's account. Must be a valid SEPA IBAN.
                    email:
                      type: string
                      description: Email of the debtor. If provided, Embed will send notification emails to the debtor.
                      example: john.doe@example.com
                signatureDate:
                  type: string
                  format: date-time
                  description: Date of mandate signature. Must be a date in the past.
        recurringDetails:
          type: object
          description: Required if paymentContractType is RECURRING.
          properties:
            amount:
              $ref: '#/components/schemas/amountWithCurrencyPrecision'
              description: Amount for recurring payments, every subsequent payment must use same amount.
            currencyCode:
              $ref: '#/components/schemas/paymentCurrencyCode'
      example:
        accountId: 21210021c2855007efa2d657018
        paymentContractType: UNSCHEDULED_CHARGE
        transactionVariant: sepadd
        paymentMethodDetails:
          sepadd:
            debitScheme: SEPA_CORE
            debtorDetails:
              name: John Doe
              iban: DE89370400440532013000
            signatureDate: '2021-01-01T00:00:00Z'
    SuspendPaymentContractRequest:
      type: object
      description: Request parameters for suspending a payment contract
      required:
        - paymentContractId
      properties:
        paymentContractId:
          $ref: '#/components/schemas/id'
          description: The ID of the payment contract to suspend.
    PaymentMethod:
      type: object
      description: Payment method configuration
      required:
        - transactionVariant
        - active
      properties:
        transactionVariant:
          $ref: '#/components/schemas/transactionVariant'
        active:
          type: boolean
          description: Whether the payment method is active or not
    ThreedsConfiguration:
      type: object
      description: 3DS Configuration
      properties:
        triggerType:
          type: string
          description: The trigger type of the 3DS transaction
          enum:
            - STATIC
          default: STATIC
    CardConfiguration:
      type: object
      description: Additional configuration for card transactions
      properties:
        authorizationType:
          $ref: '#/components/schemas/authorizationType'
        preAuthorizationType:
          $ref: '#/components/schemas/preAuthorizationType'
        maximumAuthAmounts:
          type: array
          description: Maximum authorization amounts per currency
          items:
            type: object
            properties:
              currencyCode:
                $ref: '#/components/schemas/paymentCurrencyCode'
                description: Currency code for the maximum amount
              amount:
                $ref: '#/components/schemas/amountWithCurrencyPrecision'
        threeds:
          $ref: '#/components/schemas/ThreedsConfiguration'
        wallets:
          type: array
          description: The type of wallets accepted
          items:
            $ref: '#/components/schemas/walletType'
        dynamicDescriptor:
          $ref: '#/components/schemas/dynamicDescriptor'
    ProfileDetails:
      type: object
      description: Configuration details of the profile
      required:
        - paymentMethods
      properties:
        paymentMethods:
          type: array
          description: List of payment methods available for the payment profile. A minimum of 1 payment method is required.
          items:
            $ref: '#/components/schemas/PaymentMethod'
        captureWhen:
          type: string
          description: The capture mode of the transaction
          enum:
            - MANUAL
            - INSTANT
          default: MANUAL
        paymentContractType:
          type: string
          description: The contract signed with a card tr ansaction
          enum:
            - ONE_OFF
            - RECURRING
            - UNSCHEDULED_CHARGE
          default: ONE_OFF
        cardConfiguration:
          $ref: '#/components/schemas/CardConfiguration'
    CreatePaymentProfileRequest:
      type: object
      description: Request parameters for creating a payment profile
      required:
        - accountId
        - name
        - description
        - profileDetails
      properties:
        accountId:
          $ref: '#/components/schemas/id'
          description: Account ID for which the payment profile should be created
        name:
          type: string
          description: Name of the payment profile, freeform text
        description:
          type: string
          description: Additional description of the Payment Profile
        profileDetails:
          $ref: '#/components/schemas/ProfileDetails'
    PaymentProfileResponse:
      type: object
      description: Response from creating/updating a payment profile
      properties:
        paymentProfileId:
          $ref: '#/components/schemas/id'
          description: ID of the payment profile
        accountId:
          $ref: '#/components/schemas/id'
          description: Account ID the profile belongs to
        name:
          type: string
          description: Name of the payment profile
        description:
          type: string
          description: Description of the payment profile
        version:
          type: integer
          description: Version number of the profile
        profileDetails:
          $ref: '#/components/schemas/ProfileDetails'
    UpdatePaymentProfileRequest:
      type: object
      description: Request parameters for updating a payment profile
      required:
        - currentVersion
        - paymentProfileId
      properties:
        currentVersion:
          type: integer
          description: The current version of the payment profile
        paymentProfileId:
          $ref: '#/components/schemas/id'
        profileDetails:
          $ref: '#/components/schemas/ProfileDetails'
        name:
          type: string
          description: Name of the payment profile
        description:
          type: string
          description: Description of the payment profile
    CheckoutRequest:
      type: object
      description: Request parameters for creating a new checkout
      required:
        - amount
        - currencyCode
        - accountId
      properties:
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
        currencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
        accountId:
          type: string
          description: Operating Account ID to which the payment will be credited
        paymentProfileId:
          type: string
          description: Reference to a payment profile specifying the payment methods which should be available on the Checkout and their configurations. Required if more than one payment profile exists.
        webhookUrl:
          type: string
          description: URL to which merchant will be notified once the checkout is completed. Overrides the webhook URL configured in the account settings.
          deprecated: true
        themeId:
          type: string
          description: Theme to be applied based on the branding that the merchant has configured. If there is only one theme, it can be omitted, resulting in the default theme being used.
        redirectUrl:
          type: string
          description: URL to which the customer should be sent after the payment. Any payment results will use this URL.
        expiresAt:
          type: string
          format: date-time
          description: Expiry time for the checkout. After this time, the checkout will no longer be available for payment. Defaults to 24h after creation.
        merchantReference:
          type: string
          description: A free-form reference from the merchant's system. Typically used to identify the checkout in the merchant's system.
        externalCustomerReference:
          type: string
          description: An identifier of the customer in the merchant's system. Used to associate the Checkout and corresponding payments created from the Checkout. Required for **SEPA** payments - this will ensure that your customer is given a virtual iban that is unique to them and will enable Fung to reconcile the payment.
        description:
          type: string
          description: A free-form reference to describe the checkout
        qr:
          type: boolean
          description: If set to true, checkout response will also contain base64 encoded QR code image source
        lineItems:
          type: array
          description: Details about the products sold or services provided
          items:
            $ref: '#/components/schemas/LineItem'
        recurringDetails:
          type: object
          description: Details required for recurring payments
          properties:
            amount:
              type: integer
              description: Amount of the recurring payment as a numeric value without decimal symbol. E.g. 1.00 EUR is expressed as 100
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Free-form key-value pairs to tag and correlate this checkout
    Checkout:
      type: object
      description: Checkout session for processing payments
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Unique identifier for the checkout session
        url:
          $ref: '#/components/schemas/URL'
          description: URL where the customer can complete the payment
        qr:
          type: string
          description: Base64 encoded QR code image for the checkout URL
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Metadata associated with this checkout
    CheckoutStatus:
      type: string
      description: Status of a checkout session
      enum:
        - CHECKOUT_INITIATED
        - CHECKOUT_COMPLETED
        - THREEDS_INITIATED
        - THREEDS_INPROGRESS
        - THREEDS_AUTHENTICATED
        - TX_INITIATED
        - TX_AUTHORIZED
        - TX_DECLINED
        - TX_ERROR
        - TX_POSSIBLE_FRAUD
      x-enum-descriptions:
        CHECKOUT_INITIATED: The checkout has been initiated
        CHECKOUT_COMPLETED: The checkout has been completed
        THREEDS_INITIATED: The 3DS authentication has been initiated
        THREEDS_INPROGRESS: The 3DS authentication is in progress
        THREEDS_AUTHENTICATED: The 3DS authentication has been authenticated
        TX_INITIATED: The transaction has been initiated
        TX_AUTHORIZED: The transaction has been authorized
        TX_DECLINED: The transaction has been declined
        TX_ERROR: The transaction has encountered an error
    InitiatePayoutForBalanceAccount:
      type: object
      required:
        - accountId
      properties:
        accountId:
          $ref: '#/components/schemas/accountId'
          description: ID of the balance account
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
          description: Integer amount of the payout in minor units (e.g. cents) specific to the currency. Leave empty for a full payout.
        currencyCode:
          $ref: '#/components/schemas/balanceCurrencyCode'
          description: Currency code for the payout, should be the same as the balance account currency code. Leave empty for a full payout.
        paymentReference:
          type: string
          description: Payment reference which must be provided by the customer for reconciliation. Only provided if explicit matching is required
          example: payment-ref-12345
        merchantReference:
          type: string
          description: Reference provided by the client to identify the payout
          example: client-ref-12345
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Free-form key-value pairs to tag and correlate this payment
    PayoutResponse:
      type: object
      required:
        - id
        - status
      properties:
        id:
          $ref: '#/components/schemas/id'
        status:
          type: string
          enum:
            - SETTLED
            - ERROR
          x-enum-descriptions:
            SETTLED: The payout has been created
            ERROR: The payout has encountered an error
          example: SETTLED
    HexColor:
      type: string
      pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
      example: '#000000'
      description: Hex color code
      format: hex-color
    ThemeDetails:
      type: object
      description: Details of the theme
      properties:
        brandColor:
          type: string
          $ref: '#/components/schemas/HexColor'
          description: Brand color of the theme
        accentColor:
          type: string
          $ref: '#/components/schemas/HexColor'
          description: Accent color of the theme
        brandColorContrast:
          type: string
          $ref: '#/components/schemas/HexColor'
          description: Brand color contrast of the theme
        accentColorContrast:
          type: string
          $ref: '#/components/schemas/HexColor'
          description: Accent color contrast of the theme
        backgroundColor:
          type: string
          $ref: '#/components/schemas/HexColor'
          description: Background color of the theme
        fontFamily:
          type: string
          description: Font family of the theme
          example: sans-serif
        textColor:
          type: string
          $ref: '#/components/schemas/HexColor'
          description: Text color of the theme
        errorTextColor:
          type: string
          $ref: '#/components/schemas/HexColor'
          description: Error text color of the theme
        borderRadius:
          type: string
          description: Border radius of the theme
          example: 4px
        logoUrl:
          type: string
          format: uri
          description: Logo URL of the theme
          example: https://example.com/logo.png
    ThemeCreateRequest:
      type: object
      description: Request parameters for creating a theme
      required:
        - accountId
        - name
        - details
      properties:
        accountId:
          $ref: '#/components/schemas/accountId'
          description: ID of the account to create the theme for
        name:
          $ref: '#/components/schemas/name'
          description: Name of the theme
          example: My Blue Theme
        description:
          type: string
          description: Description of the theme
        details:
          $ref: '#/components/schemas/ThemeDetails'
          description: Details of the theme
    ThemeResponse:
      type: object
      description: Response parameters for a theme
      required:
        - id
        - name
        - details
        - accountId
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: ID of the theme
        accountId:
          $ref: '#/components/schemas/accountId'
          description: ID of the account that the theme belongs to
        name:
          $ref: '#/components/schemas/name'
          description: Name of the theme
        details:
          $ref: '#/components/schemas/ThemeDetails'
          description: Details of the theme
    ThreedsCardDetails:
      type: object
      required:
        - cardNumber
        - expiryMonth
        - expiryYear
        - cardHolderName
        - cvc
      properties:
        cardNumber:
          type: string
          pattern: ^[0-9]{13,19}$
          description: Primary account number (PAN)
          example: '4111111111111111'
        expiryMonth:
          type: integer
          minimum: 1
          maximum: 12
          description: Card expiry month
          example: 12
        expiryYear:
          type: integer
          minimum: 2024
          maximum: 2099
          description: Card expiry year
          example: 2025
        cardHolderName:
          type: string
          maxLength: 50
          description: Name on the card
          example: John Doe
        cvc:
          type: string
          pattern: ^[0-9]{3,4}$
          description: Card verification code
          example: '123'
    ThreedsPayerDetails:
      type: object
      description: Customer information (optional, but recommended for better authentication rates)
      properties:
        email:
          $ref: '#/components/schemas/email'
        phone:
          $ref: '#/components/schemas/phoneNumber'
    ThreedsClientDetails:
      type: object
      required:
        - javaEnabled
        - javascriptEnabled
        - colorDepth
        - screenHeight
        - screenWidth
        - timezoneOffset
        - language
        - sourceIp
        - headers
        - redirectUrl
      description: Browser and client environment details required for 3DS
      properties:
        javaEnabled:
          type: boolean
          description: Whether Java is enabled in the browser
          example: true
        javascriptEnabled:
          type: boolean
          description: Whether JavaScript is enabled in the browser
          example: true
        colorDepth:
          type: integer
          description: Color depth of the screen in bits
          example: 24
        screenHeight:
          type: integer
          description: Screen height in pixels
          example: 1080
        screenWidth:
          type: integer
          description: Screen width in pixels
          example: 1920
        timezoneOffset:
          type: integer
          description: Timezone offset from UTC in minutes
          example: -120
        language:
          type: string
          description: Browser language preference
          example: en-US
        sourceIp:
          type: string
          format: ipv4
          description: Customer's IP address
          example: 192.168.1.1
        headers:
          type: object
          required:
            - accept
            - userAgent
          properties:
            accept:
              type: string
              description: HTTP Accept header value
              example: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
            userAgent:
              type: string
              description: HTTP User-Agent header value
              example: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
        redirectUrl:
          type: string
          format: uri
          description: URL to redirect to after 3DS completion (for challenge flow)
          example: https://your-checkout.com/3ds/complete
    StartThreedsRequest:
      type: object
      required:
        - amount
        - currencyCode
        - accountId
        - cardDetails
        - clientDetails
      properties:
        amount:
          $ref: '#/components/schemas/amountWithCurrencyPrecision'
        currencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
        merchantReference:
          type: string
          maxLength: 50
          description: Merchant's reference for the transaction
          example: ORDER-12345
        accountId:
          $ref: '#/components/schemas/accountId'
          description: Operating account identifier used to process the transaction
        cardDetails:
          $ref: '#/components/schemas/ThreedsCardDetails'
        payerDetails:
          $ref: '#/components/schemas/ThreedsPayerDetails'
        clientDetails:
          $ref: '#/components/schemas/ThreedsClientDetails'
    ThreedsResponse:
      type: object
      required:
        - id
        - status
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Unique identifier for the 3DS authentication session
        status:
          type: string
          enum:
            - AUTHENTICATED
            - DECLINED
            - INPROGRESS
            - CANCELLED
          x-enum-descriptions:
            AUTHENTICATED: Authentication completed successfully
            DECLINED: Authentication failed or was declined
            INPROGRESS: Authentication is still processing (continue polling)
            CANCELLED: Authentication was cancelled
          example: AUTHENTICATED
        details:
          type: object
          properties:
            threedsStatus:
              type: string
              description: 3DS status
              example: 'Y'
            threedsVersion:
              type: string
              description: 3DS protocol version used
              example: 2.1.0
            threedsData:
              type: string
              description: 3DS authentication data (only present when authenticated)
              example: 06:3030303030303030303030313130363639393458:none
            threedsEci:
              type: string
              description: 3DS ECI
              example: '00'
            threedsMethod:
              type: string
              description: URL for device fingerprinting (only when device fingerprint required)
              example: https://acs.bank.com/3ds-method
            threedsAcsUrl:
              type: string
              description: ACS URL
              example: https://acs.bank.com/challenge
            threedsAcsTransactionId:
              type: string
              description: ACS transaction ID
              example: '1234567890'
            threedsDstTransactionId:
              type: string
              description: DS transaction ID (only present when authenticated)
              example: eba202f3-4d38-406b-937a-2aa5805db607
            threedsTransactionId:
              type: string
              description: 3DS transaction identifier for tracking
              example: 8ac7a49a-8e5e-4c3b-9c2a-1e5f7b3d9c8a
            threedsNotificationUrl:
              type: string
              description: Internal notification URL (handled by Embed)
              example: https://apisbx.fungpayments.com/webhooks/3ds-notify
            threedsResult:
              type: string
              enum:
                - DEVICE_FINGERPRINT_REQUIRED
                - CHALLENGE_REQUIRED
                - DECLINED
                - AUTHENTICATED
                - SUCCESSFULL
                - NOT_AUTHENTICATED
                - FAILED
              x-enum-descriptions:
                DEVICE_FINGERPRINT_REQUIRED: Frictionless flow for the user, where a background check is performed on the users device with no user action
                CHALLENGE_REQUIRED: Challenge iFrame must be presented to the user
                DECLINED: Authentication failed or was declined
                AUTHENTICATED: Authentication completed successfully
                SUCCESSFULL: Authentication completed successfully
                NOT_AUTHENTICATED: Authentication not attempted
              description: Detailed result of the 3DS process
              example: AUTHENTICATED
    terminalModel:
      type: string
      enum:
        - PAYTER_APOLLO
        - PAYTER_APOLLO_MAX
      description: The model of the terminal
      example: PAYTER_APOLLO
      default: PAYTER_APOLLO
      x-enum-descriptions:
        PAYTER_APOLLO: The Payter Apollo terminal.
        PAYTER_APOLLO_MAX: The Payter Apollo Max terminal.
    terminalInitiationType:
      type: string
      enum:
        - API
        - EXTERNAL
      x-enum-descriptions:
        API: The terminal will be initiated via the API.
        EXTERNAL: The terminal will be initiated via an external system or via your own direct integration.
      description: The initiation type of the terminal
      example: API
    terminalAddress:
      type: object
      required:
        - streetAddress
        - zipCode
        - city
        - countryCode
      properties:
        streetAddress:
          type: string
          description: The street address of the terminal
          example: Example Street 123
        zipCode:
          type: string
          description: The zip code of the terminal
          example: 1234 AB
        city:
          type: string
          description: The city of the terminal
          example: Amsterdam
        countryCode:
          $ref: '#/components/schemas/countryCode'
    RegisterTerminalRequest:
      type: object
      required:
        - accountId
        - hardwareId
        - currencyCode
        - initiationType
        - address
      properties:
        accountId:
          $ref: '#/components/schemas/accountId'
        model:
          $ref: '#/components/schemas/terminalModel'
        hardwareId:
          type: string
          description: The serial number of the terminal
          example: PAY123456789
        description:
          type: string
          description: The description of the terminal
          example: Checkout Terminal 1
        currencyCode:
          $ref: '#/components/schemas/paymentCurrencyCode'
        initiationType:
          $ref: '#/components/schemas/terminalInitiationType'
        address:
          $ref: '#/components/schemas/terminalAddress'
        operatingAccountId:
          $ref: '#/components/schemas/accountId'
          description: The operating account under which the terminal will be registered. If not provided, a new operating account will be created for this terminal.
          example: 21210021c2855007efa2d657018
    terminalConnectionStatus:
      type: string
      enum:
        - ONLINE
        - OFFLINE
      x-enum-descriptions:
        ONLINE: The terminal is online and can be used.
        OFFLINE: The terminal is offline and cannot be used.
    TerminalResponse:
      allOf:
        - $ref: '#/components/schemas/base-entity'
        - type: object
          required:
            - model
            - hardwareId
            - description
            - currencyCodes
            - initiationType
            - address
            - operatingAccountId
            - connectionStatus
          properties:
            model:
              $ref: '#/components/schemas/accountId'
              description: The operating account under which the terminal will be registered. If not provided, a new operating account will be created for this terminal.
              example: 21210021c2855007efa2d657019
            connectionStatus:
              $ref: '#/components/schemas/terminalConnectionStatus'
              description: The connection status of the terminal
              example: ONLINE
            hardwareId:
              type: string
              description: The serial number of the terminal
              example: PAY123456789
            description:
              type: string
              description: The description of the terminal
              example: Checkout Terminal 1
            currencyCodes:
              type: array
              items:
                $ref: '#/components/schemas/paymentCurrencyCode'
              description: The currency codes of the terminal
              example:
                - EUR
            initiationType:
              $ref: '#/components/schemas/terminalInitiationType'
              description: The initiation type of the terminal
              example: API
            address:
              $ref: '#/components/schemas/terminalAddress'
              description: The address of the terminal
              example: Example Street 123
            operatingAccountId:
              $ref: '#/components/schemas/accountId'
              description: The operating account under which the terminal will be registered. If not provided, a new operating account will be created for this terminal.
              example: 21210021c2855007efa2d657019
            acquirerTerminalId:
              $ref: '#/components/schemas/id'
              description: The ID of the acquirer with whom the terminal is registered.
            config:
              type: object
              description: The configuration of the terminal
              example: {}
            terminalManagerId:
              $ref: '#/components/schemas/id'
              description: The ID of the terminal manager with whom the terminal is registered.
    NotificationBody:
      type: object
      description: Core content of the webhook notification
      required:
        - id
        - type
        - createdAt
        - isProduction
        - data
      properties:
        id:
          $ref: '#/components/schemas/id'
          description: Identifier of the notification body (equals notificationId)
        type:
          type: string
          description: Type of notification/event
          example: TRANSACTION.AUTHORIZATION.INITIATED
        createdAt:
          $ref: '#/components/schemas/createdAt'
        isProduction:
          type: boolean
          description: Indicates whether the notification originates from the production environment
          example: false
        data:
          type: object
          description: The business payload of the notification
    NotificationEventMetadata:
      type: object
      description: Metadata about the event that triggered the notification
      required:
        - source
        - detailType
        - timestamp
      properties:
        source:
          type: string
          description: Source that generated the event
          example: com.notification
        detailType:
          type: string
          description: Detail type of the event
          example: webhook
        timestamp:
          type: string
          format: date-time
          description: ISO-8601 timestamp indicating when the event occurred
          example: '2025-07-24T11:34:18Z'
    NotificationData:
      type: object
      description: Wrapper object combining the notification body, signature and event metadata
      required:
        - webhookId
        - body
        - eventMetadata
      properties:
        webhookId:
          $ref: '#/components/schemas/id'
          description: ID of the webhook configuration that generated this notification
        body:
          $ref: '#/components/schemas/NotificationBody'
        signature:
          type: string
          description: Cryptographic signature used to verify authenticity of the notification
        eventMetadata:
          $ref: '#/components/schemas/NotificationEventMetadata'
    Notification:
      type: object
      description: Webhook notification delivered to the platform
      required:
        - notificationId
        - accountId
        - notificationConfigId
        - resourceId
        - data
        - createdAt
        - type
        - ttl
      properties:
        notificationId:
          $ref: '#/components/schemas/id'
          description: Unique identifier of the notification
        accountId:
          $ref: '#/components/schemas/accountId'
        notificationConfigId:
          $ref: '#/components/schemas/id'
          description: ID of the webhook configuration that triggered this notification
        resourceId:
          $ref: '#/components/schemas/id'
          description: ID of the resource associated with the notification (for example a transaction ID)
        data:
          $ref: '#/components/schemas/NotificationData'
        createdAt:
          $ref: '#/components/schemas/createdAt'
        type:
          type: string
          description: Notification type. Mirrors the body.type field for convenience.
          example: TRANSACTION.AUTHORIZATION.INITIATED
        ttl:
          type: integer
          description: Unix epoch (seconds) after which the record expires in DynamoDB
          example: 1754220873
    NotificationPaginationMetadata:
      type: object
      description: Pagination metadata for notification list endpoints
      required:
        - pageSize
        - hasMoreItems
      properties:
        pageSize:
          type: integer
          description: Number of items requested/returned in this page
          example: 20
        hasMoreItems:
          type: boolean
          description: Whether more items are available after this page
          example: true
        lastKey:
          type: string
          description: Opaque cursor for pagination. Provide this value in the next request to retrieve the following page.
          example: eyJsYXN0SWQiOiIzMTIxMDI2MWJjYzMzMDExYzVkMTE0ZTIwMTMiLCJ0dGwiOiIxNzU0MjIwODczIn0=
    RetrieveNotificationsResponse:
      type: object
      required:
        - items
        - pagination
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Notification'
        pagination:
          $ref: '#/components/schemas/NotificationPaginationMetadata'
    reportType:
      type: string
      enum:
        - ACTIVITY
        - PAYOUT
      description: Type of the report
      example: ACTIVITY
    status:
      type: string
      enum:
        - PROCESSING
        - COMPLETED
      description: Current status of the report
      x-enum-descriptions:
        PROCESSING: The report is still being processed
        COMPLETED: The report has been completed and is available for download
      example: PROCESSING
    ReportParameters:
      type: object
      description: Parameters for creating reports
      properties:
        startDate:
          type: string
          format: date
          description: Start date for the report (required)
          example: '2024-01-01'
        endDate:
          type: string
          format: date
          description: End date for the report (required)
          example: '2024-01-31'
        accountId:
          type: string
          description: ID of the account to filter by (optional)
          example: 212100419d82e00e790f4e0f0c3
        reportView:
          type: string
          enum:
            - PLATFORM
            - MERCHANT
          description: View perspective for the report (optional); Defaults to `PLATFORM` for platform users and `MERCHANT` for merchant users
          example: MERCHANT
        transactionType:
          type: array
          items:
            type: string
            enum:
              - AUTHORIZATION
              - AUTHORIZATION_ADJUSTMENT
              - CAPTURE
              - CANCEL
              - REFUND
              - CHARGEBACK
              - PAYOUT_TRANSACTION
              - BALANCE_ACCOUNT_TRANSFER
          description: |
            List of transaction types to include in the report.
            Refer to the [Payment lifecycle](/core-concepts/payment-lifecycle) for reference on the possible transaction types.

            Defaults to all transaction types if not provided.
          example:
            - AUTHORIZATION
            - CAPTURE
        eventType:
          type: array
          items:
            type: string
            enum:
              - INITIATED
              - AUTHORIZED
              - SETTLED
              - SETTLED_EXTERNALLY
              - PAID_OUT
              - CLEARED
              - CLEARED_PLATFORM
              - DECLINED
              - CANCELLED
              - ERROR
              - COMPLETED
              - POSSIBLE_FRAUD
          description: |
            List of event types (transaction statuses) to include in the report.
            Refer to the [Payment lifecycle](/core-concepts/payment-lifecycle) for reference on the possible event types.

            Defaults to all event types if not provided.
          example:
            - AUTHORIZED
            - SETTLED
        currencyCode:
          type: array
          items:
            $ref: '#/components/schemas/paymentCurrencyCode'
          description: Transaction (gross amount) currencies to include in the report
          example:
            - EUR
            - CHF
      required:
        - startDate
        - endDate
    Report:
      type: object
      description: A report entity containing information about generated reports
      properties:
        id:
          $ref: '#/components/schemas/id'
        accountId:
          $ref: '#/components/schemas/accountId'
        reportType:
          $ref: '#/components/schemas/reportType'
        status:
          $ref: '#/components/schemas/status'
        parameters:
          $ref: '#/components/schemas/ReportParameters'
        createdAt:
          $ref: '#/components/schemas/createdAt'
      required:
        - id
        - accountId
        - reportType
        - status
        - createdAt
    CreateReportDto:
      type: object
      description: Request body for creating a report
      properties:
        reportType:
          type: string
          enum:
            - ACTIVITY
          description: Type of report to create (required)
          example: ACTIVITY
        parameters:
          $ref: '#/components/schemas/ReportParameters'
          description: Parameters for the report (required)
      required:
        - reportType
        - parameters
  responses:
    badRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/validationError'
          example:
            message: There is an error with the data provided in your request, please see details for more information
            details:
              error:
                - 'Invalid reference: 112101b178d86011ef5d596d016'
            statusCode: 400
            code: MALFORMED_PARAMETERS
            version: v1
            traceIds:
              traceId: 1-6876b3f7-3c06da5c11e798d539a9087e
    unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/unauthorizedError'
          example:
            Message: User is not authorized to access this resource with an explicit deny
    internalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/internalServerError'
          example:
            message: Your request has returned an error, please see details for more information
            details:
              error:
                - No error message provided
            statusCode: 500
            code: API_ERROR
            version: v1
            traceIds: {}
    notFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/notFoundError'
          example:
            message: The requested resource cannot be found, please see details for more information
            details:
              transactionError:
                - Transaction tree not found
            statusCode: 404
            code: NOT_FOUND
            version: v1
            traceIds:
              traceId: 1-6876b4f9-4dc428251214393b3d49412b
    forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/unauthorizedError'
          example:
            Message: User is not authorized to access this resource with an explicit deny
  parameters:
    accountId:
      name: accountId
      in: query
      required: false
      description: ID of the account to filter by
      schema:
        $ref: '#/components/schemas/accountId'
      example: 21210021c2855007efa2d657018
    verificationStatus:
      name: status
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/verificationStatus'
      example: VERIFIED
    limit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
      description: Number of items to return per page
      example: 20
    lastKey:
      name: lastKey
      in: query
      required: false
      schema:
        type: string
      description: Opaque cursor for pagination. Use the value from the previous response's pagination.lastKey to get the next page
      example: eyJsYXN0SWQiOiIyMTIxMDAyMWMyODU1MDA3ZWZhMmQ2NTcwMTgiLCJsYXN0Q3JlYXRlZEF0IjoiMjAyNC0wMS0xNVQxMDozMDowMFoifQ==
    fundingInstrumentIncludesQuery:
      name: include
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/fundingInstrumentIncludeOptions'
      description: Comma-separated list of additional objects to include in the response
      example: CHILDREN
    id:
      name: id
      in: path
      required: true
      description: ID of the resource
      schema:
        $ref: '#/components/schemas/id'
      example: 21210021c2855007efa2d657018
    payoutConfigIncludesQuery:
      name: include
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/payoutConfigIncludeOptions'
      description: Comma-separated list of additional objects to include in the response
      example: FUNDING_INSTRUMENT
    balanceAccountType:
      name: type
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/balanceAccountType'
    externalReference:
      name: externalReference
      in: query
      required: false
      description: External reference of the resource to filter by
      schema:
        $ref: '#/components/schemas/externalReference'
      example: REF-1234
    status:
      name: status
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/simpleStatus'
      example: ACTIVE
    balanceCurrencyCode:
      name: currencyCode
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/balanceCurrencyCode'
    balanceAccountListIncludesQuery:
      name: include
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/balanceAccountListIncludeOptions'
      description: Comma-separated list of additional objects to include in the response
      example: BALANCE,TOPUP_DETAILS
    balanceAccountIncludesQuery:
      name: include
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/balanceAccountIncludeOptions'
      description: Comma-separated list of additional objects to include in the response
      example: BALANCE,TOPUP_DETAILS
    startDate:
      name: startDate
      in: query
      required: false
      schema:
        type: string
        format: date
      example: '2024-01-01'
    endDate:
      name: endDate
      in: query
      required: false
      schema:
        type: string
        format: date
      example: '2024-12-31'
    balanceAccountTransactionIncludesQuery:
      name: include
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/balanceAccountTransactionIncludeOptions'
      description: Comma-separated list of additional objects to include in the response
      example:
        - PENDING_PAYMENTS
    transaction-list_accountId:
      name: accountId
      in: query
      required: false
      description: Comma-separated list of ID of the accounts to retrieve transactions for
      schema:
        type: array
        items:
          $ref: '#/components/schemas/accountId'
      example: 21210021c2855007efa2d657018,21210041c804101273c8ac990f7
    transaction-list_status:
      name: status
      in: query
      required: false
      schema:
        type: array
        items:
          $ref: '#/components/schemas/transactionStatus'
      description: Filter by transaction status
      example: AUTHORIZED,DECLINED
    paymentMethod:
      name: paymentMethod
      in: query
      required: false
      schema:
        type: array
        items:
          $ref: '#/components/schemas/transactionVariant'
      description: Filter by payment method
      example: card,ideal,openbanking
    type:
      name: type
      in: query
      required: false
      schema:
        type: array
        items:
          $ref: '#/components/schemas/transactionType'
      description: Filter by transaction type
      example: AUTHORIZATION,CAPTURE
    channel:
      name: channel
      in: query
      required: false
      schema:
        type: array
        items:
          $ref: '#/components/schemas/transactionChannel'
      description: Filter by transaction channel
      example: ECOM,POS
    currencyCode:
      name: currencyCode
      in: query
      required: false
      schema:
        type: array
        items:
          $ref: '#/components/schemas/paymentCurrencyCode'
      description: Filter by transaction currency code
      example: EUR,USD
    merchantReference:
      name: merchantReference
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/merchantReference'
        description: A free-form reference to identify the resource in your system
    transactionId:
      name: transactionId
      in: query
      required: false
      description: Filter by transaction ID
      schema:
        $ref: '#/components/schemas/id'
      example: 21210021c2855007efa2d657018
    lastFour:
      name: cardDetails.lastFour
      in: query
      required: false
      description: Filter by card last four
      schema:
        type: string
      example: '0036'
    bin:
      name: cardDetails.bin
      in: query
      required: false
      description: Filter by card BIN
      schema:
        type: string
      example: '401881'
    accountHolderName:
      name: accountHolderName
      in: query
      required: false
      description: Filter by account holder name
      schema:
        type: string
      example: jackie
    createdAtStartDate:
      name: createdAt.startDate
      description: Filter by start of created at
      in: query
      required: false
      schema:
        type: string
        format: date
      example: '2025-08-06'
    createdAtEndDate:
      name: createdAt.endDate
      description: Filter by end of created at
      in: query
      required: false
      schema:
        type: string
        format: date
      example: '2025-08-08'
    amountMin:
      name: amount.min
      in: query
      required: false
      description: Filter by minimum transaction amount
      schema:
        type: number
      example: 1000
    amountMax:
      name: amount.max
      in: query
      required: false
      description: Filter by maximum transaction amount
      schema:
        type: number
      example: 3000
    merchantAccountId:
      name: merchantAccountId
      in: path
      required: true
      description: ID of the merchant account to filter by
      schema:
        $ref: '#/components/schemas/accountId'
      example: 21210021c2855007efa2d657018
    notificationType:
      name: type
      in: query
      required: false
      description: Filter webhook notifications by event type
      schema:
        type: string
      example: PAYMENT_AUTHORIZED
    fromDate:
      name: from
      in: query
      required: false
      schema:
        type: string
        format: date
      description: Start date (inclusive) for resending notifications (YYYY-MM-DD)
      example: '2024-01-01'
    toDate:
      name: to
      in: query
      required: false
      schema:
        type: string
        format: date
      description: End date (inclusive) for resending notifications (YYYY-MM-DD)
      example: '2024-01-31'
x-tagGroups:
  - name: Account setup
    description: Create and manage balance accounts, operating accounts, and legal entities
    tags:
      - Merchant accounts
      - Capabilities
      - Balance accounts
      - Documents
      - Funding instruments
      - Legal entities
      - Operating accounts
      - Payment profiles
      - Terminals
      - Themes
  - name: Payments
    description: Transaction processing
    tags:
      - Checkouts
      - Payments
      - Payment contracts
      - Transaction reports
      - 3DS Authentication
  - name: Payouts
    description: Create and manage payouts
    tags:
      - Payout
      - Payout reports
  - name: Users and access
    description: Create and manage users and API keys
    tags:
      - API keys
      - Users
  - name: Reports
    description: Create and manage reports
    tags:
      - Reports
