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

# Crypto withdrawals integration guide

If your customers have a balance on your site, you can provide withdrawals in crypto.

<Frame>
  <img src="https://mintcdn.com/cryptoprocessing/ROCimFHd2v59e4Kf/images/withdrawals/withdrawal-flow.jpg?fit=max&auto=format&n=ROCimFHd2v59e4Kf&q=85&s=9e7e4485a915b8208b3cfd0959d08732" alt="" width="1920" height="1080" data-path="images/withdrawals/withdrawal-flow.jpg" />
</Frame>

## Set up withdrawals

<Steps>
  <Step title="Complete your onboarding">
    Complete your onboarding in your merchant dashboard and generate an API key. For more details on how to create an API key, see [Get your API key](/merchant-administration/generate-and-activate-api-keys).
  </Step>

  <Step title="Design a withdrawal form">
    Add a withdrawal form to your site. For our recommendations on how to design the form, see [Design a withdrawal form](/withdrawals/design-withdrawal-form).
  </Step>

  <Step title="Request a withdrawal">
    Send a request to [/api/v2/withdrawal/crypto](/api-reference/endpoints/withdrawal-crypto). To request a withdrawal with exchange, include the `convert_to` parameter.

    You will also need to include these required parameters:

    * `foreign_id` is the unique ID of the withdrawal request. You can use any format you prefer.
    * `end_user_reference` is the customer's unique ID. CryptoProcessing uses it to group withdrawal requests made by each customer. It must not contain any identifying information, such as the customer's name.

    ```json title="Request example" theme={null}
    {
      "amount": "100",
      "currency": "EUR",
      "convert_to": "BTC",
      "address": "tb1qfdxh6gkfr0qgyatnlkd8khcnxph9tw06n6qwjc",
      "foreign_id": "withdrawal_123",
      "end_user_reference": "user_12345",
      "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"
      }
    }
    ```

    ```json title="Response example" theme={null}
    {
      "data": {
        "id": 134702831,
        "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": "BTC"
      }
    }
    ```
  </Step>

  <Step title="Process the callback">
    Once the withdrawal is processed, CryptoProcessing will send you a [callback](/api-reference/callbacks/withdrawal-callbacks).
  </Step>
</Steps>
