> For the complete documentation index, see [llms.txt](https://docs.topay.mobi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.topay.mobi/cn/reference/api-reference/crypto-payments/withdrawal.md).

# 数字货币提币 API

{% hint style="warning" %}
每个请求都必须包含[公共参数](/cn/reference/api-reference/common-parameters.md)。
{% endhint %}

## 创建提币 <a href="#create-withdrawal" id="create-withdrawal"></a>

提交数字货币提币交易。

<mark style="color:green;">`POST`</mark> `https://api.topay.mobi/v1/order/withdraw`

#### 请求体 <a href="#request-body" id="request-body"></a>

| 名称                                                  | 类型     | 说明                              |
| --------------------------------------------------- | ------ | ------------------------------- |
| request\_id<mark style="color:red;">\*</mark>       | String | 商户提供的外部交易 ID                    |
| currency<mark style="color:red;">\*</mark>          | String | 要提币的数字货币资产名称                    |
| address<mark style="color:red;">\*</mark>           | String | 提币目标地址                          |
| tag                                                 | String | Ripple 的提币目标 tag；EOS/XLM 的 memo |
| amount<mark style="color:red;">\*</mark>            | String | 请求提币金额                          |
| notify\_url                                         | String | Webhook 通知地址                    |
| customer\_ref\_id<mark style="color:red;">\*</mark> | String | 商户用于将资金所有者（客户）与交易关联的 ID         |
| description                                         | String | 扩展信息，请勿存储敏感信息                   |

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

```java
{
 "data":
 {
    "order_no":"2022082020000600101063128149",
    "request_id":"custom_code9982674851738108",
    "partner_id":"2000001",
    "currency":"USDT_BSC",
    "address":"0x1234567890abcdef1234567890abcdef12345678",
    "tag":null,
    "order_amount":"150.000000000000000000",
    "arrive_amount":"148.500000000000000000",
    "fee":"1.500000000000000000",
    "status":22,
    "fail_reason":""
 },
 "code":"200",
 "message":"Success"
}

```

{% endtab %}
{% endtabs %}

<details>

<summary>代码示例</summary>

```javascript
// Some code

curl --location --request POST 'https://api.topay.mobi/v1/order/withdraw' \
--header 'Content-Type: application/json' \
--data-raw '{
    "partner_id": "2000001",
    "sign_type": "RSA",
    "timestamp": "1688371190",
    "nonce": "abccefeafjkjsl",
    "sign": "examplesignnotcorrect",
    "request_id": "custom_code9982674851738108",
    "currency": "USDT_BSC",
    "customer_ref_id": "USER_123",
    "address": "0x1234567890abcdef1234567890abcdef12345678",
    "amount": "150",
      "notify_url": "https://notify.url",
      "description": ""

}'
```

</details>

地址仅供示例说明。请使用 Topay 实际返回的充值地址，或所选网络上真实的收款人地址。

示例中的时间戳和签名为占位值。发送前请生成当前的秒级 Unix 时间戳，并为请求签名。

## 预估提币手续费 <a href="#estimate-withdrawal-fee" id="estimate-withdrawal-fee"></a>

预估数字货币提币手续费。

<mark style="color:green;">`POST`</mark> `https://api.topay.mobi/v1/fee/estimate`

#### 请求体 <a href="#estimate-withdrawal-fee-request-body" id="estimate-withdrawal-fee-request-body"></a>

| 名称                                         | 类型     | 说明           |
| ------------------------------------------ | ------ | ------------ |
| currency<mark style="color:red;">\*</mark> | String | 数字货币资产名称     |
| amount<mark style="color:red;">\*</mark>   | String | 用于预估手续费的请求金额 |

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

```javascript
{
    code: '200',
    data: {
      partner_id: '2000051',
      currency: 'TRX',
      fee_amount: '1.1',
      min_threshold: '0',
      decimals: 18
    },
    message: 'success'
  }
```

{% endtab %}
{% endtabs %}
