> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stablepayfi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a withdrawal

> Create a withdrawal

See [authentication, signing, data conventions, and errors](https://docs.stablepayfi.ai/en/api/global-accounts/overview). Regenerate the timestamp, nonce, and signature on every retry.

`POST /fund/withdrawals` Sends stablecoins to an external wallet using a recipient for address and network.

## Request headers

**Authorization** `string` *required*

Bearer API Key.

**X-StablePay-Timestamp** `string` *required*

Unix seconds, within five minutes of server time.

**X-StablePay-Nonce** `string` *required*

Unique per request, 16–64 characters.

**X-StablePay-Signature** `string` *required*

Lowercase hexadecimal HMAC-SHA256 signature for the exact request body.

**Idempotency-Key** `string`

Idempotency key; same key with different parameters returns 409

## Request parameters

**merchant\_id** `string`

10 digits; omit for merchant apps, required for service-provider apps

**external\_withdrawal\_id** `string`

Business reference forming the idempotency key

**account\_no** `string`

Debit account; defaults to the primary account

**currency** `string` *required*

Stablecoin

**amount** `integer` *required*

Amount received by payee

**recipient\_id** `string` *required*

Recipient of type `stablecoin_address`

**metadata** `object`

Up to 20 key-value pairs

## Response

**withdrawal\_id** `string` *required*

Withdrawal ID

**merchant\_id** `string` *required*

Merchant ID

**external\_withdrawal\_id** `string`

Business reference

**account\_no** `string` *required*

Debit account

**currency** `string` *required*

Stablecoin

**amount** `integer` *required*

Amount received by payee

**recipient\_id** `string`

Recipient ID

**network** `string` *required*

Network

**recipient** `object` *required*

address and memo

**tx\_hash** `string`

Transaction hash

**status** `string` *required*

processing, `payment_submitted`, completed, `bounced_back`

**failure\_reason** `string`

Failure reason

**metadata** `object`

Custom metadata

**created** `integer` *required*

Creation time

**updated** `integer`

Last update time

## Status and errors

400 invalid parameters; 404 unknown recipient; 409 idempotency conflict or insufficient funds.

```bash cURL theme={"system"}
curl --request POST \
  --url "https://api.stablepay.co/api/v1/fund/withdrawals" \
  --header "Authorization: Bearer <API_KEY>" \
  --header "X-StablePay-Timestamp: <TIMESTAMP>" \
  --header "X-StablePay-Nonce: <NONCE>" \
  --header "X-StablePay-Signature: <SIGNATURE>" \
  --header "Content-Type: application/json" \
  --data '{
  "merchant_id": "2000000001",
  "currency": "USDC",
  "amount": 10000,
  "recipient_id": "9000000080"
}'
```

```javascript JavaScript theme={"system"}
const response = await fetch("https://api.stablepay.co/api/v1/fund/withdrawals", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <API_KEY>",
    "X-StablePay-Timestamp": "<TIMESTAMP>",
    "X-StablePay-Nonce": "<NONCE>",
    "X-StablePay-Signature": "<SIGNATURE>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "merchant_id": "2000000001",
    "currency": "USDC",
    "amount": 10000,
    "recipient_id": "9000000080"
  })
});
console.log(await response.json());
```

```json 200 theme={"system"}
{
  "withdrawal_id": "9000000060",
  "merchant_id": "2000000001",
  "account_no": "00000001",
  "currency": "USDC",
  "amount": 10000,
  "recipient_id": "9000000080",
  "network": "solana",
  "recipient": {
    "address": "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YymTvAVmRoz"
  },
  "status": "processing",
  "created": 1718726403,
  "updated": 1718726403
}
```


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