Cancel refund
To cancel a refund request using the refund ID
DELETE
Base URL
Sandbox Base URL
Strictly for sandbox testing. Never use the sandbox URL in your production environment.
https://merchantapisandbox.hesabe.com
bearerAuthheader
AuthorizationBearer <JWT>Pass access token obtained from login endpoint
accessCode*stringPass the merchant access code issued by Hesabe
Accept*stringapplication/json
Content-Type*stringapplication/json
id_number*numberPass the refund transaction object "id" field number
application/json- body
data*stringConvert payload JSON object to encrypted string and send it to the server
Sample Encryption and Decryption Process:
The following steps demonstrate how to integrate with this API using sandbox credentials.
Step 1: Create JSON Object
{ "merchantCode": "842217", // Pass the merchant code provided by Hesabe}Payload details:
Contains the list of parameters and their corresponding values required to make the API request.
| Field Name | Description | Required |
|---|---|---|
merchantCode | Pass the merchant code provided by Hesabe | Yes |
Step 2: Convert the JSON object into an encrypted string format and post to Hesabe
{ "data": "0e7898bd7464d0c402fe8a949d9cbf9b826ccb9b83b56fa003373275f1947a65"}Step 3: Receive encrypted response from Hesabe:
{ "response": "60a8f6241932227b840a9f5e36987f4d818fba84808037f6ad7f9e741d18e6664ec2852ff018d3a493a35da5f803d38e7adb7bcff06fb2ec900f55b966d7df11"}Step 4: Decrypt the API response and view the JSON output
{ "status": true, "message": "Refund cancelled successfully", "response": true}Details fetched successfully. Decrypt the server response to view the final result
application/json- response
status?booleanmessage?stringresponse?booleanconst body = JSON.stringify({ "data": "0e7898bd7464d0c402fe8a949d9cbf9b826ccb9b83b56fa003373275f1947a65"})fetch("https://merchantapisandbox.hesabe.com/api/v1/refund/1461", { method: "DELETE", headers: { "Content-Type": "application/json", "accessCode": "c333729b-d060-4b74-a49d-7686a8353481", "Accept": "application/json" }, body})Example Response
{ "status": true, "message": "Refund cancelled successfully", "response": true}