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

# Withdraw crypto

> Withdraw in crypto to any address.



## 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.alphapo.net/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:
                  $ref: '#/components/schemas/end_user_reference.withdrawals'
              required:
                - currency
                - amount
                - address
                - foreign_id
            examples:
              Withdraw USDC:
                value:
                  currency: USDC
                  amount: '100'
                  address: '0x35f6005cfA94a1c030B8c4dfcc29D4eB8a6865bF'
                  foreign_id: withdrawal_123
                  end_user_reference: user_12345
              Withdraw USDC with conversion from EUR:
                value:
                  currency: EUR
                  convert_to: USDC
                  amount: '100'
                  address: '0x35f6005cfA94a1c030B8c4dfcc29D4eB8a6865bF'
                  foreign_id: withdrawal_123
                  end_user_reference: user_12345
              Withdraw USDC with conversion and target amount:
                value:
                  currency: EUR
                  convert_to: USDC
                  amount_to: '100'
                  address: '0x35f6005cfA94a1c030B8c4dfcc29D4eB8a6865bF'
                  foreign_id: withdrawal_123
                  end_user_reference: user_12345
      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:
                        $ref: '#/components/schemas/end_user_reference.withdrawals'
                      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 withdrawals without
                          conversion.
                      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'
                Withdraw USDC with conversion from EUR:
                  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: EUR
                      receiver_currency: USDC
                Withdraw USDC with conversion and target amount:
                  value:
                    data:
                      id: 132541648
                      foreign_id: withdrawal_123
                      end_user_reference: user_12345
                      type: withdrawal_exchange
                      status: processing
                      sender_currency: EUR
                      receiver_currency: USDC
                      receiver_amount: '100.00000000'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationOrMalformedJson'
              examples:
                Missing currency:
                  summary: currency field is required
                  value:
                    errors:
                      currency: The currency field is required.
                Invalid currency:
                  summary: Currency doesn't exist
                  value:
                    errors:
                      currency: Invalid currency
                Invalid convert_to:
                  summary: convert_to currency doesn't exist
                  value:
                    errors:
                      convert_to: Invalid currency
                Amount not a number:
                  summary: amount is not numeric
                  value:
                    errors:
                      amount: The amount must be a number.
                Amount too many decimals:
                  summary: amount has too many decimal places
                  value:
                    errors:
                      amount: The amount must not have more than X decimal places.
                Amount_to not a number:
                  summary: amount_to is not numeric
                  value:
                    errors:
                      amount_to: The amount to must be a number.
                Amount_to too many decimals:
                  summary: amount_to has too many decimal places
                  value:
                    errors:
                      amount_to: The amount to must not have more than X decimal places.
                Missing amount:
                  summary: amount is required when amount_to is not present
                  value:
                    errors:
                      amount: >-
                        The amount field is required when amount to is not
                        present.
                Amount not positive:
                  summary: amount must be greater than 0
                  value:
                    errors:
                      amount: The amount field must be greater than 0.
                Missing amount_to:
                  summary: amount_to is required when amount is not present
                  value:
                    errors:
                      amount_to: >-
                        The amount to field is required when amount is not
                        present.
                Amount_to not positive:
                  summary: amount_to must be greater than 0
                  value:
                    errors:
                      amount_to: The amount to field must be greater than 0.
                Missing convert_to:
                  summary: convert_to is required when amount_to is present
                  value:
                    errors:
                      convert_to: >-
                        The convert to field is required when amount to is
                        present.
                Missing foreign_id:
                  summary: foreign_id field is required
                  value:
                    errors:
                      foreign_id: The foreign id field is required.
                Duplicate foreign_id:
                  summary: foreign_id already used
                  value:
                    errors:
                      foreign_id: The foreign id has already been taken.
                Invalid end_user_reference:
                  summary: end_user_reference must not contain an email address
                  value:
                    errors:
                      end_user_reference: >-
                        The end user reference must not contain an email
                        address.
                Invalid address format:
                  summary: Crypto address format invalid
                  value:
                    errors:
                      address: Invalid USDC address
                Amount below minimum:
                  summary: Amount too small
                  value:
                    errors:
                      amount: The amount must be 5.00000000 USDC.
                Amount exceeds balance:
                  summary: Insufficient balance
                  value:
                    errors:
                      amount: The requested amount exceeds the available balance.
                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 (sender-amount variant)
                  value:
                    errors:
                      amount: >-
                        Unable to exchange the requested amount at the moment.
                        Specify a smaller amount or try again later.
                Exchange rate unavailable (amount_to):
                  summary: Unable to get exchange rate (target-amount variant)
                  value:
                    errors:
                      amount_to: >-
                        Unable to exchange the requested amount at the moment.
                        Specify a smaller amount or try again later.
                Malformed JSON:
                  summary: Invalid JSON body
                  value:
                    error: Bad content format
                    code: bad_content_format
        '403':
          $ref: '#/components/responses/HeaderAuthorization'
        '422':
          $ref: '#/components/responses/InternalError'
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.


        Do not include personal data, such as the customer's name or email
        address.
    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-forbidden) 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
    InternalError:
      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"`.
      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:
            Internal error:
              summary: Generic internal error
              value:
                errors:
                  - Internal error
                error_code: internal_error
            Something went wrong:
              summary: Processing error
              value:
                errors:
                  - Something went wrong. Please try later.
                error_code: internal_error
            Unhandled exception:
              summary: Generic unhandled exception
              value:
                errors:
                  - Something went wrong.
                error_code: internal_error
  securitySchemes:
    xProcessingKey:
      type: apiKey
      description: Your [API key](/merchant-administration/generate-and-activate-api-keys).
      in: header
      name: X-Processing-Key

````