Upload Bulk file

To upload bulk or scheduled invoices instantly and deliver them via SMS

POST
/api/v1/invoice-bulk-upload
AuthorizationBearer <token>

Pass access token obtained from login endpoint

In: header

Header Parameters

accessCodestring

Pass the merchant access code issued by Hesabe

Acceptstring

application/json

Content-Typestring

application/json

datastring

Payload 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

TypesDescriptionDownload Links
BulkThe merchant can send bulk SMS messages at onceClick here to download
ScheduledThe merchant can schedule the time to send invoicesClick here to download

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
isScheduledPass the invoice type "false" if it is bulk and Pass the invoice type "true" if it is scheduledYes
fileTypePass the invoice type "csv" or "xlsx"Yes
invoicesPass the file data in base 64 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 the merchant code provided by Hesabe
    "isScheduled": "false",  // "false" for bulk or "true" for scheduled
    "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
}

Response Body

application/json

application/json

application/json

application/json

const 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})
{
  "status": true,
  "message": "Invoice file uploaded successfully.",
  "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
}