Delete invoice
This API allows merchants to permanently delete an existing invoice from the system. Once deleted, the invoice cannot be restored
AuthorizationBearer <token>
Pass access token obtained from login endpoint
In: header
Path Parameters
invoice_idnumber
Pass the invoice id 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
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 |
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
}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": "60a8f6241932227b840a9f5e36987f4d894e5813e1ec714a9f1093832ea779377c273e9ca35de20c5049b11f8b5e6fae5232563532d84705e1f1e357c426246cb83946b9f5c2aa3fc0e2c8048f0e2d798068e2e9d76ed65a348f76061f63eac8"
}Step 4: Decrypt the api response and view the JSON output
{
"status": true,
"message": "Invoice has been deleted",
"response": null
}Response Body
application/json
application/json
application/json
application/json
const body = JSON.stringify({ "data": "0e7898bd7464d0c402fe8a949d9cbf9b826ccb9b83b56fa003373275f1947a65"})fetch("https://merchantapisandbox.hesabe.com/api/v1/invoice-bulk-upload/12885", { method: "DELETE", headers: { "Content-Type": "application/json", "accessCode": "c333729b-d060-4b74-a49d-7686a8353481", "Accept": "application/json" }, body}){
"status": true,
"message": "Invoice has been deleted",
"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
}