> For the complete documentation index, see [llms.txt](https://ajaib.gitbook.io/ajaib-exchange-open-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajaib.gitbook.io/ajaib-exchange-open-api/api-references/capital/withdraw-v2.md).

# Withdraw v2

`POST` `/v2/capital/withdraw`

**Functionality:** Transfer funds between exchanges or to a cold wallet.

**Authentication:** Required

#### Request Body

| Name            | Type   | Mandatory                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------- | ------ | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| coin            | string | <ul class="contains-task-list"><li><input type="checkbox" checked></li></ul> | The cryptocurrency symbol (e.g., "BTC", "ETH").                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| withdrawOrderId | string | <ul class="contains-task-list"><li><input type="checkbox"></li></ul>         | Client's reference ID. (Unique only if the withdrawal status is still `IN_PROGRESS`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| network         | string | <ul class="contains-task-list"><li><input type="checkbox" checked></li></ul> | <p>The blockchain network used for the transaction (e.g., "TRX\_BSC").</p><p>Refer to <a data-mention href="/ajaib-exchange-open-api/api-references/capital/all-coins-information.md">/pages/BFkK3lFT6P9EWcbyZjxw</a>.</p>                                                                                                                                                                                                                                                                                                                                      |
| address         | string | <ul class="contains-task-list"><li><input type="checkbox" checked></li></ul> | The recipient's withdrawal address.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| addressTag      | string | <ul class="contains-task-list"><li><input type="checkbox" checked></li></ul> | <p></p><p>Extra information required for certain networks (e.g., memo, destination tag).<br><br><strong>Note</strong> </p><p>Refer to network's <code>sameAddress</code> in <a data-mention href="/ajaib-exchange-open-api/api-references/capital/all-coins-information.md">/pages/BFkK3lFT6P9EWcbyZjxw</a>.</p><ul><li>if <code>sameAddress</code> is <code>true</code>, then <code>addressTag</code> is mandatory</li><li>if <code>sameAddress</code> is <code>false</code>, then <code>addressTag</code> must be NULL (must not send empty string)</li></ul> |
| amount          | string | <ul class="contains-task-list"><li><input type="checkbox" checked></li></ul> | The amount of the asset involved in the transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| recvWindow      | long   | <ul class="contains-task-list"><li><input type="checkbox"></li></ul>         | Number of milliseconds after timestamp the request is valid for. Refer to [this](https://ajaib.gitbook.io/ajaib-exchange-open-api/getting-started/timing-security).                                                                                                                                                                                                                                                                                                                                                                                             |
| timestamp       | long   | <ul class="contains-task-list"><li><input type="checkbox" checked></li></ul> | Timestamp when client sends the request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

#### Response Body

| Name            | Type   | Description                                              |
| --------------- | ------ | -------------------------------------------------------- |
| id              | string | Unique withdrawal ID.                                    |
| withdrawOrderId | string | Client's reference ID (if provided in the POST request). |

#### Error code

| Code   | Message                                                                                       |
| ------ | --------------------------------------------------------------------------------------------- |
| -1000  | An unknown error occurred while processing the request.                                       |
| -1004  | Server is busy, please wait and try again.                                                    |
| -1006  | An unexpected response was received from the message bus. Execution status unknown.           |
| -1021  | Missing timestamp.                                                                            |
| -1021  | timestamp 1744965768000 is outside of the allowed time window \[1744965893139-1744965899139]. |
| -1021  | recvWindow cannot be more than 5000 milliseconds or be less than zero.                        |
| -1102  | A mandatory parameter was blank, empty, or malformed.                                         |
| -1130  | Invalid coin.                                                                                 |
| -1130  | Invalid network.                                                                              |
| -1130  | Invalid amount.                                                                               |
| -1130  | Invalid amount, below minimum threshold.                                                      |
| -1130  | Invalid network for the given coin.                                                           |
| -1130  | Invalid address.                                                                              |
| -1099  | Exchange user account not found.                                                              |
| -1099  | Default configuration not found.                                                              |
| -1099  | Exchange address not found.                                                                   |
| -1099  | Deposit history not found.                                                                    |
| -4026  | User has insufficient balance.                                                                |
| -10001 | The system is under maintenance, please try again later.                                      |

{% tabs %}
{% tab title="200 OK" %}

```json
{
  "id": "6ade16ad-cb43-403a-9933-44ed8fcf5105",
  "withdrawOrderId": "4b13cdb1-b799-4f2c-871d-2964a7cbfa3b"
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```json
{
  "code": -4026,
  "msg": "User has insufficient balance"
}
```

{% endtab %}

{% tab title="401 Unauthorized" %}

```json
{
  "code": -1002,
  "msg": "Unauthorized"
}
```

{% endtab %}
{% endtabs %}
