refund request
in case you need to full refund or partial refund your order, you can use this API to send your request to us. we will arrange the refund accordingly.
endpoint: POST [API_BASE_URL]/paylater/orders/refund/request
request for refund sample
var data = JSON.stringify({
"orderID": "<divit order uuid>",
"refundType": "partial", // or "full"
"refundAmount": 100.50,
"callbackURI": "https://<domain>/<path>?<query>",
"remarks": "string"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://sandbox-api.divit.dev/paylater/orders/refund/request");
xhr.setRequestHeader("api-key", "<your api-key, e.g. dvt_rREeGJ4FXp69nQEJ7Arq08stvtacFyPrTzKr>");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
note: the refund process requires 10 business days to complete
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"
}
}