Send bulk invoices

To send bulk invoices instantly and deliver them via SMS

POST
/api/v1/invoice/bulk

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

Request Body

application/json
  1. body
data*string

Payload must be encrypted before being sent to the server. To access the response data, decrypt it upon receiving the response from 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
idsPass multiple invoice id in array formatYes

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 merchant code    "ids": ["12880","12881"] // Pass selected invoice object id  }

Step 2: Convert JSON Object into Encrypted string and post to Hesabe

{  "data": "0e7898bd7464d0c402fe8a949d9cbf9b034eaeacaed3d040207d9535b3ca875bbe811252c8aa4bdbe4d0323fc13064f33ea74d56ec6508b70669ebc8e0991390"}

Step 3: Receive encrypted response from Hesabe

{  "response": "60a8f62419969d3dd7123d860a8f62419969d3dd7123d860a8f62419969d3dd7123d8......"}

Step 4: Decrypt the API response and view the JSON output

{  "status": true,  "message": "Invoice sent successfully",  "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": "0e7898bd7464d0c402fe8a949d9cbf9b034eaeacaed3d040207d9535b3ca875bbe811252c8aa4bdbe4d0323fc13064f33ea74d56ec6508b70669ebc8e0991390"})fetch("https://merchantapisandbox.hesabe.com/api/v1/invoice/bulk", {  method: "POST",  headers: {    "Content-Type": "application/json",    "accessCode": "c333729b-d060-4b74-a49d-7686a8353481",    "Accept": "application/json"  },  body})
Example Response
{  "status": true,  "message": "Invoice sent successfully",  "response": null}