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

# 认证申请

## 功能说明

商户进件成功（`apply_status=SUCCESS`）后，为商户申请微信/支付宝认证（如 JSAPI 支付、当面付）。平台生成认证二维码，由商户扫码完成认证（微信/支付宝侧流程），认证结果通过[认证状态查询](./apply-query)获取。

* 认证申请按 `product_code` 定位支付方式（产品码见[产品清单](../appendix/products)），平台内部映射机构侧服务权限并透传；
* 每个产品码独立认证，需分别申请；
* 扫码认证需要**微信/支付宝子商户号**（`sub_merchant_code`）就绪；未就绪时平台自动重试兜底。

## 请求地址

`POST https://gw.xft.xin/openapi/v1/merchant/auth/req`

## 请求参数

| 字段              | 是否必选 | 字段类型   | 字段说明                                                |
| --------------- | ---- | ------ | --------------------------------------------------- |
| `merchant_code` | 是    | String | 平台商户号，进件成功后在通知与[进件状态查询](../merchant/apply-query)中下发 |
| `product_code`  | 是    | String | 平台产品码，见[产品清单](../appendix/products)                 |

## 响应参数

| 字段            | 是否必选 | 字段类型   | 字段说明                                    |
| ------------- | ---- | ------ | --------------------------------------- |
| `apply_no`    | 是    | String | 认证申请号，[认证状态查询](./apply-query)时使用（字段待确认） |
| `qr_content`  | 是    | String | 认证二维码内容/URL，商户扫码后进入认证流程（字段待确认）          |
| `auth_status` | 是    | String | 认证状态：`UNAUTHORIZED`（申请后未认证前）            |

<Note>
  认证为扫码流程，需商户在微信/支付宝侧完成授权，认证结果异步生效，请通过[认证状态查询](./apply-query)获取最终状态。
</Note>

## 示例

**请求**

```json theme={null}
{
  "merchant_code": "M202608150001",
  "product_code": "WECHAT_JSAPI"
}
```

**响应**

```json theme={null}
{
  "apply_no": "AUTH202608150001",
  "qr_content": "https://weixin.qq.com/q/xxxxx",
  "auth_status": "UNAUTHORIZED"
}
```

**失败示例**

```json theme={null}
{
  "code": 400,
  "reason": "INVALID_REQUEST",
  "message": "商户尚未完成渠道进件，无法发起认证",
  "metadata": { "apply_status": "PROCESSING" }
}
```
