跳转至

订单退款保证金接口

使用场景

商家退款保证金接口(非幂等,第二次请求外部退款号一致,会提示退款号已存在)。需要回调通知的话,请按要求提供接口

接口地址

参数说明

  • 公有参数

    发送请求是必须传入公共参数,详见公共参数

  • 私有参数

参数名称 是否必须 参数类型 长度限制 描述
outer_trade_no string [10,30] 外部交易号,请以appid开头,例如:10000001101
outer_refund_no string [10,30] 外部退款号,请以appid开头,例如:10000001201
reason string [1,254] 退款原因
notify_url string [1,254] 通知url,非必填,退保证金完成时进行通知结果,与同步返回结果一致

请求示例

POST /seller/pay/sync_refund_guarantee?access_token=b983eef183a789a693b91406f38b7e23&timestamp=1531039596&version=1.0.0 HTTP/1.1
Host: openapi.guanaitong.tech
Content-Type: application/json
Cache-Control: no-cache

{
"outer_refund_no":"10000001201",
"outer_trade_no":"10000001101",
"reason":"保证金退款,订单总额100"
}

返回参数说明

参数名称 描述
code 返回码。详见错误返回码
msg 如果错误,返回错误信息。
data 如果没有错误,返回关爱通交易号

正确返回示例

{
    "code": 0,
    "data": "2018070820000016",
    "msg": "OK"
}

错误返回示例

{
    "code": 1000210001,
    "msg": "timestamp check failed!",
    "data": null
}

退保证金回调

请求URL

调用退保证金时,填写的notify_url

参数说明

参数名称 参数类型 描述
appid string 应用appid
outer_trade_no string 外部交易号
outer_refund_no string 外部退款号
refund_amount decimal 退款金额
trade_no string 关爱通交易号
timestamp string 时间戳,其值为1970-1-01 00:00:00.000到当前时刻的时间距离,单位是秒,时区为GMT+8(东八区)。如1469691921。关爱通接口允许的时间戳偏差为5分钟,偏差超过5分钟的请求将被拒绝。
sign string 签名,见 签名机制

请求示例

POST 商家URI,:/syncRefund/notify HTTP/1.1
Host: 商家域名,:test.guanaitong.tech
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

appid=10000001&outer_trade_no=10000001101&outer_refund_no=10000001201&
refund_amount=10.0&trade_no=2018070920000005&sign=edceccd3117ff3d32690a6caf23355a0b407074f&
timestamp=1531039298

返回参数说明

(1)notify只有在关爱通退款成功后才会发送;

(2)商家在收到了请求、校验通过后,请即时更新自己的订单状态,并返回success(不要带任何其他源码内容);

(3)若关爱通的notify请求无响应或者接收的内容不是“success”,则认为通知失败,等一段时间后会再次请求(notify请求会在此后24小时内按递增时间间隔继续发送通知);

(4)notify仅为通知,不论第三方返回成功或失败,都不会改变关爱通的订单状态;

正确返回示例

success

错误返回示例

fail
回到页面顶部