退款
对已成功的协议支付原单发起退款,同一 out_refund_no 重复请求按幂等处理。同步受理成功 trade_status 为 PROCESSING,资金终态须通过退款查询或 notify_url 异步通知确认。支持可选分账退款明细 sharing_refund_info_list。
接口说明
请求方式:【POST】/v1/protocol/refund
请求域名:【主域名】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 | 原支付商户订单号,6~64 字符 |
| out_refund_no | string | true | 商户退款单号(幂等),≤64 字符 |
| refund_total_amount | integer | true | 退款金额,单位分,≥1 |
| refund_reason | string | true | 退款原因,≤256 字符 |
| notify_url | string | false | 退款结果异步通知地址,≤256 字符 |
| additional_info | string | false | 附加信息,≤1024 字符 |
| sharing_refund_info_list | array | false | 分账退款明细列表 |
sharing_refund_info_list 子项:sharing_merchant_id(分账接收方商户号,必填)、profit_sharing_receiver_amount(该接收方退款金额,单位分,必填);各子项金额之和宜与 refund_total_amount 一致
请求示例
{
"out_trade_no": "20260609120001001",
"out_refund_no": "REF20260622001",
"refund_total_amount": 100,
"refund_reason": "用户申请退款",
"notify_url": "https://merchant.example.com/notify/refund"
}
{
"out_trade_no": "20260609120001001",
"out_refund_no": "REF20260622002",
"refund_total_amount": 100,
"refund_reason": "用户申请退款",
"notify_url": "https://merchant.example.com/notify/refund",
"sharing_refund_info_list": [
{
"sharing_merchant_id": "100000363",
"profit_sharing_receiver_amount": 10
},
{
"sharing_merchant_id": "100000364",
"profit_sharing_receiver_amount": 90
}
]
}
应答参数
200 OK
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| trade_status | string | true | 受理成功为 PROCESSING;资金终态见退款查询 refund_status |
| trade_status_desc | string | false | 状态中文描述 |
| out_trade_no | string | false | 原支付商户订单号 |
| out_refund_no | string | false | 商户退款单号 |
| refund_no | string | false | 宝付退款流水号 |
| refund_total_amount | integer | false | 退款金额,单位分 |
应答示例
200 OK
{
"trade_status": "PROCESSING",
"trade_status_desc": "处理中",
"out_trade_no": "20260609120001001",
"out_refund_no": "REF20260622001",
"refund_no": "20251218173125013031185289875340",
"refund_total_amount": 100
}
错误码
公共错误码
| 状态码 | 错误码 | 描述 | 解决方案 |
|---|---|---|---|
| 401 | SIGN_ERROR | 验证不通过 | 请参阅【开发指引-整体说明】排查签名 |
| 400 | PARAM_ERROR | 参数错误 | 请根据错误提示正确传入参数 |
| 500 | SYSTEM_ERROR | 系统异常,请稍后重试 | 请稍后重试 |