绑卡H5收银台
获取 H5 收银台 URL,引导用户浏览器打开 cashier_url 完成绑卡(页面签约/一键绑卡/H5 短信确认)。account_info 须按姓名|证件号|证件类型拼接后数字信封加密。绑卡成功后经请求中的 notify_url 异步通知(绑卡成功通知格式)。risk_control_info 非必填,禁止固定占位值。
接口说明
请求方式:【POST】/v1/protocol/sign/h5-cashier
请求域名:【主域名】https://api.baofu.com
请求参数
Header 参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | true | 请参考【开发指引-整体说明】生成认证信息 |
| Accept | string | true | 请设置为 application/json |
| Content-Type | string | true | 请设置为 application/json |
Body 参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| out_trade_no | string | true | 商户订单号,唯一,≤32 字符 |
| merchant_user_id | string | true | 商户用户 ID,≤50 字符 |
| account_info | string | true | 账户信息,格式见 account_info 加密说明;敏感字段,请求由商户数字信封加密 |
| front_url | string | true | 绑卡成功浏览器跳转 URL,≤255 字符 |
| front_fail_url | string | true | 绑卡失败浏览器跳转 URL,≤255 字符 |
| notify_url | string | true | 绑卡结果异步通知 URL,≤255 字符 |
| risk_control_info | object | false | 风控参数,键值对结构;按商户开通行业传真实交易信息,禁止固定占位值 |
| bank_card_type | string | false | 银行卡类型:101 借记 / 102 贷记 |
| bank_code | string | false | 银行编码,≤50 字符 |
| memo | string | false | 扩展 JSON 字符串 |
| merchant_id | string | false | 代理商被代理方商户号或统一会员编号,规则见入网资料 |
| app_id | string | false |
account_info 为敏感字段,传输前须数字信封加密。明文格式:姓名|证件号|证件类型(证件类型默认01身份证)。示例明文:张三|110101199001011234|01。加密流程:拼接明文字符串→商户私钥数字信封加密→填入 account_info 并上送 Baofu-Digital-Envelope Header→统一网关解密后解析。
risk_control_info 为键值对对象,H5 收银台下整体及子字段均为非必填;有值时按行业惯例透传落库。禁止传固定占位值。
risk_control_info H5 常见字段:register_time(yyyyMMddHHmmss)、login_type(如 MOBILE)、device_id;协议支付类通用风控字段见数据字典 risk_control_info
请求示例
{
"out_trade_no": "MCH20260622001",
"merchant_user_id": "user_001",
"account_info": "张三|110101199001011234|01",
"front_url": "https://merchant.example.com/bind/success",
"front_fail_url": "https://merchant.example.com/bind/fail",
"notify_url": "https://merchant.example.com/notify/bind",
"risk_control_info": {
"register_time": "20260101120000",
"login_type": "MOBILE",
"device_id": "device-abc-123",
"goodsCategory": "06",
"userLoginId": "user_001",
"chPayIp": "203.0.113.10"
},
"bank_card_type": "101"
}
应答参数
200 OK
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| trade_status | string | true | 受理成功为 SUCCESS |
| trade_status_desc | string | false | 状态描述 |
| out_trade_no | string | false | 商户订单号 |
| channel_order_no | string | false | 宝付前置单号 |
| cashier_url | string | true | H5 收银台 URL,引导用户浏览器打开完成绑卡 |
应答示例
200 OK
{
"trade_status": "SUCCESS",
"trade_status_desc": "受理成功",
"out_trade_no": "MCH20260622001",
"channel_order_no": "20260622143022000123456789012345",
"cashier_url": "https://cashier.example.com/sign/h5?orderNo=..."
}
错误码
公共错误码
| 状态码 | 错误码 | 描述 | 解决方案 |
|---|---|---|---|
| 401 | SIGN_ERROR | 验证不通过 | 请参阅【开发指引-整体说明】排查签名 |
| 400 | PARAM_ERROR | 参数错误 | 请根据错误提示正确传入参数 |
| 500 | SYSTEM_ERROR | 系统异常,请稍后重试 | 请稍后重试 |