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

# Initiate Crypto Transfer

> This operation allow the client to perform crypto transfer to an external wallet.

N.B. The amount field is the withdrawal amount only (fees are not included). The applicable
fee, including any platform fee, is computed server-side and is not a client-supplied input.


Initiates a crypto withdrawal to an external wallet or beneficiary.


## OpenAPI

````yaml POST /ledger/crypto-transfer
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/crypto-transfer:
    post:
      tags:
        - ledger-transfer
      summary: Performs crypto transfer
      description: >
        This operation allow the client to perform crypto transfer to an
        external wallet.


        N.B. The amount field is the withdrawal amount only (fees are not
        included). The applicable

        fee, including any platform fee, is computed server-side and is not a
        client-supplied input.
      operationId: cryptoTransfer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CryptoTransferRequest'
      responses:
        '201':
          description: Request received, do 2FA
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferResponse'
        '400':
          $ref: '#/components/responses/LedgerSvcInvalidRequest'
        '401':
          $ref: '#/components/responses/LedgerSvcUnauthorized'
        '403':
          $ref: '#/components/responses/LedgerSvcAccessDenied'
        default:
          $ref: '#/components/responses/LedgerSvcServerError'
      security:
        - HMACAuth: []
components:
  schemas:
    CryptoTransferRequest:
      description: >
        Request object for crypto payment initiation request. The
        sourceAccountId can be a main account or sub-account.
      type: object
      additionalProperties: false
      required:
        - sourceAccountId
        - amount
        - destination
      properties:
        sourceAccountId:
          type: string
          format: uuid
          description: >-
            The source account ID from which funds will be debited. This can be
            a main account or sub-account.
        amount:
          type: number
          example: '100.00'
          minimum: 0
          description: Transaction amount, specified in the source account's currency.
        narration:
          type: string
          description: Notes
        destination:
          $ref: '#/components/schemas/CryptoTransferDestination'
      x-source-svc: ledger
    TransferResponse:
      type: object
      additionalProperties: false
      description: The payment initiation response
      required:
        - id
        - status
        - awaiting2fA
      properties:
        id:
          type: string
          example: P12005E1DV
        status:
          $ref: '#/components/schemas/TransactionStatus'
        awaiting2fA:
          type: boolean
          default: false
          description: >-
            Indicates if transfer is awaiting 2FA confirmation. This applies
            mostly to transaction initiated via dashboard
        twoFaMethod:
          type: array
          description: List of 2fa enabled
          items:
            $ref: '#/components/schemas/User2FAMethod'
      x-source-svc: ledger
    CryptoTransferDestination:
      type: object
      additionalProperties: false
      description: >-
        The destination details of the transfer. Either beneficiaryId or address
        must be provided.
      required:
        - tokenNetworkCode
      properties:
        tokenNetworkCode:
          type: string
          description: The token network code for the transfer
          example: BUSD_BSC
        beneficiaryId:
          type: string
          format: uuid
          description: >-
            The ID of the saved crypto beneficiary to which the transfer will be
            made.
        address:
          type: string
          example: '0x7BCc5bCBa19DE3C903F062D8fB5fF8d9f818173E'
        memo:
          type: string
          example: '405070'
          description: Optional, for networks that require memo.
      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
    User2FAMethod:
      type: string
      enum:
        - AUTHENTICATOR_APP
        - EMAIL
        - SMS
      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
  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.

````