跳转到主要内容
POST
/
v1
/
pay
/
order
/
refund
退款接口
curl --request POST \
  --url https://openplatform.gateapi.io/v1/pay/order/refund \
  --header 'Content-Type: application/json' \
  --header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
  --header 'X-GatePay-Nonce: <x-gatepay-nonce>' \
  --header 'X-GatePay-Signature: <x-gatepay-signature>' \
  --header 'X-GatePay-Timestamp: <x-gatepay-timestamp>' \
  --data '
{
  "refundRequestId": "156123911",
  "prepayId": "1647438500687506",
  "refundAmount": "0.8"
}
'
{
  "status": "SUCCESS",
  "code": "000000",
  "data": {
    "refundRequestId": "156123911",
    "prepayId": "1647438500687506",
    "orderAmount": "1.91",
    "refundAmount": "0.8",
    "channelId": ""
  },
  "errorMessage": ""
}

Documentation Index

Fetch the complete documentation index at: https://docs.gate.com/llms.txt

Use this file to discover all available pages before exploring further.

概述

本页说明 POST /v1/pay/order/refund 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。

说明

请求头

X-GatePay-Certificate-ClientId
string
必填

商户客户端ID,在 GatePay 平台申请获得

示例:

"4186d0c6-6a35-55a9-8dc6-5312769dbff8"

X-GatePay-Signature
string
必填

HMAC-SHA256签名,用于验证请求合法性

示例:

"672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8a2ec24c97fa6fc5d1533dd6e968863747e1d86a45e562cbe899f9ed7e9ca7f77"

X-GatePay-Timestamp
string
必填

时间戳(毫秒),与服务器时间差不能超过5分钟

示例:

"1672905655498"

X-GatePay-Nonce
string
必填

随机数,用于防止重放攻击

示例:

"3525756760"

请求体

application/json

创建退款单请求参数。

refundRequestId
string
必填

商户生成的退款单ID。退款单id必须唯一,不大于32字符。

prepayId
string
必填

已完成支付的订单 ID。

refundAmount
string
必填

退款金额,不能超过订单总金额。

refundReason
string

退款原因,最长 256 字符。

响应

200 - application/json

退款请求结果

退款接口响应。

status
string
必填

SUCCESS 或者 FAIL

code
string
必填

出错代码

data
object

退款单信息

errorMessage
string

错误信息