> ## 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 instantly with conversion

> Make an [instant withdrawal](/withdrawals#instant-withdrawals) from a cryptocurrency or fiat balance with conversion to cryptocurrency.



## OpenAPI

````yaml POST /v2/crypto/withdrawal_instant_exchange
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
security:
  - xProcessingKey: []
tags:
  - name: Status
  - name: Balance
  - name: Currencies
  - name: Deposit addresses
  - name: Withdrawal
  - name: Exchange
  - name: Invoices
  - name: Transactions
paths:
  /v2/crypto/withdrawal_instant_exchange:
    post:
      tags:
        - Withdrawal
      summary: Withdraw BTC with conversion from EUR
      description: >-
        Make an [instant withdrawal](/withdrawals#instant-withdrawals) from a
        cryptocurrency or fiat balance with conversion to cryptocurrency.
      operationId: post-crypto-withdrawal-instant-exchange
      parameters:
        - $ref: '#/components/parameters/XProcessingSignatureHeader'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                sender_currency:
                  type: string
                  description: >-
                    Currency to withdraw. For a list of all available
                    currencies, see [API currency
                    codes](/api-reference/currency-codes).
                received_currency:
                  type: string
                  description: Target currency to convert funds into before sending.
                sender_amount:
                  type: number
                  description: Amount to withdraw in `sender_currency`.
                address:
                  type: string
                  description: Cryptocurrency address where you want to send funds.
                foreign_id:
                  description: Unique ID of the withdrawal request.
                end_user_reference:
                  $ref: '#/components/schemas/end_user_reference.withdrawals'
              required:
                - sender_currency
                - received_currency
                - sender_amount
                - address
                - foreign_id
            examples:
              Withdraw BTC with conversion from EUR:
                value:
                  sender_currency: EUR
                  received_currency: BTC
                  sender_amount: '100'
                  address: tb1qfdxh6gkfr0qgyatnlkd8khcnxph9tw06n6qwjc
                  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 (always
                          `withdrawal_instant_exchange`).
                      status:
                        type: string
                        description: Transaction status.
                      sender_currency:
                        type: string
                        description: Source currency ISO code.
                      sender_amount:
                        type: string
                        description: Withdrawal amount in `sender_currency`.
                      received_currency:
                        type: string
                        description: Destination currency ISO code.
                      received_amount:
                        type: string
                        description: Amount sent in `received_currency`.
              examples:
                Withdraw BTC with conversion from EUR:
                  value:
                    data:
                      id: 134702815
                      foreign_id: withdrawal_123
                      end_user_reference: user_12345
                      type: withdrawal_instant_exchange
                      status: processing
                      sender_currency: EUR
                      sender_amount: '100.00000000'
                      received_currency: BTC
                      received_amount: '0.00153827'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationOrMalformedJson'
              examples:
                Instant_withdrawals_disabled:
                  summary: Instant withdrawals are disabled
                  value:
                    errors:
                      amount: Instant withdrawals are disabled for this merchant.
                Instant_withdrawals_not_supported_for_sender_currency:
                  summary: Instant withdrawals are not supported for this currency
                  value:
                    errors:
                      sender_currency: >-
                        Instant withdrawals are not supported for the specified
                        sender_currency.
                Duplicate foreign_id:
                  summary: Foreign ID already used
                  value:
                    errors:
                      foreign_id: The foreign id has already been taken.
                Missing required field:
                  summary: Sender currency field is required
                  value:
                    errors:
                      currency: The sender_currency field is required.
                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.
                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:
                      sender_currency: The sender_currency field is required.
                      address: The address field is required.
                      sender_amount: The sender_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/WithdrawalHeaderAuthorization'
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:
    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, or withdrawals are disabled for the
              merchant. 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
            Withdrawals disabled:
              summary: Withdrawals are disabled for this merchant
              value:
                error: Withdrawal functionality is currently unavailable
                code: withdrawal_functionality_unavailable
  securitySchemes:
    xProcessingKey:
      type: apiKey
      description: Your [API key](/merchant-administration/generate-and-activate-api-keys).
      in: header
      name: X-Processing-Key

````