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

# 创建提现

> 创建提现

完整[认证、签名、数据约定与错误响应](https://docs.stablepayfi.ai/zh/api/global-accounts/overview)。每次重试均须重新生成时间戳、nonce 与签名。

`POST /fund/withdrawals` 从账户把稳定币提到外部钱包，地址与网络取自收款人。

## 请求头

**Authorization** `string` *required*

Bearer API Key。

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

Unix 秒，允许与服务端相差最多 5 分钟。

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

每次请求唯一的随机串，16–64 字符。

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

HMAC-SHA256 签名，小写十六进制；签名必须对应实际发送的请求体。

**Idempotency-Key** `string`

幂等键，相同键不同参数返回 409

## 请求参数

**merchant\_id** `string`

10 位数字；商户 App 不传，服务商 App 必传

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

业务参考号，与 `merchant_id` 组成幂等键

**account\_no** `string`

出账账户，默认该币种主账户

**currency** `string` *required*

稳定币币种

**amount** `integer` *required*

收款方收到的金额

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

`stablecoin_address` 类型收款人

**metadata** `object`

最多 20 对 key-value

## 响应

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

提现 ID，10 位数字

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

商户 ID

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

业务参考号

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

出账账户编号

**currency** `string` *required*

稳定币币种

**amount** `integer` *required*

收款方收到金额

**recipient\_id** `string`

收款人 ID

**network** `string` *required*

提现网络

**recipient** `object` *required*

address 与 memo

**tx\_hash** `string`

链上交易哈希

**status** `string` *required*

processing、`payment_submitted`、completed、`bounced_back`

**failure\_reason** `string`

拒收原因

**metadata** `object`

自定义元数据

**created** `integer` *required*

创建时间

**updated** `integer`

最近更新时间

## 状态与错误

400 参数不合法；404 收款人不存在；409 幂等冲突或余额不足。

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