refund request
in case you need to full refund or partial refund your order, you can use this API to send the request to us. our system will create a refund request automatically. according to the merchant configuration, it could be done in the next business day by 16:00 HKT.
endpoint: POST {{API_BASE_URL}}/paynow/orders/refund/request
request for refund sample
var data = JSON.stringify({
"orderID": "{{DIVIT_ORDER_ID}}",
"refundType": "partial", // or "full"
"refundAmount": 100.50,
"callbackURI": "https://<domain>/<path>?<query>", // we can send you a callback when the refund is completed, empty it if not needed
"remarks": "string"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "{{API_BASE_URL}}/paynow/orders/refund/request");
xhr.setRequestHeader("api-key", "{{API_KEY}}"); // e.g. dvt_rREeGJ4FXp69nQEJ7Arq08stvtacFyPrTzKr
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
important
note: the refund process typically completes by 16:00 HKT the next business day. however, this can vary depending on the approval process configuration or whether there are sufficient funds in the unsettled balance to cover the refund.
refund webhook​
if callbackURI
is specified, divit will send the URI a webhook event with the same format as the order webhook.
sample event
{
"event": {
"eventId": 2100,
"eventDescription": "Refund is completed"
},
"eventData": {
"orderID": "7f32674f-6f8a-407d-934c-768d84472a76",
"partnerRef": "<merchant ref>",
"refundAmount": {
"amount": 10050,
"currency": "HKD"
},
"status": "completed"
}
}