⚙️
API Explorer
  • Overview
  • API Reference
    • 交易
      • Sessiontoken
      • customer
      • Payment methods
      • Confirm charge
      • Checkout payment
      • Local payment
    • 授权交易完成/撤销
      • Authorization
    • 拒付
    • 退款
    • 物流
    • 交易查询
    • 网关绑定支付通道查询
    • 结算明细查询
    • 风控-来源网址查询
  • Webhook
    • 概述
    • 交易事件
    • 预授权事件
    • 退款事件
    • 拒付事件
    • 支付结果跳转
  • 附录
    • 数据签名过程
    • 测试账号信息
    • 常见错误码
    • 常见问题
    • 旧版API文档
Powered by GitBook
On this page
  1. Webhook

退款事件

退款事件

Previous预授权事件Next拒付事件

Last updated 2 years ago

请求报文示例

webhook.sh
curl --request POST \
  --url https://{callbackUrl refund} \
  --header 'Content-Type: application/json' \
  --header 'request-id: 58675' \
  --header 'request-time: 1651888520935' \
  --header 'gateway-no: 12345001' \
  --header 'version: V2022-03' \
  --header 'sign-info: 787966BF2479A1BE8E1886CD18E6919447FAF4F357E7056188D4F035661B822B' \
  --data '{
    "data": {
        "reason": "0.11",
        "amount": "0.11",
        "batchNo": "452541",
        "orderAmount": "159.82",
        "orderNo": "NEW_API2437760267049",
        "tradeNo": "2022041810284780668037",
        "orderCurrency": "CNY",
        "noticeDate": "2022-04-26 17:47:18",
        "currency": "CNY"
    },
    "type": "refund.success"
}'

{callbackUrl refund} 地址为交易时填写的 callbackUrl 参数

商户收到该事件通知后,返回"success",则表示通知成功,否则会继续通知

  • POST退款通知webhook
  • 请求报文示例

退款通知webhook

post

退款通知webhook

Header parameters
gateway-noanyRequired

网关号

request-idanyRequired

请求id,30分钟之内唯一

request-timeanyRequired

时间戳,以毫秒(ms)为单位,请求误差不能超过10分钟

sign-infoanyRequired

验签字段,具体验签方式请参阅数据签名过程章节

versionanyRequired

webhook版本号

Body

退款webhook请求对象

typestringOptional

webhook事件类型 refund.success:退款成功事件; refund.fail:退款失败事件

Example: refund.success
Responses
200
OK
*/*
Responsestring
post
POST / HTTP/1.1
Host: {callbackUrl refund}
gateway-no: null
request-id: null
request-time: null
sign-info: null
version: null
Content-Type: application/json
Accept: */*
Content-Length: 265

{
  "data": {
    "amount": 65.12,
    "batchNo": 51006,
    "currency": "USD",
    "merTrackNo": 245368956,
    "noticeDate": "2021-04-12T00:00:00",
    "orderAmount": 100.12,
    "orderCurrency": "USD",
    "orderNo": 12167001000000000000,
    "reason": "reason",
    "tradeNo": 2.0210507155918938e+21
  },
  "type": "refund.success"
}
200

OK

text