Upload Bulk file
To upload bulk or scheduled invoices instantly and deliver them via SMS
POST
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
application/json- body
data*stringPayload must be encrypted before being sent to the server. To access the response data, decrypt it upon receiving the response from the server
Two types of Bulk invoices
| Types | Description | Download Links |
|---|---|---|
| Bulk | The merchant can send bulk SMS messages at once | Click here to download |
| Scheduled | The merchant can schedule the time to send invoices | Click here to download |
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 |
isScheduled | JSON boolean: false for bulk, true for scheduled ("0" / "1" are also accepted). The strings "false" and "true" are rejected with 422 | Yes |
fileType | Pass the invoice type "csv" or "xlsx" | Yes |
invoices | Pass the file data in base 64 format | 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 "isScheduled": false, // JSON boolean: false for bulk, true for scheduled ("0" / "1" also accepted) "fileType": "csv", // Eg: csv or xlsx "invoices": base64value // Pass base 64 file format value }Step 2: Convert JSON Object into Encrypted string and post to Hesabe
{ "data": "0e7898bd7464d0e7898bd7464d0e7898bd7464d0e7898bd7464d0e7898bd7464d0e7898bd7464d........."}Step 3: Receive encrypted response from Hesabe
{ "response": "60a8f62419969d3dd7123d860a8f62419969d3dd7123d860a8f62419969d3dd7123d8......"}Step 4: Decrypt the API response and view the JSON output
{ "status": true, "message": "Invoice file uploaded successfully.", "response": null}Details fetched successfully. Decrypt the server response to view the final result
application/json- response
status?booleanmessage?stringresponse?unknownconst body = JSON.stringify({ "data": "string"})fetch("https://merchantapisandbox.hesabe.com/api/v1/invoice-bulk-upload", { method: "POST", headers: { "Content-Type": "application/json", "accessCode": "c333729b-d060-4b74-a49d-7686a8353481", "Accept": "application/json" }, body})Example Response
{ "status": true, "message": "Invoice file uploaded successfully.", "response": null}