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

# 结算账单下载接口

## 功能说明

查询商户指定日期的结算账单下载链接。账单文件生成后通过该接口获取临时下载地址，商户可在有效期内完成文件下载。

业务失败（如账单不存在、链接生成失败）通过响应中的 `failure_code` 和 `failure_msg` 字段返回，不会返回 HTTP 错误。

## 请求地址

`POST /v1/settlement/merchant/bill/get`

## 请求参数

| 字段 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `bill_date` | string | 是 | 账单日期，格式：`yyyy-MM-dd`，如 `2025-10-01` |
| `merchant_code` | string | 是 | 商户编号 |

## 请求示例

```json theme={"system"}
{
  "bill_date": "2025-10-01",
  "merchant_code": "226801000000865319122"
}
```

## 响应参数

| 字段 | 类型 | 说明 |
| - | - | - |
| `download_url` | string | 账单文件下载链接，临时地址请在有效期内及时下载 |
| `failure_code` | string | 业务错误码，成功时为空。账单不存在或链接生成失败时返回对应错误码 |
| `failure_msg` | string | 业务错误描述，成功时为空 |

## 响应示例

### 成功响应

```json theme={"system"}
{
  "download_url": "https://example.com/bill/2025-10-01/226801000000865319122.xlsx?token=xxx&expire=1727769600",
  "failure_code": "",
  "failure_msg": ""
}
```

### 失败响应（业务错误）

```json theme={"system"}
{
  "download_url": "",
  "failure_code": "BILL_NOT_FOUND",
  "failure_msg": "该日期暂无结算账单"
}
```

> [!NOTE]
>
> 该接口返回的是业务级错误（通过 `failure_code` / `failure_msg` 体现），HTTP 状态码仍为 `200`。请优先判断 `failure_code` 是否为空来确定业务是否成功。


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