> ## 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/query`

## 请求参数

| 字段               | 类型         | 必填 | 说明                       |
| ---------------- | ---------- | -- | ------------------------ |
| `out_trade_no`   | string(64) | 是  | 商户提现申请订单号，业务系统提现时请求唯一流水号 |
| `third_trade_no` | string(64) | 是  | 原提现申请网商流水号               |

## 请求示例

```json theme={null}
{
  "out_trade_no": "0012b42cdbcb47d5b4b0b1e04d716f34",
  "third_trade_no": "202309120303127366"
}
```

## 响应参数

| 字段               | 类型     | 说明                                          |
| ---------------- | ------ | ------------------------------------------- |
| `out_trade_no`   | string | 外部交易码                                       |
| `third_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",
  "third_trade_no": "202309120303127366"
}
```

## 代码示例

```java theme={null}
XftMybankClient client = new DefaultXftMybankClient(
    "https://xhj-sit.91xft.cn", "111111111111", "xvnYAUWB00jEdIrkdrt5CtQQNB1x4Jhl");
XftWithdrawalQueryRequest request = new XftWithdrawalQueryRequest();
request.setOutTradeNo("0012b42cdbcb47d5b4b0b1e04d716f34");
request.setThirdTradeNo("202309120303127366");
XftWithdrawalQueryResponse response = client.execute(request);
```
