跳转到主要内容
POST
/
refund
Create Refund
curl --request POST \
  --url https://uat-api.clinkbill.com/api/refund \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --header 'X-Timestamp: <api-key>' \
  --data '
{
  "orderId": "ord_xxxxx",
  "refundMerchantOrderId": "refund_ref_10001",
  "refundAmount": 19.99,
  "refundReasonType": 2,
  "remark": "Customer requested refund"
}
'
{
  "code": 200,
  "msg": "success",
  "data": {
    "createTime": 1754819711382,
    "refundId": "rfd_abc123xyz",
    "orderId": "order_def456uvw",
    "customerId": "cus_ghi789rst",
    "refundAmount": 19.99,
    "refundCurrency": "USD",
    "status": "success",
    "refundReason": "Customer Initiated Refund",
    "metadata": {
      "arn": "8377252556170253",
      "merchantReferenceId": "sample_id"
    },
    "paymentInstrumentId": "<string>"
  }
}

授权

X-API-KEY
string
header
必填

Your secret API key obtained from the Clink dashboard (Developers section)

X-Timestamp
string
header
必填

Current timestamp in milliseconds since Unix epoch (required for request signing)

请求体

application/json

Parameters required to create a refund by API

orderId
string
必填

Unique identifier of the order to refund

refundMerchantOrderId
string
必填

Merchant-provided unique refund order ID. Reusing the same value returns the existing refund.

refundAmount
number
必填

Refund amount

示例:

19.99

refundReasonType
enum<integer>

Refund reason type: 0 duplicate payment, 1 fraudulent activity, 2 customer initiated refund, 3 other

可用选项:
0,
1,
2,
3
remark
string

Refund remark, up to 500 characters

Maximum string length: 500

响应

Refund created successfully

code
integer<int32>

Response status code, 200 when success

示例:

200

msg
string

Brief description of what happened, 'success' when happy case

示例:

"success"

data
object