绑卡+开户
未开户则申请绑卡链接并开户;已开户则返回账户信息,不发起绑卡。建议超时 5000ms。幂等键:商户号 + out_trade_no。
接口说明
请求方式:【POST】/v1/wallet/account/open
请求域名:【主域名】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 | 商户订单号;最长 64 |
| real_name | string | true | 姓名;最长 128 |
| identity_document_no | string | true | 证件号(敏感字段,须数字信封加密);最长 64 |
| identity_document_type | string | true | 证件类型;最长 16;如 ID_CARD |
| mobile | string | true | 手机号(敏感字段,须数字信封加密);最长 20 |
| page_url | string | true | 绑卡完成后回跳地址;最长 256;URL |
| notify_url | string | true | 绑卡/开户终态异步通知地址;最长 256;HTTPS URL |
请求示例
{
"out_trade_no": "MCH202505250001",
"real_name": "张三",
"identity_document_no": "310101199001011234",
"identity_document_type": "ID_CARD",
"mobile": "13800138000",
"page_url": "https://merchant.example.com/bind/return",
"notify_url": "https://merchant.example.com/callback/wallet/bind"
}
应答参数
200 OK
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| out_trade_no | string | true | 商户订单号 |
| trade_no | string | true | 平台交易号;须保存用于查单(未开户分支) |
| url | string | true | 绑卡申请入口地址(未开户分支) |
| token | string | true | 会话 token(明文)(未开户分支) |
| expire_time | string | true | 链接/token 过期时间,ISO 8601(未开户分支) |
| account_opened | boolean | true | 未开户固定 false;已开户固定 true |
| customer_no | string | true | 客户号(已开户分支) |
| contract_no | string | true | 签约号(已开户分支) |
| create_time | string | true | 开户时间,ISO 8601(已开户分支) |
应答示例
200 OK
{
"out_trade_no": "MCH202505250001",
"trade_no": "4001010120250525120000000001",
"url": "https://pay.example.com/bind/redirect",
"token": "a1b2c3d4e5f6789012345678abcdef01",
"expire_time": "2026-05-25T15:30:00+08:00",
"account_opened": false
}
应答示例
200 OK
{
"out_trade_no": "MCH202505250001",
"account_opened": true,
"customer_no": "CUS202605180001",
"contract_no": "C20250525000001",
"create_time": "2026-05-18T09:00:00+08:00"
}
错误码
公共错误码
| 状态码 | 错误码 | 描述 | 解决方案 |
|---|---|---|---|
| 401 | SIGN_ERROR | 验证不通过 | 请参阅【开发指引-整体说明】排查签名 |
| 400 | PARAM_ERROR | 参数错误 | 请根据错误提示正确传入参数 |
| 500 | SYSTEM_ERROR | 系统异常,请稍后重试 | 请稍后重试 |
业务错误码
| 状态码 | 错误码 | 描述 | 解决方案 |
|---|---|---|---|
| 非 200 | INVALID_PARAMETER | 参数校验失败 | 修正参数或 Header |
| 非 200 | TRADE_ERROR | 产品未开通;申请链接失败 | 开通产品或换 out_trade_no 重试 |
| 非 200 | ORDER_DUPLICATED | 同商户订单号已有绑卡记录 | 查绑卡结果;处理中则等进度;失败/过期则换单 |
| 非 200 | UPSTREAM_TIMEOUT | 会员信息解析失败 | 稍后重试 |
应答示例
失败
{
"code": "INVALID_PARAMETER",
"message": "交易失败"
}
应答示例
失败
{
"code": "TRADE_ERROR",
"message": "交易失败"
}
应答示例
失败
{
"code": "ORDER_DUPLICATED",
"message": "交易失败"
}
应答示例
失败
{
"code": "UPSTREAM_TIMEOUT",
"message": "交易失败"
}
应答示例
失败
{
"code": "SYSTEM_ERROR",
"message": "交易失败"
}