# 商户接入说明

### 一、登录商户后台

1. 联系运营人员获取以下信息（仅供测试使用）：
   * 商户后台链接
   * 登录账号
   * 登录密码
2. 登录后，点击右上角 **「API接口设置」** 进入接口配置页面。

![](/files/JK93V5Uyl8CXqNpDRyBn)

***

### 二、API接口设置

1. 点击 重新生成 按钮。
2. 输入 **谷歌验证码**。
3. 点击 **「提交」** 后生效。

<figure><img src="/files/x7gOj3nQD0xY7F0FbhMu" alt=""><figcaption></figcaption></figure>

***

### 三、接口调用说明

#### 请求头设置

在请求 Header 中加入以下字段：

```
Authorization: Bearer {商户ID}
```

**示例：**

```
Authorization: Bearer 854498852339712
```

***

### 四、回调说明

1. 回调失败将自动重试 **3 次**。
2. 回调请求方式：`POST`
3. 回调内容为 **AES 加密的 JSON 字符串**。

#### 示例：渠道代收回调

```json
{
  "sourceNo": "商户订单号",
  "data": "加密后的代收订单详情(具体参数参考 get 返回值)"
}
```

#### 示例：解密后的代收订单详情

```json
{
  "creditOrderSimpleInfo": {
    "id": 1,
    "merchantSourceNo": "text",
    "amount": 1,
    "actualAmount": 1,
    "processCode": 0,
    "createdTime": 1,
    "updatedTime": 1,
    "closedTime": 1,
    "cashierLink": "text",
    "upiLink": "text",
    "callbackCode": 0,
    "payerDetail": {
        "accountCode": 1,
        "realName": "text",
        "accountNo": "text",
        "bankName": "text",
        "ifsc": "text"
    },
    "payeeDetail": {
        "accountCode": 1,
        "realName": "text",
        "accountNo": "text",
        "bankName": "text",
        "ifsc": "text"
    },
    "voucherDetail": {
        "utr": "text",
        "note": "text",
    }
  }
}
```

***

### 五、AES 加密说明

| 参数项  | 说明          |
| ---- | ----------- |
| 运算模式 | ECB         |
| 填充模式 | PKCS7       |
| 秘钥长度 | 256 bits    |
| 秘钥   | 同 AccessKey |
| 字符编码 | UTF-8       |
| 输出格式 | Base64      |

#### 🔑 示例

| 项目   | 值                                  |
| ---- | ---------------------------------- |
| 原始值  | `Test`                             |
| 秘钥   | `ecb797f9e9feab0a92ab283978d33711` |
| 加密结果 | `M2SwiX1fxQ5aJ34scDi0zA==`         |

👉 可使用在线工具测试：[**AES 加密工具**](https://www.toolhelper.cn/SymmetricEncryption/AES)

***

### 六、环境说明

#### 环境地址

| 环境   | Endpoint                      |
| ---- | ----------------------------- |
| 测试环境 | `https://api-beta.upibee.com` |
| 生产环境 | `联系运营人员获取`                    |

#### ⚠️ 上线前须完成以下事项

1. 联系运营人员获取 **生产环境商户后台链接**；
2. **重新申请并配置 AccessKey**；
3. 设置并验证 API设置；

> 以上配置完成并通过测试后，方可切换至生产环境进行业务操作。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.upibee.com/shang-hu-jie-ru-shuo-ming.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
