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

# 商户余额提现确认

## 功能说明

收支平台手动对平台、门店发起提现，提现申请审核通过，且申请冻结余额后，需二次调用商户余额提现确认接口。该接口为异步接口，请求后通过商户余额提现查询接口查询最终状态。

## 请求地址

`POST /withdrawal/confirm`

## 请求参数

| 字段               | 类型          | 必填 | 说明                                      |
| ---------------- | ----------- | -- | --------------------------------------- |
| `out_trade_no`   | string(64)  | 是  | 商户提现申请订单号，必须与提现申请时的 `out_trade_no` 保持一致 |
| `third_trade_no` | string(64)  | 是  | 原提现申请网商流水号                              |
| `merchant_code`  | string(32)  | 是  | 商户号                                     |
| `total_amount`   | int(11)     | 是  | 提现金额，单位"分"                              |
| `fee`            | int(11)     | 否  | 手续费，提现每笔 0.5 元                          |
| `attach`         | string(200) | 否  | 提现备注                                    |

## 请求示例

```json theme={null}
{
  "attach": "测试001",
  "currency": "CNY",
  "fee": 0,
  "merchant_code": "226801000000865319122",
  "out_trade_no": "0012b42cdbcb47d5b4b0b1e04d716f34",
  "third_trade_no": "202309120303127366",
  "total_amount": 1
}
```

## 响应参数

| 字段              | 类型     | 说明                                                              |
| --------------- | ------ | --------------------------------------------------------------- |
| `out_trade_no`  | string | 商户提现申请订单号                                                       |
| `state`         | string | 提现状态；`succeeded` 成功；`fail` 失败；`pending` 表示此处提现确认成功，最终结果通过查询接口查询 |
| `merchant_code` | string | 商户号                                                             |
| `total_amount`  | int    | 提现金额，单位"分"                                                      |
| `currency`      | string | 币种                                                              |
| `fee`           | int    | 手续费（V0.0.3 新增字段，表示扣除的手续费金额）                                     |
| `attach`        | string | 提现备注                                                            |

## 响应示例

```json theme={null}
{
  "out_trade_no": "0012b42cdbcb47d5b4b0b1e04d716f34",
  "merchant_code": "226801000000865319122",
  "total_amount": 1,
  "currency": "CNY",
  "fee": 0,
  "attach": "测试001",
  "state": "succeeded"
}
```

## 代码示例

```java theme={null}
XftMybankClient client = new DefaultXftMybankClient(
    "https://xhj-sit.91xft.cn", "111111111111", "xvnYAUWB00jEdIrkdrt5CtQQNB1x4Jhl");
XftWithdrawalConfirmRequest request = new XftWithdrawalConfirmRequest();
request.setOutTradeNo("0012b42cdbcb47d5b4b0b1e04d716f34");
request.setThirdTradeNo("202309120303127366");
request.setMerchantCode("");
request.setCurrency("CNY");
request.setAttach("测试01");
request.setTotalAmount(0);
request.setFee(0);
XftWithdrawalConfirmResponse response = client.execute(request);
```
