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

# Crypto withdrawals integration guide

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

![Withdrawal flow: the customer initiates a withdrawal, the merchant sends it via the API, and a callback returns the transaction ID](https://mintcdn.com/cr-can/mbcsyiIu96I71U7S/images/withdrawals/withdrawal-flow.jpg?fit=max\&auto=format\&n=mbcsyiIu96I71U7S\&q=85\&s=815af2fca80dfbed81401780071d300b)

## Set up withdrawals

**1. Complete your onboarding**

Configure your account and get an API key, see [Initial setup](https://docs.ca.cryptoprocessing.com/initial-setup.md).

**2. 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](https://docs.ca.cryptoprocessing.com/withdrawals/design-withdrawal-form.md).

**3. Request a withdrawal**

Send a request to [/v2/withdrawal/crypto](https://docs.ca.cryptoprocessing.com/api-reference/endpoints/withdrawal-crypto.md). 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. It must be unique among your withdrawals and exchanges.
* `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.

**request body example**

```json theme={null}
{
  "amount": "100",
  "currency": "USD",
  "convert_to": "BTC",
  "address": "bc1qvad39lhdk64gymr78szh4zflf8uk5gtzkdh2eq",
  "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"
  }
}
```

**response body example**

```json 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": "USD",
    "receiver_currency": "BTC"
  }
}
```

**4. Process the callback**

Once the withdrawal is processed, CryptoProcessing will send you a [callback](https://docs.ca.cryptoprocessing.com/api-reference/callbacks/withdrawal-callbacks.md).


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