Cancel refund

To cancel a refund request using the refund ID

DELETE
/api/v1/refund/{id_number}
AuthorizationBearer <token>

Pass access token obtained from login endpoint

In: header

Path Parameters

id_numbernumber

Pass the refund transaction object "id" field number

Header Parameters

accessCodestring

Pass the merchant access code issued by Hesabe

Acceptstring

application/json

Content-Typestring

application/json

datastring

Convert 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 NameDescriptionRequired
merchantCodePass the merchant code provided by HesabeYes

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
}

Response Body

application/json

application/json

application/json

application/json

application/json

const 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})
{
  "status": true,
  "message": "Refund cancelled successfully",
  "response": true
}
{
  "status": false,
  "message": "Forbidden Access",
  "response": null
}
{
  "status": false,
  "message": "Request not found, Please verify the request data",
  "response": null
}
{
  "message": "Internal server error occurred"
}
{
  "status": false,
  "code": 506,
  "message": "Invalid Request Data",
  "response": null
}