Delete invoice

This API allows merchants to permanently delete an existing invoice from the system. Once deleted, the invoice cannot be restored

DELETE
/api/v1/invoice-bulk-upload/{invoice_id}

Base URL

Sandbox Base URL

Strictly for sandbox testing. Never use the sandbox URL in your production environment.
https://merchantapisandbox.hesabe.com

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Pass access token obtained from login endpoint

Header Parameters

accessCode*string

Pass the merchant access code issued by Hesabe

Accept*string

application/json

Content-Type*string

application/json

Path Parameters

invoice_id*number

Pass the invoice id number

Request Body

application/json
  1. body
data*string

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

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

Details fetched successfully. Decrypt the server response to view the final result

application/json
  1. response
status?boolean
message?string
response?unknown
Example Request
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})
Example Response
{  "status": true,  "message": "Invoice has been deleted",  "response": null}