Skip to main content

Refunds

When a shopper wishes to return the goods or services you have provided you can use the refund operation to provide the funds back. It is important that you perform this operation in a timely manner to avoid Disputes raised by the Customers with their banks.

Step 0. Authentication

How to obtain access token Authentication Reference

Step 1. Create a Refund

You may create a Refund to refund a payment made by your customer.

POST /mch-api/v1/pa/refunds/create

  • Example Request
{
"payment_order_id": "C991289984923795789123",
"merchant_payment_order_id": "P9297895081903",
"merchant_refund_id": "R9297895081903",
"amount": "50",
"reason": "user return the goods"
}
  • Request
REQUEST BODYDetailsTypeRequiredExample
payment_order_idPlatform order id from payment.string(32)conditional (required if merchant_payment_order_id is empty)
merchant_payment_order_idMerchant order id from your creation of payment.string(32)conditional (required if payment_order_id is empty)
merchant_refund_idThe unique refund ID created in merchant's order system. Maximum length is 32.string(32)required
amountAmount of the Refund.stringrequired
reasonReason of the Refund. Maximum length is 128.string(128)optional
  • Example Response
{
"code": 0,
"data": {
"payment_order_id": "C991289984923795789123",
"merchant_payment_order_id": "P9297895081903",
"merchant_refund_id": "R9297895081903",
"create_time": "2023-08-31T04:44:05.928696203+08:00",
"status": "SUCCEEDED"
},
"message": "ok",
"rid": "3647575c0e1049439e484a231864da2c"
}

Once you get response with status SUCCEEDED that means the refund has been successful.

Step 2. Retrieve a Refund

Retrieve a Refund by ID.

POST /mch-api/v1/pa/refunds/query

  • Example Request
{
"refund_id": "R991289984923795789123",
"merchant_refund_id": "R9297895081903"
}
  • Request
REQUEST BODYDetailsTypeRequiredExample
refund_idPlatform refund id from refund request.string(32)conditional (required if merchant_refund_id is empty)
merchant_refund_idMerchant refund id from your creation of refund.string(32)conditional (required if refund_id is empty)
  • Example Response
{
"code": 0,
"data": {
"payment_order_id": "C991289984923795789123",
"merchant_payment_order_id": "P9297895081903",
"merchant_refund_id": "R9297895081903",
"create_time": "2023-08-31T04:44:05.928696203+08:00",
"status": "SUCCEEDED"
},
"message": "ok",
"rid": "3647575c0e1049439e484a231864da2c"
}
  • Explain of status
STATUS CODEDetails
PENDINGThe Refund is pending the final result from the provider. No further action is required.
SUCCEEDEDThe Refund has succeeded. The refund transaction is complete.
CANCELLEDUsually it does not appear, but it will be prompted when there is a refund exception.