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

# Withdraw crypto

> Withdraw in crypto to any address.

> [!NOTE]
>
> CryptoProcessing is required to collect sender data in compliance with local regulations. For more details, see [User data collection](https://docs.ca.cryptoprocessing.com/user-data-collection.md). The `sender_data` and the `end_user_reference` you provide must be associated with the same customer.

For every error this endpoint returns and what it means, see [API errors: Withdraw crypto](https://docs.ca.cryptoprocessing.com/api-reference/errors.md#withdraw-crypto).


## OpenAPI

````yaml POST /v2/withdrawal/crypto
openapi: 3.1.0
info:
  title: Merchant Backend V2
  version: '1.0'
  description: Documentation for merchant backend processing endpoints
servers:
  - url: https://app.ca.cryptoprocessing.com/api
security:
  - xProcessingKey: []
tags:
  - name: Status
  - name: Balance
  - name: Currencies
  - name: Deposit addresses
  - name: Withdrawal
  - name: Exchange
  - name: Invoices
  - name: Transactions
paths:
  /v2/withdrawal/crypto:
    post:
      tags:
        - Withdrawal
      summary: Withdraw crypto
      description: Withdraw in crypto to any address.
      operationId: post-withdrawal-crypto
      parameters:
        - $ref: '#/components/parameters/XProcessingSignatureHeader'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                currency:
                  type: string
                  description: >-
                    The currency to withdraw from your merchant account — a
                    cryptocurrency, or a fiat currency paired with `convert_to`
                    to convert it into a cryptocurrency before sending. For a
                    list of all available currencies, see [API currency
                    codes](/api-reference/currency-codes).
                address:
                  type: string
                  description: Cryptocurrency address where you want to send funds.
                foreign_id:
                  type: string
                  maxLength: 255
                  description: >-
                    Unique ID of the withdrawal request. It must be unique among
                    your withdrawals and exchanges, and it's case-insensitive.
                end_user_reference:
                  $ref: '#/components/schemas/end_user_reference.withdrawals'
                sender_type:
                  $ref: '#/components/schemas/sender_type.withdrawals'
                sender_data:
                  $ref: '#/components/schemas/sender_data.withdrawals'
                receiver_type:
                  $ref: '#/components/schemas/receiver_type'
                receiver_data:
                  $ref: '#/components/schemas/receiver_data'
                convert_to:
                  type: string
                  description: >-
                    The cryptocurrency to convert the funds into before sending.
                    If omitted, funds are sent in the source `currency` without
                    conversion.
                amount:
                  oneOf:
                    - type: string
                    - type: number
                  description: "Amount to withdraw in the source `currency`, as a decimal string (for example, `\"0.0003\"`) or a number. Required unless `amount_to` is specified instead — you can only specify either `amount_to` or `amount`, not both. For a fiat `currency`, at most\_2\_decimal places are allowed; for a cryptocurrency, digits after the 8th\_decimal place are dropped."
                amount_to:
                  oneOf:
                    - type: string
                    - type: number
                  description: >-
                    Amount to send in the `convert_to` currency, as a decimal
                    string or a number. Use this field when you want to convert
                    funds and send a specific amount in the target currency set
                    in `convert_to`. Required unless `amount` is specified
                    instead — you can only specify either `amount_to` or
                    `amount`, not both. Up to 8 decimal places.
                tag:
                  type: string
                  description: >-
                    Tag/memo for currencies and destination wallets that support
                    or require it. On withdrawal forms, display this field to
                    the user, but allow it to be empty because some wallets do
                    not require a tag/memo. Warn the user that if the
                    destination wallet requires a tag/memo and it is not
                    provided, the funds may be lost.
              required:
                - currency
                - address
                - foreign_id
                - sender_data
                - sender_type
                - receiver_type
                - end_user_reference
            examples:
              Withdraw USDC:
                value:
                  currency: USDC
                  amount: '100'
                  address: '0x35f6005cfA94a1c030B8c4dfcc29D4eB8a6865bF'
                  foreign_id: withdrawal_123
                  end_user_reference: user_12345
                  sender_type: legal
                  sender_data:
                    legal_name: Example Customer
                    country_of_registration: CAN
                  receiver_type: natural
                  receiver_data:
                    first_name: Chris
                    last_name: Customer
                    date_of_birth: '1970-01-01'
              Convert USD and withdraw the USDC:
                value:
                  currency: USD
                  convert_to: USDC
                  amount: '100'
                  address: '0x35f6005cfA94a1c030B8c4dfcc29D4eB8a6865bF'
                  foreign_id: withdrawal_123
                  end_user_reference: user_12345
                  sender_type: legal
                  sender_data:
                    legal_name: Example Customer
                    country_of_registration: CAN
                  receiver_type: natural
                  receiver_data:
                    first_name: Chris
                    last_name: Customer
                    date_of_birth: '1970-01-01'
              Convert USD to withdraw an exact USDC amount:
                value:
                  currency: USD
                  convert_to: USDC
                  amount_to: '100'
                  address: '0x35f6005cfA94a1c030B8c4dfcc29D4eB8a6865bF'
                  foreign_id: withdrawal_123
                  end_user_reference: user_12345
                  sender_type: legal
                  sender_data:
                    legal_name: Example Customer
                    country_of_registration: CAN
                  receiver_type: natural
                  receiver_data:
                    first_name: Chris
                    last_name: Customer
                    date_of_birth: '1970-01-01'
              Withdraw XRP with a destination tag:
                value:
                  currency: XRP
                  amount: '50'
                  address: rBRqa43yBn3vmgFyjKpwLifG8F4pAUEibv
                  tag: '12345'
                  foreign_id: withdrawal_123
                  end_user_reference: user_12345
                  sender_type: legal
                  sender_data:
                    legal_name: Example Customer
                    country_of_registration: CAN
                  receiver_type: natural
                  receiver_data:
                    first_name: Chris
                    last_name: Customer
                    date_of_birth: '1970-01-01'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - id
                      - foreign_id
                      - type
                      - status
                      - sender_currency
                      - receiver_currency
                    properties:
                      id:
                        type: integer
                        description: Transaction ID.
                      foreign_id:
                        type: string
                        description: Unique ID of the withdrawal request.
                      end_user_reference:
                        type: string
                        description: The `end_user_reference` from the request.
                      type:
                        type: string
                        description: >-
                          Transaction type: `withdrawal`, or
                          `withdrawal_exchange` for a withdrawal with
                          conversion.
                      status:
                        type: string
                        description: >-
                          Transaction status. A [withdrawal
                          callback](/api-reference/callbacks/withdrawal-callbacks)
                          is sent when the status changes to `pending` (held for
                          approval), `confirmed`, `declined` or `cancelled`.
                      amount:
                        type: string
                        description: >-
                          Withdrawal amount in `sender_currency`. Omitted if the
                          request used `amount_to`.
                      sender_amount:
                        type: string
                        description: >-
                          Same as `amount`. Withdrawal amount in the
                          `sender_currency`. Omitted if the request used
                          `amount_to`.
                      sender_currency:
                        type: string
                        description: Source currency ISO code.
                      receiver_currency:
                        type: string
                        description: >-
                          Destination currency ISO code. Same as
                          `sender_currency` for withdrawals without conversion.
                      receiver_amount:
                        type: string
                        description: >-
                          Amount sent in `receiver_currency`. Present if the
                          amount to be sent to the wallet is specified (`amount`
                          for withdrawals without conversion, `amount_to` for
                          withdrawals with conversion).
              examples:
                Withdraw USDC:
                  value:
                    data:
                      id: 132541615
                      foreign_id: withdrawal_123
                      end_user_reference: user_12345
                      type: withdrawal
                      status: processing
                      amount: '100.00000000'
                      sender_amount: '100.00000000'
                      sender_currency: USDC
                      receiver_currency: USDC
                      receiver_amount: '100.00000000'
                Convert USD and withdraw the USDC:
                  value:
                    data:
                      id: 132541619
                      foreign_id: withdrawal_123
                      end_user_reference: user_12345
                      type: withdrawal_exchange
                      status: processing
                      amount: '100.00000000'
                      sender_amount: '100.00000000'
                      sender_currency: USD
                      receiver_currency: USDC
                Convert USD to withdraw an exact USDC amount:
                  value:
                    data:
                      id: 132541648
                      foreign_id: withdrawal_123
                      end_user_reference: user_12345
                      type: withdrawal_exchange
                      status: processing
                      sender_currency: USD
                      receiver_currency: USDC
                      receiver_amount: '100.00000000'
                Withdraw XRP with a destination tag:
                  value:
                    data:
                      id: 132541663
                      foreign_id: withdrawal_123
                      end_user_reference: user_12345
                      type: withdrawal
                      status: processing
                      amount: '50.00000000'
                      sender_amount: '50.00000000'
                      sender_currency: XRP
                      receiver_currency: XRP
                      receiver_amount: '50.00000000'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationOrMalformedJson'
              examples:
                Missing currency:
                  value:
                    errors:
                      currency: The currency field is required.
                Currency doesn't exist:
                  value:
                    errors:
                      currency: Invalid currency
                Fiat currency without conversion:
                  value:
                    errors:
                      currency: Invalid currency
                Currency not a string:
                  value:
                    errors:
                      currency: The currency must be a string.
                Conversion currency doesn't exist:
                  value:
                    errors:
                      convert_to: Invalid currency
                Conversion to the same currency:
                  value:
                    errors:
                      convert_to: Invalid currency
                Conversion to a fiat currency:
                  value:
                    errors:
                      convert_to: Invalid currency
                Missing amount:
                  value:
                    errors:
                      amount: >-
                        The amount field is required when the amount to field is
                        not presented.
                Amount not a number:
                  value:
                    errors:
                      amount: The amount must be a number.
                Amount zero or negative:
                  value:
                    errors:
                      amount: The amount must be greater than 0.
                "Fiat amount with more than\_2\_decimals":
                  value:
                    errors:
                      amount: 'The amount is invalid. Max decimal places allowed: 2'
                Amount below the minimum:
                  value:
                    errors:
                      amount: The amount must be at least <amount>.
                Not enough balance:
                  value:
                    errors:
                      amount: The requested amount exceeds the available balance.
                Conversion unavailable for the amount:
                  value:
                    errors:
                      amount: >-
                        Unable to exchange the requested amount at the moment.
                        Specify a smaller amount or try again later.
                Missing amount_to:
                  value:
                    errors:
                      amount_to: >-
                        The amount to field is required when the amount field is
                        not presented.
                Both amount and target amount:
                  value:
                    errors:
                      amount_to: >-
                        The amount to field can not be used when the amount
                        field is presented.
                Target amount not a number:
                  value:
                    errors:
                      amount_to: The amount to must be a number.
                Target amount zero or negative:
                  value:
                    errors:
                      amount_to: The amount to must be greater than 0.
                Target amount with too many decimals:
                  value:
                    errors:
                      amount_to: >-
                        The amount to must not have more than <decimals> decimal
                        places.
                Conversion unavailable for the target amount:
                  value:
                    errors:
                      amount_to: >-
                        Unable to exchange the requested amount at the moment.
                        Specify a smaller amount or try again later.
                Missing convert_to:
                  value:
                    errors:
                      convert_to: >-
                        The convert to field is required when amount to is
                        present.
                Missing address:
                  value:
                    errors:
                      address: The address field is required.
                Address not a string:
                  value:
                    errors:
                      address: The address must be a string.
                Address not valid for the currency:
                  value:
                    errors:
                      address: Invalid <currency> address
                Tag for a currency without tags:
                  value:
                    errors:
                      tag: Currency <currency> does not support tags.
                Tag not valid:
                  value:
                    errors:
                      tag: Tag is invalid
                Missing foreign_id:
                  value:
                    errors:
                      foreign_id: The foreign id field is required.
                "Foreign ID longer than\_255\_characters":
                  value:
                    errors:
                      foreign_id: The foreign id may not be greater than 255 characters.
                Foreign ID already used:
                  value:
                    errors:
                      foreign_id: The foreign id has already been taken.
                Email in the end-user reference:
                  value:
                    errors:
                      end_user_reference: The end user reference must not contain email.
                End-user reference not a string:
                  value:
                    errors:
                      end_user_reference: The end user reference must be a string.
                Sender type not natural or legal:
                  value:
                    errors:
                      sender_type: The selected sender type is invalid.
                Receiver type not natural, legal or self:
                  value:
                    errors:
                      receiver_type: The selected receiver type is invalid.
                Missing receiver_data:
                  value:
                    errors:
                      receiver_data: The receiver data field is required.
                      receiver_data.legal_name: The receiver data.legal name field is required.
                      receiver_data.country_of_registration: >-
                        The receiver data.country of registration field is
                        required.
                Malformed JSON:
                  value:
                    error: Bad content format
                    code: bad_content_format
        '403':
          $ref: '#/components/responses/WithdrawalHeaderAuthorization'
        '422':
          description: >
            Unprocessable entity. An internal error occurred during processing.
            The request was understood but could not be completed.


            The `errors` field is an array of error messages. The `error_code`
            is always the string `"internal_error"`. For other causes of this
            error, see [Internal
            error](/api-reference/errors#internal-error-422-unprocessable-entity).
          content:
            application/json:
              schema:
                type: object
                required:
                  - errors
                  - error_code
                properties:
                  errors:
                    type: array
                    description: Array of error messages
                    items:
                      type: string
                  error_code:
                    type: string
                    description: Error code identifier
              examples:
                Amount as a string in scientific notation:
                  value:
                    errors:
                      - Internal error
                    error_code: internal_error
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    XProcessingSignatureHeader:
      name: X-Processing-Signature
      in: header
      required: true
      description: >-
        Hex-encoded HMAC-SHA512 signature of the request body, [generated using
        your secret key](/api-reference/authentication).
      schema:
        type: string
  schemas:
    end_user_reference.withdrawals:
      type: string
      description: >
        Persistent internal ID of the merchant's customer who initiates the
        withdrawal. Use the same value for the same customer across all
        requests. This value must refer to the same customer described in
        `sender_data`.


        Do not include personal data, such as the customer's name or email
        address. Put personal details in `sender_data`.
    sender_type.withdrawals:
      type: string
      enum:
        - natural
        - legal
      description: >
        Type of the merchant's customer who initiates the withdrawal. The sender
        must be the same customer identified by `end_user_reference`.


        Use `natural` if the sender is an individual person and `legal` if the
        sender is a legal entity. The selected type determines which fields must
        be included in `sender_data`.
    sender_data.withdrawals:
      description: >
        Must contain the details of the merchant's customer who initiates the
        withdrawal. Which fields are required depends on `sender_type`.
      oneOf:
        - title: Natural person
          type: object
          required:
            - first_name
            - last_name
          properties:
            first_name:
              type: string
              maxLength: 255
              description: The sender's first name.
            last_name:
              type: string
              maxLength: 255
              description: The sender's last name.
            date_of_birth:
              type: string
              description: >-
                The sender's date of birth, YYYY-MM-DD. Optional for a natural
                person.
        - title: Legal entity
          type: object
          required:
            - legal_name
            - country_of_registration
          properties:
            legal_name:
              type: string
              maxLength: 255
              description: The company's name.
            country_of_registration:
              type: string
              description: >-
                The company's country of registration (ISO alpha-3 format, three
                characters).
    receiver_type:
      type: string
      enum:
        - natural
        - legal
        - self
      description: >
        Type of the withdrawal recipient.


        Use `natural` if the recipient is an individual person, `legal` if the
        recipient is a legal entity, or `self` if the recipient is the same
        person or legal entity as the sender.


        The selected type determines whether `receiver_data` is required and
        which fields it must contain.
    receiver_data:
      description: >
        Details of the withdrawal recipient. Omit this field entirely if
        `receiver_type` is `self`. Otherwise, which fields are required depends
        on `receiver_type`.
      oneOf:
        - title: Natural person
          type: object
          required:
            - first_name
            - last_name
          properties:
            first_name:
              type: string
              description: The recipient's first name.
            last_name:
              type: string
              description: The recipient's last name.
            date_of_birth:
              type: string
              description: >-
                The recipient's date of birth, YYYY-MM-DD. Optional for a
                natural person.
        - title: Legal entity
          type: object
          required:
            - legal_name
            - country_of_registration
          properties:
            legal_name:
              type: string
              maxLength: 255
              description: The company's name.
            country_of_registration:
              type: string
              description: >-
                The company's country of registration (ISO alpha-3 format, three
                characters).
    ValidationOrMalformedJson:
      oneOf:
        - type: object
          title: ValidationError
          description: One or more request parameters failed validation.
          properties:
            errors:
              type: object
              description: >
                A map of request field names to a human-readable validation
                error message for that field. The exact set of possible keys and
                messages is endpoint-specific — see [API
                errors](/api-reference/errors#errors-by-endpoint) for the full
                reference.
              additionalProperties:
                type: string
                description: Human-readable validation error message for this field.
        - type: object
          title: MalformedJson
          description: >-
            The request body is not valid JSON or the Content-Type header is not
            set to `application/json`.
          properties:
            error:
              type: string
            code:
              type: string
  responses:
    WithdrawalHeaderAuthorization:
      description: |
        Forbidden
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: Human-readable error message.
              code:
                type: string
                description: Error code.
            description: >-
              Invalid or missing headers, the API key does not have access to
              the endpoint, or withdrawals are disabled for the merchant or the
              API key. Refer to [Errors](/api-reference/errors#general-errors)
              for troubleshooting steps.
          examples:
            Bad signature header:
              value:
                error: Bad signature header
                code: bad_header_signature
            API key does not have the required ability:
              value:
                error: The API key does not have access to this endpoint.
                code: api_key_ability_required
            No signature header:
              value:
                error: No signature header
                code: required_header_signature
            No key header:
              value:
                error: No key header
                code: required_header_key
            Withdrawals disabled for your account:
              value:
                error: Withdrawal functionality is currently unavailable
                code: withdrawal_functionality_unavailable
            Withdrawals disabled for the API key:
              value:
                error: Withdrawals are disabled for this API key.
                code: api_key_withdrawals_disabled
    TooManyRequests:
      description: >
        Too Many Requests


        You sent too many requests in a short time. The limit is counted per API
        key, so requests from all your servers that use the same key count
        together. Wait before you send the request again, increasing the delay
        if you get `429` again, and handle this error by its status code, not by
        a particular response body. See [Too many
        requests](/api-reference/errors#too-many-requests-429-too-many-requests).
  securitySchemes:
    xProcessingKey:
      type: apiKey
      description: Your [API key](/merchant-administration/generate-and-activate-api-keys).
      in: header
      name: X-Processing-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.