> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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 the MiCA regulations. For more details, see [**User data collection**](/api-reference/user-data-collection). The `sender_data` and the `end_user_reference` you provide must be associated with the same customer.
</Note>


## OpenAPI

````yaml POST /withdrawal/crypto
openapi: 3.0.0
info:
  title: Merchant Backend V2
  version: '1.0'
  description: Documentation for merchant backend processing endpoints
servers:
  - url: https://app.cryptoprocessing.com/api/v2
security:
  - xProcessingKey: []
tags:
  - name: Status
  - name: Balance
  - name: Currencies
  - name: Deposit addresses
  - name: Withdrawal
  - name: Exchange
  - name: Invoices
  - name: Transactions
paths:
  /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: >-
                    Currency to withdraw. For a list of all available
                    currencies, see [API currency
                    codes](/api-reference/currency-codes).
                convert_to:
                  type: string
                  description: >-
                    Target currency to convert funds into before sending. If
                    omitted, funds are sent in the source `currency` without
                    conversion.
                amount:
                  type: number
                  description: >-
                    Amount to withdraw in the source `currency`. You can only
                    specify either `amount_to` or `amount`.
                amount_to:
                  type: number
                  description: >-
                    Amount to send in the `convert_to` currency. Use this field
                    when you want to convert funds and send a specific amount in
                    the target currency set in `convert_to`. You can only
                    specify either `amount_to` or `amount`.
                address:
                  type: string
                  description: Cryptocurrency address where you want to send funds.
                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.
                foreign_id:
                  description: Unique ID of the withdrawal request.
                end_user_reference:
                  type: string
                  description: >
                    Persistent internal ID of the merchant's end 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:
                  type: string
                  enum:
                    - natural
                    - legal
                  description: >
                    Type of the merchant's end 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:
                  type: object
                  description: >
                    Details of the merchant's end customer who initiates the
                    withdrawal.


                    - If `sender_type` is `natural`, include `first_name`,
                    `last_name`, and `date_of_birth`. Do not include
                    `legal_name` or `country_of_registration`.


                    - If `sender_type` is `legal`, include `legal_name` and
                    `country_of_registration`. Do not include `first_name`,
                    `last_name`, or

                    `date_of_birth`.


                    You can optionally include `email` for either sender type.
                  required:
                    - first_name
                    - last_name
                    - date_of_birth
                    - legal_name
                    - country_of_registration
                  properties:
                    first_name:
                      $ref: '#/components/schemas/sender_data_first_name'
                    last_name:
                      $ref: '#/components/schemas/sender_data_last_name'
                    date_of_birth:
                      $ref: '#/components/schemas/sender_data_date_of_birth'
                    email:
                      $ref: '#/components/schemas/sender_data_email'
                    legal_name:
                      $ref: '#/components/schemas/sender_data_legal_name'
                    country_of_registration:
                      $ref: '#/components/schemas/sender_data_country_of_registration'
                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:
                  type: object
                  description: >
                    Details of the withdrawal recipient.


                    - If `receiver_type` is `natural`, include `first_name`,
                    `last_name`, and `date_of_birth`. Do not include
                    `legal_name` or `country_of_registration`.


                    - If `receiver_type` is `legal`, include `legal_name` and
                    `country_of_registration`. Do not include `first_name`,
                    `last_name`, or `date_of_birth`.


                    - If `receiver_type` is `self`, do not include
                    `receiver_data`.                  
                  required:
                    - first_name
                    - last_name
                    - date_of_birth
                    - legal_name
                    - country_of_registration
                  properties:
                    first_name:
                      $ref: '#/components/schemas/receiver_data_first_name'
                    last_name:
                      $ref: '#/components/schemas/receiver_data_last_name'
                    date_of_birth:
                      $ref: '#/components/schemas/receiver_data_date_of_birth'
                    legal_name:
                      $ref: '#/components/schemas/sender_data_legal_name'
                    country_of_registration:
                      $ref: '#/components/schemas/sender_data_country_of_registration'
              required:
                - currency
                - amount
                - address
                - foreign_id
                - sender_data
                - sender_type
                - receiver_type
                - receiver_data
                - end_user_reference
            examples:
              Withdraw BTC:
                value:
                  currency: BTC
                  foreign_id: test_foreign_id_0148
                  end_user_reference: test_end_user_reference
                  sender_type: legal
                  sender_data:
                    legal_name: Example GmbH
                    country_of_registration: DEU
                  receiver_type: natural
                  receiver_data:
                    first_name: Friedrich
                    last_name: Müller
                    date_of_birth: '1995-08-17'
                  address: tb1qfdxh6gkfr0qgyatnlkd8khcnxph9tw06n6qwjc
                  amount: '0.00020000'
              Withdraw BTC with conversion from EUR:
                value:
                  currency: EUR
                  convert_to: BTC
                  foreign_id: test_foreign_id_0149
                  end_user_reference: test_end_user_reference
                  sender_type: legal
                  sender_data:
                    legal_name: Example GmbH
                    country_of_registration: DEU
                  receiver_type: natural
                  receiver_data:
                    first_name: Friedrich
                    last_name: Müller
                    date_of_birth: '1995-08-17'
                  address: tb1qfdxh6gkfr0qgyatnlkd8khcnxph9tw06n6qwjc
                  amount: '100'
              Withdraw BTC with conversion and target amount:
                value:
                  currency: EUR
                  convert_to: BTC
                  foreign_id: test_foreign_id_0150
                  end_user_reference: test_end_user_reference
                  sender_type: legal
                  sender_data:
                    legal_name: Example GmbH
                    country_of_registration: DEU
                  receiver_type: natural
                  receiver_data:
                    first_name: Friedrich
                    last_name: Müller
                    date_of_birth: '1995-08-17'
                  address: tb1qfdxh6gkfr0qgyatnlkd8khcnxph9tw06n6qwjc
                  amount_to: '0.00020000'
        description: ''
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: Transaction ID.
                      foreign_id:
                        type: string
                        description: Unique ID of the withdrawal request.
                      end_user_reference:
                        type: string
                        description: >-
                          Persistent internal user ID used to track all requests
                          for the same end user.
                      type:
                        type: string
                        description: >-
                          Transaction type (e.g., `withdrawal`,
                          `withdrawal_exchange`).
                      status:
                        type: string
                        description: Transaction status.
                      amount:
                        type: string
                        description: Withdrawal amount in `sender_currency`.
                      sender_amount:
                        type: string
                        description: >-
                          Same as `amount`. Withdrawal amount in the
                          `sender_currency`. Present for non-exchange
                          withdrawals.
                      sender_currency:
                        type: string
                        description: Source currency ISO code.
                      receiver_currency:
                        type: string
                        description: >-
                          Destination currency ISO code. Same as
                          `sender_currency` for non-exchange withdrawals.
                      receiver_amount:
                        type: string
                        description: >-
                          Amount sent in `receiver_currency`. Present if the
                          amount to be sent to the wallet is specified (`amount`
                          for non-exchange withdrawals or `amount_to` for
                          exchange withdrawals).
              examples:
                Withdraw BTC:
                  value:
                    data:
                      id: 134702815
                      foreign_id: test_foreign_id_0148
                      end_user_reference: test_end_user_reference
                      type: withdrawal
                      status: processing
                      amount: '0.00020000'
                      sender_amount: '0.00020000'
                      sender_currency: BTC
                      receiver_currency: BTC
                      receiver_amount: '0.00020000'
                Withdraw BTC with conversion from EUR:
                  value:
                    data:
                      id: 134702831
                      foreign_id: test_foreign_id_0149
                      end_user_reference: test_end_user_reference
                      type: withdrawal_exchange
                      status: processing
                      amount: '100.00000000'
                      sender_amount: '100.00000000'
                      sender_currency: EUR
                      receiver_currency: BTC
                Withdraw BTC with conversion and target amount:
                  value:
                    data:
                      id: 134702840
                      foreign_id: test_foreign_id_0150
                      end_user_reference: test_end_user_reference
                      type: withdrawal_exchange
                      status: processing
                      sender_currency: EUR
                      receiver_currency: BTC
                      receiver_amount: '0.00020000'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationOrMalformedJson'
              examples:
                Duplicate foreign_id:
                  summary: Foreign ID already used
                  value:
                    errors:
                      foreign_id: The foreign id has already been taken.
                Missing required field:
                  summary: Currency field is required
                  value:
                    errors:
                      currency: The currency field is required.
                Invalid address format:
                  summary: Crypto address format invalid
                  value:
                    errors:
                      address: Invalid BTC address format.
                Amount below minimum:
                  summary: Amount too small
                  value:
                    errors:
                      amount: The amount must be at least 0.00010000 BTC.
                Amount exceeds balance:
                  summary: Insufficient balance
                  value:
                    errors:
                      amount: 'Insufficient balance. Available: 0.50000000 BTC.'
                Invalid tag for currency:
                  summary: Tag validation failed
                  value:
                    errors:
                      tag: Destination tag/memo for currencies that require it.
                Exchange rate unavailable:
                  summary: Unable to get exchange rate
                  value:
                    errors:
                      amount: >-
                        Unable to exchange the requested amount at the moment.
                        Specify a smaller amount or try again later.
                Multiple validation errors:
                  summary: Multiple fields failed validation
                  value:
                    errors:
                      currency: The currency field is required.
                      address: The address field is required.
                      amount: The amount must be greater than 0.
                Malformed JSON:
                  summary: Invalid JSON body
                  value:
                    error: Bad content format
                    code: bad_content_format
        '403':
          $ref: '#/components/responses/HeaderAuthorization'
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:
    sender_data_first_name:
      type: string
      maxLength: 255
      description: >-
        The sender's first name. This is required for a natural person. For a
        legal entity, do not include this parameter.
    sender_data_last_name:
      type: string
      maxLength: 255
      description: >-
        The sender's last name. This is required for a natural person. For a
        legal entity, do not include this parameter.
    sender_data_date_of_birth:
      type: string
      format: Y-m-d
      description: >-
        The sender's date of birth. For a legal entity, do not include this
        parameter.
    sender_data_email:
      type: string
      description: >-
        The sender's email. You can optionally include this parameter for both
        natural persons and legal entities. The formatting of the value is
        checked to make sure it is a valid email address.
    sender_data_legal_name:
      type: string
      description: >-
        The company's name. This is required for a legal entity. For a natural
        person, do not include this parameter.
    sender_data_country_of_registration:
      type: string
      description: >-
        The company's country of registration (ISO alpha-3 format, three
        characters). This is required for a legal entity. For a natural person,
        do not include this parameter.
    receiver_data_first_name:
      type: string
      description: >-
        The recipient's first name. This is required for a natural person. For a
        legal entity, do not include this parameter.
    receiver_data_last_name:
      type: string
      description: >-
        The recipient's last name. This is required for a natural person. For a
        legal entity, do not include this parameter.
    receiver_data_date_of_birth:
      type: string
      description: >-
        The recipient's date of birth, YYYY-MM-DD. This is required for a
        natural person. For a legal entity, do not include this parameter.
    ValidationOrMalformedJson:
      oneOf:
        - type: object
          title: ValidationError
          description: One or more request parameters failed validation.
          properties:
            errors:
              type: object
              additionalProperties:
                type: string
        - 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:
    HeaderAuthorization:
      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. Refer to
              [Errors](/api-reference/errors#403) for troubleshooting steps.
          examples:
            Bad signature header:
              value:
                error: Bad signature header
                code: bad_header_signature
            No signature header:
              value:
                error: No signature header
                code: required_header_signature
            Bad key header:
              value:
                error: Bad key header
                code: bad_header_key
            No key header:
              value:
                error: No key header
                code: required_header_key
  securitySchemes:
    xProcessingKey:
      type: apiKey
      description: Your [API key](/integration-guide/get-your-api-key).
      in: header
      name: X-Processing-Key

````