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

# Create Offramp Account

> Create offramp account with beneficiary id.

Creates an offramp account linked to a fiat beneficiary.


## OpenAPI

````yaml POST /ledger/offramp-accounts
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/offramp-accounts:
    post:
      tags:
        - ledger-offramp accounts
      summary: Create offramp account
      description: Create offramp account with beneficiary id.
      operationId: createOfframpAccount
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOfframpAccountRequest'
      responses:
        '200':
          description: Offramp account created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfframpAccount'
        '400':
          $ref: '#/components/responses/LedgerSvcInvalidRequest'
        '401':
          $ref: '#/components/responses/LedgerSvcUnauthorized'
      security:
        - HMACAuth: []
components:
  schemas:
    CreateOfframpAccountRequest:
      type: object
      required:
        - beneficiaryId
        - payoutCurrency
      properties:
        payoutCurrency:
          type: string
          description: Currency in which payouts will be made to the beneficiary.
          example: KES
        beneficiaryId:
          type: string
          format: uuid
          description: >
            Identifier of an existing beneficiary to be linked to the offramp
            account. 

            Should be in the same currency as payoutCurrency.
      x-source-svc: ledger
    OfframpAccount:
      type: object
      required:
        - id
        - beneficiary
        - payoutCurrency
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the offramp account.
        beneficiary:
          $ref: '#/components/schemas/Beneficiary'
        payoutCurrency:
          type: string
          example: KES
        status:
          $ref: '#/components/schemas/OfframpAccountStatus'
        createdDate:
          type: string
          format: date-time
      x-source-svc: ledger
    Beneficiary:
      type: object
      additionalProperties: false
      description: Fiat beneficiary object
      discriminator:
        propertyName: beneficiaryType
        mapping:
          BeneficiaryLocalBankAccount:
            $ref: '#/components/schemas/BeneficiaryLocalBankAccount'
          BeneficiarySepaBankAccount:
            $ref: '#/components/schemas/BeneficiarySepaBankAccount'
          BeneficiaryACHBankAccount:
            $ref: '#/components/schemas/BeneficiaryACHBankAccount'
          BeneficiarySwiftBankAccount:
            $ref: '#/components/schemas/BeneficiarySwiftBankAccount'
          BeneficiaryMobileWalletAccount:
            $ref: '#/components/schemas/BeneficiaryMobileWalletAccount'
      required:
        - id
        - accountNumber
        - accountName
        - currency
        - accountHolderType
      properties:
        id:
          description: Beneficiary identifier
          type: string
          format: uuid
        accountNumber:
          description: >-
            Beneficiary account number, for international payments like SEPA,
            this is the IBAN
          type: string
        accountName:
          description: Beneficiary account name
          type: string
        currency:
          type: string
        beneficiaryType:
          type: string
          description: |
            Discriminator value for beneficiary type. Allowed values include:
            - BeneficiaryLocalBankAccount
            - BeneficiarySepaBankAccount
            - BeneficiaryACHBankAccount
            - BeneficiarySwiftBankAccount
            - BeneficiaryMobileWalletAccount
        isThirdParty:
          type: boolean
          description: Flag to indicate if the beneficiary is a third party
          default: false
        accountHolderType:
          $ref: '#/components/schemas/AccountHolderType'
      x-source-svc: ledger
    OfframpAccountStatus:
      type: string
      description: Status of the offramp account.
      enum:
        - ACTIVE
        - INACTIVE
        - SUSPENDED
      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
    BeneficiaryLocalBankAccount:
      description: Local bank transfer beneficiary.
      allOf:
        - $ref: '#/components/schemas/Beneficiary'
        - $ref: '#/components/schemas/BaseLocalBankAccount'
      x-source-svc: ledger
    BeneficiarySepaBankAccount:
      description: >-
        SEPA instant and standard transfer beneficiary. Use this for
        beneficiaries that will receive SEPA payments.
      allOf:
        - $ref: '#/components/schemas/Beneficiary'
        - $ref: '#/components/schemas/BaseSepaBankAccount'
      x-source-svc: ledger
    BeneficiaryACHBankAccount:
      description: ACH, FedWire and FedNow transfer beneficiary
      allOf:
        - $ref: '#/components/schemas/Beneficiary'
        - $ref: '#/components/schemas/BaseACHBankAccount'
      x-source-svc: ledger
    BeneficiarySwiftBankAccount:
      allOf:
        - $ref: '#/components/schemas/Beneficiary'
        - $ref: '#/components/schemas/BaseSwiftBankAccount'
      x-source-svc: ledger
    BeneficiaryMobileWalletAccount:
      description: >
        Use this for beneficiaries that will receive mobile wallet payments. 

        Supported channels include MOBILE_MONEY_UGANDA, MOBILE_MONEY_TANZANIA,
        MOBILE_MONEY_ZAMBIA, etc
      allOf:
        - $ref: '#/components/schemas/Beneficiary'
        - $ref: '#/components/schemas/BaseMobileWalletAccount'
      x-source-svc: ledger
    AccountHolderType:
      type: string
      enum:
        - INDIVIDUAL
        - BUSINESS
      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
    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
  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.
  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.

````