> For the complete documentation index, see [llms.txt](https://docs.betaramps.com/documentation-beta-ramps/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.betaramps.com/documentation-beta-ramps/exchange-crypto-to-fiat/crypto-and-fiat-withdrawal.md).

# Crypto and Fiat Withdrawal

## Withdrawal to an external Wallet

<mark style="color:green;">`POST`</mark> `https://live.betaapp.com/v1/order/withdrawal`

#### Headers

| Name                                               | Type   | Description            |
| -------------------------------------------------- | ------ | ---------------------- |
| Authorization<mark style="color:red;">\*</mark>    | String | Bearer {access\_token} |
| x-sub-account-id<mark style="color:red;">\*</mark> | String | Sub Account ID         |
| accept<mark style="color:red;">\*</mark>           | String | application/json       |

#### Request Body

| Name                                                  | Type   | Description                                                           |
| ----------------------------------------------------- | ------ | --------------------------------------------------------------------- |
| target\_asset<mark style="color:red;">\*</mark>       | String | Crypto asset                                                          |
| network<mark style="color:red;">\*</mark>             | String | Crypto asset's network                                                |
| target\_destination<mark style="color:red;">\*</mark> | String | Crypto wallet                                                         |
| target\_amount<mark style="color:red;">\*</mark>      | String | Amount to be processed                                                |
| target\_destination\_tag                              | String | Crypto wallet tag (If applicable)                                     |
| instant\_payment\_type                                | String | <p>Only for Fiat Withdrawal</p><p>Brazil: PIX </p><p>Mexico: SPEI</p> |

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

{% endtab %}

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

{% endtab %}
{% endtabs %}

**Request Example for Crypto Withdrawal:**

```json
curl -X 'POST' \
  'https://live.betaapp.com/v1/order/withdrawal' \
  -H 'accept: application/json' \
  -H 'X-sub-account-id: 22376b76...43083b' \
  -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJlaEF1NURPY...ctfx2I4g' \
  -H 'Content-Type: application/json' \
  -d '{
  "instant_payment_type": "",
  "network": "bitcoin",
  "target_amount": 1,
  "target_asset": "BTC",
  "target_destination": "014027...57", 
  "target_destination_tag": "" 
}'
```

{% hint style="info" %}
For Fiat Withdrawals you only need to inform the `instant_payment_type, asset, and target_amount` fields. The withdrawal will be processed to the registered subaccount's bank account details.
{% endhint %}

**Request Example for Fiat Withdrawal:**

```json
curl -X 'POST' \
  'https://live.betaapp.com/v1/order/withdrawal' \
  -H 'accept: application/json' \
  -H 'X-sub-account-id: 22376b76...43083b' \
  -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJlaEF1NURPY...ctfx2I4g' \
  -H 'Content-Type: application/json' \
  -d '{
  "instant_payment_type": "PIX",
  "network": "",
  "target_amount": 100,
  "target_asset": "BRL",
  "target_destination": "", 
  "target_destination_tag": "" 
}'
```

**Response Example for both Fiat and Crypto:**

{% code overflow="wrap" %}

```json
{
  "amount": 1,
  "asset": {
    "large_image_url": "https://storage.googleapis.com/cryptoassets_images/69px/BTC-69.png",
    "medium_image_url": "https://storage.googleapis.com/cryptoassets_images/35px/BTC-35.png",
    "name": "Bitcoin",
    "small_image_url": "https://storage.googleapis.com/cryptoassets_images/20px/BTC-20.png",
    "type": "crypto"
  },
  "date_time": "2023-11-22T13:09:33.079445313Z",
  "deposit": false,
  "exp_time": 1200,
  "message": "Success",
  "network": "bitcoin"
}
```

{% endcode %}
