- 新平台
该接口用于发起一笔退款请求:
https://api-reference.checkout.com/#operation/refundAPayment
HTTP调用方法为 POST
沙箱环境地址:https://api.sandbox.checkout.com/payments/{id}/refunds
生产环境地址:https://api.checkout.com/payments/{id}/refunds
Path 参数名 | 是否必填 | 说明 |
---|---|---|
id | - [x] |
| 正则表达式:^(pay|sid)_(\w{26})$
该id为调用Create HPP或者Payment完成支付后返回。
具体见后文如何获取pay | sid i |
Body 参数名 | 是否必填 | 说明 |
---|---|---|
amount | - [ ] |
| 退款金额,若不指定退款金额或amount = 0则发起全额退款。
若指定金额,则退款金额要小于可退款金额。 |
| reference |
- [ ]
| 商户侧的订单号 |
| metadata |
- [ ]
| 自定义数据 |
退款为异步处理,当发起同步调用后,若参数正确则会返回HTTP Code 202
实际的退款状态可以后续通过发起Get Payment Detial/Get Payment Actions或者等待Webhook异步通知。
发起请求示例:
{
"reference": "ORD-5023-4E89",
"metadata": {
"coupon_code": "NY2018",
"partner_id": 123989
}
}
{
"amount": 100,
"reference": "ORD-5023-4E89",
"metadata": {
"coupon_code": "NY2018",
"partner_id": 123989
}
}