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

# List All Transaction Activities

> This operation allows the client to fetch a paginated, aggregated feed of all
transaction activity for the authenticated business, optionally scoped to a
single account, with the same type-specific activityData as the account-scoped
activities endpoint.


Unified endpoint to fetch all transaction activities across the account and its sub-accounts.


## OpenAPI

````yaml GET /ledger/transaction-activities
openapi: 3.0.3
info:
  version: 3.0.2
  title: Onboard External API Gateway
  description: >-
    **Introduction**

    API Gateway for Onboard


    This specification describes API endpoints that are available to the public
    internet via the API gateway. The different endpoints require different
    authentication schemes, see documentation for what applies to the operation
    you want to access.


    **Errors**

    Uses conventional HTTP response codes to indicate success or failure. In

    general:
     
    - `2xx` status codes indicate success. Codes in the

    - `4xx` range

    indicate a client error (e.g. required parameters, failed request etc.).

    - `5xx` status codes indicate a server error occurred.
  contact:
    name: Nestcoin TechOps
    email: techops@nestcoin.com
  license:
    name: UNLICENSED
servers:
  - url: https://external.dev.onboardpay.co
    description: Gateway for external API on staging environment.
security: []
tags:
  - name: users-onboardapi
    description: Endpoints available to for merchants liquidity automation
  - name: users-users
    description: User related endpoints
  - name: users-partners
    description: Partner related endpoints
  - name: users-admin
    description: Back office related endpoints
  - name: users-user2fa
    description: User 2fa related endpoints
  - name: users-usernotifications
    description: User notifications related endpoints
  - name: users-merchantnetwork
    description: Merchant network endpoints
  - name: users-userauth
    description: Authentication endpoints
  - name: users-userservice
    description: Service endpoints
  - name: users-webhook
    description: webhook endpoints
  - name: users-config
    description: Configuration Endpoints
paths:
  /ledger/transaction-activities:
    get:
      tags:
        - ledger-account activity
      summary: Get transaction activities across the business
      description: >
        This operation allows the client to fetch a paginated, aggregated feed
        of all

        transaction activity for the authenticated business, optionally scoped
        to a

        single account, with the same type-specific activityData as the
        account-scoped

        activities endpoint.
      operationId: getTransactionActivities
      parameters:
        - $ref: '#/components/parameters/LedgerSvcanyAccountIdQuery'
        - name: type
          in: query
          description: Filter by activity type
          required: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/TransactionActivityType'
        - name: direction
          in: query
          description: Filter by activity direction
          required: false
          schema:
            $ref: '#/components/schemas/ActivityDirection'
        - name: startDate
          in: query
          description: Filter activities occurring on or after this date-time
          required: false
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          description: Filter activities occurring on or before this date-time
          required: false
          schema:
            type: string
            format: date-time
        - $ref: '#/components/parameters/LedgerSvcpage'
        - $ref: '#/components/parameters/LedgerSvcsize'
      responses:
        '200':
          description: Activities fetched successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionActivityList'
        '400':
          $ref: '#/components/responses/LedgerSvcInvalidRequest'
        '401':
          $ref: '#/components/responses/LedgerSvcUnauthorized'
        '403':
          $ref: '#/components/responses/LedgerSvcAccessDenied'
        default:
          $ref: '#/components/responses/LedgerSvcServerError'
      security:
        - HMACAuth: []
components:
  parameters:
    LedgerSvcanyAccountIdQuery:
      name: accountId
      description: Any account ID (could be Main account, sub-account or offramp account)
      required: false
      in: query
      schema:
        type: string
        format: uuid
    LedgerSvcpage:
      in: query
      name: page
      required: false
      description: Page parameter, starting from 1
      schema:
        type: integer
        minimum: 1
        default: 1
    LedgerSvcsize:
      in: query
      name: size
      required: false
      schema:
        type: integer
        maximum: 100
        minimum: 1
        default: 20
  schemas:
    TransactionActivityType:
      type: string
      description: Semantic category of a transaction activity feed entry.
      enum:
        - CASH_DEPOSIT
        - CASH_PAYMENT
        - ACCOUNT_NUMBER_DEPOSIT
        - CRYPTO_WITHDRAWAL
        - CRYPTO_DEPOSIT
        - INTERNAL_TRANSFER
        - OFFRAMP_DEPOSIT
      x-source-svc: ledger
    ActivityDirection:
      type: string
      enum:
        - CREDIT
        - DEBIT
      x-source-svc: ledger
    TransactionActivityList:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - type: object
          properties:
            content:
              type: array
              description: List of transaction activities
              items:
                $ref: '#/components/schemas/TransactionActivity'
      x-source-svc: ledger
    Paging:
      description: Base object for paginated list
      type: object
      properties:
        name:
          type: string
          description: Descriptive name for the list
        size:
          minimum: 0
          type: integer
          format: int32
          description: Positive integer
        totalItems:
          minimum: 0
          type: integer
          format: int32
          description: Positive integer
        nextPage:
          minimum: 0
          type: integer
          format: int32
          description: Positive integer
        previousPage:
          minimum: 0
          type: integer
          format: int32
          description: Positive integer
      discriminator:
        propertyName: name
      x-common-model: Paging
    TransactionActivity:
      type: object
      description: >
        A single entry in the aggregated account activity feed. The concrete
        subtype is

        determined by the activityType discriminator; the type field carries the

        semantic category for filtering and display.
      discriminator:
        propertyName: activityType
        mapping:
          CashDepositActivity:
            $ref: '#/components/schemas/CashDepositActivity'
          CashPaymentActivity:
            $ref: '#/components/schemas/CashPaymentActivity'
          AccountNumberDepositActivity:
            $ref: '#/components/schemas/AccountNumberDepositActivity'
          CryptoWithdrawalActivity:
            $ref: '#/components/schemas/CryptoWithdrawalActivity'
          CryptoDepositActivity:
            $ref: '#/components/schemas/CryptoDepositActivity'
          InternalTransferActivity:
            $ref: '#/components/schemas/InternalTransferActivity'
          OfframpDepositActivity:
            $ref: '#/components/schemas/OfframpDepositActivity'
      required:
        - id
        - activityType
        - type
        - direction
        - amount
        - currency
        - status
        - activityAt
        - accountId
        - accountType
      properties:
        id:
          type: string
          format: uuid
        activityType:
          type: string
          description: >
            Discriminator; the concrete activity model name, e.g.
            CashDepositActivity.
        type:
          $ref: '#/components/schemas/TransactionActivityType'
        direction:
          $ref: '#/components/schemas/ActivityDirection'
        amount:
          type: number
          description: Always positive; see direction for credit/debit.
          example: 100
        currency:
          type: string
          example: USD
        status:
          $ref: '#/components/schemas/TransactionStatus'
        reference:
          type: string
          description: Customer-facing reference of the source transaction.
        accountId:
          type: string
          format: uuid
        accountType:
          $ref: '#/components/schemas/ActivityAccountType'
        subAccountId:
          type: string
          format: uuid
          description: Set when accountType is SUB_ACCOUNT.
        accountTransactionId:
          type: string
          description: Identifier of the transaction on the ledger account, when available.
        groupId:
          type: string
          format: uuid
          description: |
            Links related activities together, e.g. the two legs of an internal
            transfer, or an offramp deposit and its refund.
        narration:
          type: string
        activityAt:
          type: string
          format: date-time
      x-source-svc: ledger
    ErrorMessageDto:
      description: >-
        Default error object for services. This gives consistent error object
        that all services may use.
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code
          example: UNKNOWN_ERROR
        message:
          type: string
          description: Descriptive error message
          example: Request could not be completed due to an error
        data:
          type: object
          description: Additional data for this error message.
          additionalProperties: true
          properties: {}
      x-common-model: ErrorMessageDto
    CashDepositActivity:
      allOf:
        - $ref: '#/components/schemas/TransactionActivity'
        - type: object
          required:
            - activityData
          properties:
            activityData:
              $ref: '#/components/schemas/CashDepositTransaction'
      x-source-svc: ledger
    CashPaymentActivity:
      allOf:
        - $ref: '#/components/schemas/TransactionActivity'
        - type: object
          required:
            - activityData
          properties:
            activityData:
              $ref: '#/components/schemas/CashPaymentTransaction'
      x-source-svc: ledger
    AccountNumberDepositActivity:
      allOf:
        - $ref: '#/components/schemas/TransactionActivity'
        - type: object
          required:
            - activityData
          properties:
            activityData:
              $ref: '#/components/schemas/AccountNumberDepositTransaction'
      x-source-svc: ledger
    CryptoWithdrawalActivity:
      allOf:
        - $ref: '#/components/schemas/TransactionActivity'
        - type: object
          required:
            - activityData
          properties:
            activityData:
              $ref: '#/components/schemas/AccountTransaction'
      x-source-svc: ledger
    CryptoDepositActivity:
      allOf:
        - $ref: '#/components/schemas/TransactionActivity'
        - type: object
          required:
            - activityData
          properties:
            activityData:
              $ref: '#/components/schemas/AccountTransaction'
      x-source-svc: ledger
    InternalTransferActivity:
      allOf:
        - $ref: '#/components/schemas/TransactionActivity'
        - type: object
          required:
            - activityData
          properties:
            activityData:
              $ref: '#/components/schemas/InternalTransfer'
      x-source-svc: ledger
    OfframpDepositActivity:
      allOf:
        - $ref: '#/components/schemas/TransactionActivity'
        - type: object
          required:
            - activityData
          properties:
            activityData:
              $ref: '#/components/schemas/OfframpAccountTransaction'
      x-source-svc: ledger
    TransactionStatus:
      type: string
      description: >
        Status of the transaction, indicating its current state in the
        processing lifecycle.

        - PENDING: The transaction has been created but not yet processed.

        - IN_PROGRESS: The transaction is currently being processed.

        - FAILED: The transaction processing has failed.

        - SUCCESS: The transaction has been successfully processed.
      enum:
        - PENDING
        - IN_PROGRESS
        - FAILED
        - SUCCESS
      x-source-svc: ledger
    ActivityAccountType:
      type: string
      description: The kind of account a transaction activity occurred on.
      enum:
        - MAIN
        - SUB_ACCOUNT
        - OFFRAMP_ACCOUNT
      x-source-svc: ledger
    CashDepositTransaction:
      type: object
      description: Details of a cash deposit transaction.
      required:
        - id
        - reference
        - currency
        - status
        - payinCurrency
        - amount
        - rate
        - payinAmount
        - createdDate
      properties:
        id:
          type: string
          format: uuid
        reference:
          type: string
          description: Reference for the cash deposit transaction at initiation.
        accountTransactionId:
          type: string
          description: Identifier of the credit transaction on the account.
        currency:
          type: string
          description: Currency in which the account was credited.
          example: USD
        status:
          $ref: '#/components/schemas/TransactionStatus'
        payinCurrency:
          type: string
          description: Currency the customer paid in.
          example: NGN
        amount:
          type: number
          description: Amount credited to the account.
          example: 100
        rate:
          type: number
          description: Exchange rate applied for this deposit.
          example: 1450.75
        payinAmount:
          type: number
          description: Amount the customer paid in, in the pay-in currency.
          example: 145075
        providerReference:
          type: string
          description: Reference provided by the cash deposit provider.
          example: PROV123456
        paymentDetails:
          $ref: '#/components/schemas/CashDepositPaymentDetails'
        createdDate:
          type: string
          format: date-time
      x-source-svc: ledger
    CashPaymentTransaction:
      type: object
      description: Details of a cash payment transaction.
      required:
        - id
        - reference
        - currency
        - status
        - payoutCurrency
        - amount
        - rate
        - payoutAmount
        - createdDate
        - recipient
      properties:
        id:
          type: string
          format: uuid
        reference:
          type: string
          description: Reference for the cash payment transaction at initiation.
        accountTransactionId:
          type: string
          description: Identifier of the transaction on the account.
        currency:
          type: string
          description: Currency in which the account was debited.
          example: USD
        status:
          $ref: '#/components/schemas/TransactionStatus'
        payoutCurrency:
          type: string
          description: Currency in which the beneficiary will be paid out.
          example: NGN
        amount:
          type: number
          description: Amount transferred.
          example: 100
        rate:
          type: number
          description: Exchange rate applied for this transfer.
          example: 1450.75
        payoutAmount:
          type: number
          description: Amount paid out to the beneficiary in payout currency.
          example: 145075
        providerReference:
          type: string
          description: Reference provided by the cash payment provider.
          example: PROV123456
        recipient:
          $ref: '#/components/schemas/BasicBeneficiaryInfo'
        createdDate:
          type: string
          format: date-time
      x-source-svc: ledger
    AccountNumberDepositTransaction:
      type: object
      description: >-
        Details of an account-number (virtual/bank account number) deposit
        transaction.
      required:
        - id
        - amount
        - currency
        - accountCurrency
        - status
        - createdDate
      properties:
        id:
          type: string
          format: uuid
        amount:
          type: number
          example: 100
          description: Amount deposited to the bank account number
        fee:
          type: number
          minimum: 0
          description: Fee charged in account number currency (currency field)
        currency:
          description: >-
            The account number currency/currency for the amount that was
            deposited.
          type: string
          example: NGN
        accountCurrency:
          type: string
          description: The currency of the account that owns the account number
          example: USD
        status:
          allOf:
            - $ref: '#/components/schemas/TransactionStatus'
            - description: Status of the deposit transaction
        senderAccountDetails:
          $ref: '#/components/schemas/CashAccountDetails'
        settlementAmount:
          type: number
          description: The final settlement amount in the same currency as accountCurrency
        settlementExchangeRate:
          type: number
          description: Exchange rate from the deposited currency to the account currency
        accountTransactionId:
          type: string
          description: Transaction ID on the ledger, only available when status is SUCCESS
        createdDate:
          type: string
          format: date-time
      x-source-svc: ledger
    AccountTransaction:
      type: object
      additionalProperties: false
      required:
        - id
        - reference
        - type
        - amount
        - currency
        - status
        - createdDate
      properties:
        id:
          type: string
          description: Unique transaction ID
          example: txn_123456
        reference:
          type: string
          description: Unique transaction reference.
          example: REF123456
        type:
          $ref: '#/components/schemas/TransactionType'
        amount:
          type: number
          description: Transaction amount, negative for debits, positive for credits
          example: 100
        currency:
          type: string
          description: Transaction currency
          example: USD
        status:
          $ref: '#/components/schemas/TransactionStatus'
        categoryTag:
          type: string
          description: Category tag for the transaction
          example: crypto-withdrawal
        createdDate:
          type: string
          format: date-time
          description: Transaction creation date
        notes:
          type: string
          description: Transaction description
          example: Conversion from USDC to IDR
        accountId:
          type: string
          format: uuid
          description: Associated account ID
        feeAmount:
          type: number
          description: Fee amount associated with the transaction
          example: 1
        feeInclusive:
          type: boolean
          description: Indicates if the fee is inclusive in the transaction amount
        subAccountId:
          type: string
          format: uuid
          description: Associated sub-account ID, if applicable
        blockchainInfo:
          $ref: '#/components/schemas/TransactionBlockchainInfo'
      x-source-svc: ledger
    InternalTransfer:
      type: object
      additionalProperties: false
      required:
        - reference
        - sourceAccountId
        - destinationAccountId
        - amount
        - currency
        - status
        - createdDate
      properties:
        reference:
          type: string
          description: Transfer reference
          example: ITR123456
        sourceAccountId:
          type: string
          format: uuid
          description: Source account ID
        sourceAccountRef:
          type: string
          description: The transaction reference on the source account.
        destinationAccountId:
          type: string
          format: uuid
          description: Destination account ID
        destinationAccountRef:
          type: string
          description: The transaction reference on the destination account.
        amount:
          type: number
          description: Transfer amount
          example: 100
        currency:
          type: string
          description: Transfer currency
          example: USD
        status:
          $ref: '#/components/schemas/TransactionStatus'
        createdDate:
          type: string
          format: date-time
          description: Transfer creation date
        description:
          type: string
          description: Transfer description
      x-source-svc: ledger
    OfframpAccountTransaction:
      allOf:
        - $ref: '#/components/schemas/CashPaymentTransaction'
        - type: object
          description: Details of an offramp account transaction.
          properties:
            offrampAccountId:
              type: string
              format: uuid
              description: >-
                Identifier of the offramp account associated with this
                transaction.
            blockchainInfo:
              $ref: '#/components/schemas/TransactionBlockchainInfo'
      x-source-svc: ledger
    CashDepositPaymentDetails:
      type: object
      description: >
        Destination account details the customer must pay into to fund the
        deposit. Mirrors a Beneficiary

        (without an id). Carries only the account details needed to make the
        payment; transaction context

        (amount, status, etc.) lives on the enclosing CashDepositTransaction.


        `details` can be nullable when the account number provider is still
        generating it
      required:
        - payinCurrency
      properties:
        details:
          $ref: '#/components/schemas/CashAccountDetails'
        payinCurrency:
          type: string
          description: Currency the destination account accepts for the deposit.
          example: NGN
      x-source-svc: ledger
    BasicBeneficiaryInfo:
      type: object
      description: Basic information about a beneficiary as at the time of transaction.
      required:
        - id
        - accountName
        - beneficiaryType
        - accountIdentifier
        - paymentChannelId
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the beneficiary.
        accountName:
          type: string
          description: Name on the account
          example: John Doe
        beneficiaryType:
          type: string
          description: Type of beneficiary object.
          example: BeneficiaryLocalBankAccount
        bankName:
          type: string
          description: >
            Name of the receiving bank, for mobile money this would be the
            network, and for P2P wallet it will be the name of the account
            provider
          example: Great Bank LLC
        accountIdentifier:
          type: string
          description: >
            The account identifier at the bank. For mobile money, this is the
            phone number on account, for P2P wallet, this is the account ID

            Where routing number or sort code is present, this would be
            `{routingNumber}-{accountNumber}`
          example: '230101010'
        paymentChannelId:
          type: string
          description: >-
            Identifier of the payment channel used for this transaction, if
            available. This can be used to determine the exact payment method
            used for the transaction.
          example: BANK_TRANSFER_NIGERIA
        country:
          type: string
          description: Country where the payment method belongs if available
          example: IE
      x-source-svc: ledger
    CashAccountDetails:
      type: object
      required:
        - accountInfoType
        - accountName
        - accountNumber
      properties:
        accountInfoType:
          type: string
          pattern: >-
            ^Cash(LocalBank|SepaBank|ACHBank|SwiftBank|MobileWallet|MultiRailBank)Account$
          description: |
            Used to determine the exact schema type.
            Allowed values:
            - CashLocalBankAccount
            - CashSepaBankAccount
            - CashACHBankAccount
            - CashSwiftBankAccount
            - CashMobileWalletAccount
            - CashMultiRailBankAccount
        accountName:
          type: string
          description: Name on the destination account.
          example: John Doe
        accountNumber:
          type: string
          description: >
            The destination account identifier. For mobile money this is the
            phone number, for P2P wallet the account ID.

            Where routing number or sort code is present, this would be
            `{routingNumber}-{accountNumber}`.
          example: '230101010'
        reference:
          type: string
          description: >
            Reference the customer must include with the deposit so the pay-in
            is auto-matched.

            Optional — some providers do not require one.
          example: PROV123456
      discriminator:
        propertyName: accountInfoType
        mapping:
          CashLocalBankAccount:
            $ref: '#/components/schemas/CashLocalBankAccount'
          CashSepaBankAccount:
            $ref: '#/components/schemas/CashSepaBankAccount'
          CashACHBankAccount:
            $ref: '#/components/schemas/CashACHBankAccount'
          CashSwiftBankAccount:
            $ref: '#/components/schemas/CashSwiftBankAccount'
          CashMobileWalletAccount:
            $ref: '#/components/schemas/CashMobileWalletAccount'
          CashMultiRailBankAccount:
            $ref: '#/components/schemas/CashMultiRailBankAccount'
      x-source-svc: ledger
    TransactionType:
      type: string
      enum:
        - DEPOSIT
        - WITHDRAWAL
        - TRANSFER
      x-source-svc: ledger
    TransactionBlockchainInfo:
      type: object
      description: Blockchain transaction data, present on Crypto-backed transactions.
      required:
        - txHash
        - recipient
        - value
        - tokenSymbol
      properties:
        txHash:
          type: string
          description: Blockchain Transaction Hash
          example: '0x093a0b443d5f698d1097368c1c05fab1ee2304e508b36c08bb72c40389c17584'
        recipient:
          $ref: '#/components/schemas/TransactionBlockchainAddress'
        senderAddress:
          type: string
          description: The address of the sender.
          example: '0x2b059a574a35e60b228d10d54fec2671de4928e1'
        value:
          type: number
          example: '100.01'
          minimum: 0
          description: Quantity of tokens transferred in the transaction.
          default: '0.0'
        blockNumber:
          type: integer
          format: int64
          example: 20564802
        tokenSymbol:
          example: USDT
          description: Token symbol
          type: string
        timestamp:
          type: integer
          format: int64
          description: Transaction block timestamp.
        explorerUrl:
          type: string
          format: url
          description: URL to view the transaction on a blockchain explorer.
      x-source-svc: ledger
    CashLocalBankAccount:
      allOf:
        - $ref: '#/components/schemas/CashAccountDetails'
        - $ref: '#/components/schemas/BaseLocalBankAccount'
      x-source-svc: ledger
    CashSepaBankAccount:
      allOf:
        - $ref: '#/components/schemas/CashAccountDetails'
        - $ref: '#/components/schemas/BaseSepaBankAccount'
      x-source-svc: ledger
    CashACHBankAccount:
      allOf:
        - $ref: '#/components/schemas/CashAccountDetails'
        - $ref: '#/components/schemas/BaseACHBankAccount'
      x-source-svc: ledger
    CashSwiftBankAccount:
      allOf:
        - $ref: '#/components/schemas/CashAccountDetails'
        - $ref: '#/components/schemas/BaseSwiftBankAccount'
      x-source-svc: ledger
    CashMobileWalletAccount:
      allOf:
        - $ref: '#/components/schemas/CashAccountDetails'
        - $ref: '#/components/schemas/BaseMobileWalletAccount'
      x-source-svc: ledger
    CashMultiRailBankAccount:
      allOf:
        - $ref: '#/components/schemas/CashAccountDetails'
        - $ref: '#/components/schemas/BaseMultiRailBankAccount'
      x-source-svc: ledger
    TransactionBlockchainAddress:
      type: object
      description: Address data
      required:
        - address
      properties:
        address:
          type: string
          description: Blockchain address where deposit was received.
          example: '0x2b059a574a35e60b228d10d54fec2671de4928e1'
        memo:
          type: string
          description: Memo for blockchains where memo is required.
          example: '1290122112'
      x-source-svc: ledger
    BaseLocalBankAccount:
      description: Details for local bank accounts
      type: object
      required:
        - bankCode
      properties:
        bankName:
          description: Beneficiary bank name
          type: string
        bankCode:
          description: Beneficiary bank code
          type: string
          minLength: 3
          maxLength: 12
        bankAddress:
          $ref: '#/components/schemas/PhysicalAddress'
      x-source-svc: ledger
    BaseSepaBankAccount:
      description: Details for SEPA accounts
      type: object
      required:
        - country
      properties:
        country:
          description: Beneficiary country ISO code
          type: string
          minLength: 2
          maxLength: 2
        bic:
          description: >
            Providing a BIC alongside the IBAN is optional for regular SEPA
            transfers. 

            Banks are required by SEPA to automatically derive the BIC from the
            IBAN.  

            You must still provide the BIC if the SEPA-participating country
            does not use the euro (e.g., Switzerland, Monaco, or San Marino).
          type: string
        bankName:
          description: Beneficiary bank name
          type: string
        bankAddress:
          $ref: '#/components/schemas/PhysicalAddress'
      x-source-svc: ledger
    BaseACHBankAccount:
      description: Bank details needed for ACH payments
      type: object
      required:
        - recipientAddress
        - bankAddress
        - routingNumber
        - bankName
      properties:
        routingNumber:
          type: string
          minLength: 9
          maxLength: 9
          pattern: ^\d{9}$
          example: '021000021'
        accountType:
          $ref: '#/components/schemas/AccountType'
        recipientAddress:
          $ref: '#/components/schemas/PhysicalAddress'
        bankAddress:
          $ref: '#/components/schemas/PhysicalAddress'
        bankName:
          description: Beneficiary bank name
          type: string
      x-source-svc: ledger
    BaseSwiftBankAccount:
      description: Bank details needed for SWIFT
      type: object
      required:
        - recipientAddress
        - bankAddress
        - bankName
        - bic
      properties:
        routingNumber:
          type: string
          minLength: 9
          maxLength: 9
          pattern: ^\d{9}$
          example: '021000021'
        recipientAddress:
          $ref: '#/components/schemas/PhysicalAddress'
        bankAddress:
          $ref: '#/components/schemas/PhysicalAddress'
        bankName:
          description: Beneficiary bank name
          type: string
        bic:
          description: Beneficiary BIC, might be called SWIFT code
          type: string
      x-source-svc: ledger
    BaseMobileWalletAccount:
      description: Details needed for mobile money payments
      type: object
      required:
        - accountNumber
      properties:
        accountNumber:
          description: >-
            Beneficiary account number, for Mobile Money, this is the phone
            number.
          type: string
          example: '233501234567'
        mobileNetwork:
          type: string
          description: >-
            Mobile network operator for the mobile money account (e.g., MTN,
            Vodafone)
      x-source-svc: ledger
    BaseMultiRailBankAccount:
      description: >
        Bank details for an account reachable via more than one
        independently-coded payment rail on the

        same account number (e.g. a US account that accepts ACH, FedWire, and
        SWIFT, each with its own

        routing code). Use the single-rail Cash*BankAccount schemas instead when
        only one rail applies.
      type: object
      required:
        - bankName
        - bankAddress
        - supportedRails
      properties:
        bankName:
          description: Beneficiary bank name
          type: string
        bankAddress:
          $ref: '#/components/schemas/PhysicalAddress'
        accountType:
          $ref: '#/components/schemas/AccountType'
        supportedRails:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            $ref: '#/components/schemas/CashPaymentRail'
      x-source-svc: ledger
    PhysicalAddress:
      required:
        - city
        - country
        - postalCode
        - state
        - streetAddress
      type: object
      properties:
        streetAddress:
          minLength: 3
          type: string
          description: the street address of the user
          example: 11 Main Street
        city:
          minLength: 2
          type: string
          description: the city/municipality where the user lives
          example: Gbagada
        state:
          minLength: 3
          type: string
          description: the state/region/province where the user lives
          example: Lagos
        country:
          maxLength: 2
          minLength: 2
          type: string
          description: the country ISO CODE 3166-2 where the user lives
          example: NG
        postalCode:
          minLength: 4
          type: string
          description: the postal code of the specified address
          example: '200124'
        apartmentNo:
          minLength: 1
          type: string
          description: the flat/apartment number of the user at the specified address
          example: 5B
      x-source-svc: ledger
    AccountType:
      type: string
      description: The account type
      example: CHECKING
      enum:
        - CHECKING
        - SAVINGS
      x-source-svc: ledger
    CashPaymentRail:
      description: >
        A single payment rail supported by a multi-rail bank account, and the
        routing code specific to

        that rail (e.g. the ABA routing number for ACH/FedWire, or the BIC for
        SWIFT).
      type: object
      required:
        - rail
        - routingCode
      properties:
        rail:
          type: string
          enum:
            - ACH
            - FEDWIRE
            - SWIFT
        routingCode:
          type: string
          example: '021000021'
      x-source-svc: ledger
  responses:
    LedgerSvcInvalidRequest:
      description: Request could not be validated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessageDto'
          example:
            code: BAD_REQUEST
            message: Request could not be validated.
    LedgerSvcUnauthorized:
      description: Client is not authorized to make request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessageDto'
          example:
            code: UNAUTHORIZED
            message: Either client security header is missing or it is not valid.
    LedgerSvcAccessDenied:
      description: Expected permission is not available.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessageDto'
          example:
            code: ACCESS_DENIED
            message: Expected permission or scope is not present.
    LedgerSvcServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessageDto'
          example:
            code: INTERNAL_ERROR
            message: An internal server error occurred.
  securitySchemes:
    HMACAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: |-
        Requires authentication via API key and HMAC signature.
          * `x-api-key`: Your API key generated from your Onboard Business dashboard.
          * `x-timestamp`:  Unix epoch timestamp (seconds) used in signature, allowed skew is 30 seconds
          * `x-signature`: SHA256 HMAC HEX signature calculated over  `t={x-timestamp}&{requestBody}` using your API Secret.

````