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: <x-timestamp>' \
--data '
{
"orderId": "order_xxxxx",
"refundMerchantOrderId": "refund_ref_10001",
"refundAmount": 19.99,
"refundReasonType": 2,
"remark": "Customer requested refund"
}
'HttpResponse<String> response = Unirest.post("https://uat-api.clinkbill.com/api/refund")
.header("X-Timestamp", "<x-timestamp>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"order_xxxxx\",\n \"refundMerchantOrderId\": \"refund_ref_10001\",\n \"refundAmount\": 19.99,\n \"refundReasonType\": 2,\n \"remark\": \"Customer requested refund\"\n}")
.asString();import requests
url = "https://uat-api.clinkbill.com/api/refund"
payload = {
"orderId": "order_xxxxx",
"refundMerchantOrderId": "refund_ref_10001",
"refundAmount": 19.99,
"refundReasonType": 2,
"remark": "Customer requested refund"
}
headers = {
"X-Timestamp": "<x-timestamp>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Timestamp': '<x-timestamp>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
orderId: 'order_xxxxx',
refundMerchantOrderId: 'refund_ref_10001',
refundAmount: 19.99,
refundReasonType: 2,
remark: 'Customer requested refund'
})
};
fetch('https://uat-api.clinkbill.com/api/refund', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "success",
"data": {
"createTime": 1754819711382,
"refundId": "rfd_abc123xyz",
"refundMerchantOrderId": "refund_ref_10001",
"orderId": "order_def456uvw",
"customerId": "cus_ghi789rst",
"refundAmount": 19.99,
"refundCurrency": "USD",
"status": "success",
"failureCode": "already_refunded",
"failureMessage": "This payment has already been fully refunded. Check order status in your account's transaction history.",
"refundReason": "Customer Initiated Refund",
"metadata": {
"arn": "8377252556170253",
"merchantReferenceId": "sample_id"
},
"paymentInstrumentId": "<string>"
}
}"<string>"Refund
Create Refund
Create a refund for an existing order. The refundMerchantOrderId is used for idempotency.
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: <x-timestamp>' \
--data '
{
"orderId": "order_xxxxx",
"refundMerchantOrderId": "refund_ref_10001",
"refundAmount": 19.99,
"refundReasonType": 2,
"remark": "Customer requested refund"
}
'HttpResponse<String> response = Unirest.post("https://uat-api.clinkbill.com/api/refund")
.header("X-Timestamp", "<x-timestamp>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"order_xxxxx\",\n \"refundMerchantOrderId\": \"refund_ref_10001\",\n \"refundAmount\": 19.99,\n \"refundReasonType\": 2,\n \"remark\": \"Customer requested refund\"\n}")
.asString();import requests
url = "https://uat-api.clinkbill.com/api/refund"
payload = {
"orderId": "order_xxxxx",
"refundMerchantOrderId": "refund_ref_10001",
"refundAmount": 19.99,
"refundReasonType": 2,
"remark": "Customer requested refund"
}
headers = {
"X-Timestamp": "<x-timestamp>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Timestamp': '<x-timestamp>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
orderId: 'order_xxxxx',
refundMerchantOrderId: 'refund_ref_10001',
refundAmount: 19.99,
refundReasonType: 2,
remark: 'Customer requested refund'
})
};
fetch('https://uat-api.clinkbill.com/api/refund', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "success",
"data": {
"createTime": 1754819711382,
"refundId": "rfd_abc123xyz",
"refundMerchantOrderId": "refund_ref_10001",
"orderId": "order_def456uvw",
"customerId": "cus_ghi789rst",
"refundAmount": 19.99,
"refundCurrency": "USD",
"status": "success",
"failureCode": "already_refunded",
"failureMessage": "This payment has already been fully refunded. Check order status in your account's transaction history.",
"refundReason": "Customer Initiated Refund",
"metadata": {
"arn": "8377252556170253",
"merchantReferenceId": "sample_id"
},
"paymentInstrumentId": "<string>"
}
}"<string>"Authorizations
Your secret API key obtained from the Clink dashboard (Developers section)
Headers
Current timestamp in milliseconds since Unix epoch (required for request signing)
Example:
"1783513683000"
Body
application/json
Parameters required to create a refund by API
Unique identifier of the order to refund
Merchant-provided unique refund order ID. Reusing the same value returns the existing refund.
Refund amount
Example:
19.99
Refund reason type: 0 duplicate payment, 1 fraudulent activity, 2 customer initiated refund, 3 other
Available options:
0, 1, 2, 3 Refund remark, up to 500 characters
Maximum string length:
500