Update bulk invoice
To update the bulk invoice details
PUT
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
invoice_id*numberPass the invoice id number
application/json- body
data*stringConvert 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 |
amount | Pass the invoice amount | Yes |
name | Pass the customer name | Yes |
email | Pass the customer email | Yes |
phone | Pass the customer phone number | Yes |
reference_number | Pass the invoice reference number | 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 merchant code "amount" : "100.000", // Invoice amount "name": "test", // customer amount "email": "test@gmail.com", // customer email "phone":"96512345678", // customer mobile number "reference_number": "12345555" // invoice ref number}Step 2: Convert the JSON object into an encrypted string format and post to Hesabe
{ "data": "0e7898bd7464d0c402fe8a949d9cbf9b84c9ca6239b5e015bd42c0d4b30b12eea40286812a301e52ceec0d9f47b6c3e0a4fbe43132ccb9253621b3e61d35e2f1639463bf1997499059aa34e6931f9fc93828201a2a4a1e73325a39a6c6ccc3a355279b3746d1f99ef415cd5acd52aeece2c0a2583727061387b8d12af04924b1abbd1b94f3b63fb0f1f415826b3e30fd"}Step 3: Receive encrypted response from Hesabe:
{ "response": "60a8f6241932227b840a9f5e36987f4d894e5813e1ec714a9f1093832ea779376f8c931487a6666937ace7a3b8e72bb86fbde24268630641d30f9c004b14293f5178814360594bc68e3f9f54c6a696cd919a279628664f81f96f7c9fdaf5b160649be0237f80911711deaa033abf8627835b84a476b82df35516f6b49df42baa16683d6d0845eb345ef70d5a138b09a37da8a3c5df6b4044ac8bf9469a38202deeddd27095b2aabf8758ec96f2e3c0ec34a16cde8fdf876ad89b910876da4de51a3619c780fab4e72e53027a0191830818987f08d8b5ea418387a004661ce4dd9d241dc7c426dbe2ed0f7a2701b59768e0219db14702b1adae6bbf6209ffb02811f6ad790d5ffc55e9938e5b5616f408201b42fde67a703f1152bf7a8dfed78e3cbc7b3580dcea8fef372a141203ee4ac02899ecb3c159a703db6ea343ce5ca9729e673337bf364bae868f1d7fe14cb9968cb603f1a2484de31655c0253d41b02d510ab3e4048ce376cce01d95b4549e9336af71131b0c85e2d06730192b046454b1930c1b58c585873e70939f1e202a1399a30f7b8e28db1a53b24ec9d012d3"}Step 4: Decrypt the API response and view the JSON output
{ "status": true, "message": "Invoice updated successfully", "response": { "id": 12887, "merchant_id": 84, "reference_number": "bb01-0000008", "name": "test", "phone": "96512345678", "email": "test@gmail.com", "amount": "100.000", "description": "Due Payment", "status": 1, "has_schedule": 0, "schedule_time": null, "schedule_status": 0, "schedule_sent_at": null, "created_at": "2025-10-13 12:14:45", "updated_at": "2025-10-13 13:35:10" }}Details fetched successfully. Decrypt the server response to view the final result
application/json- response
status?booleanmessage?stringresponse?const body = JSON.stringify({ "data": "0e7898bd7464d0c402fe8a949d9cbf9b84c9ca6239b5e015bd42c0d4b30b12eea40286812a301e52ceec0d9f47b6c3e0a4fbe43132ccb9253621b3e61d35e2f1639463bf1997499059aa34e6931f9fc93828201a2a4a1e73325a39a6c6ccc3a355279b3746d1f99ef415cd5acd52aeece2c0a2583727061387b8d12af04924b1abbd1b94f3b63fb0f1f415826b3e30fd"})fetch("https://merchantapisandbox.hesabe.com/api/v1/invoice-bulk-upload/12887", { method: "PUT", headers: { "Content-Type": "application/json", "accessCode": "c333729b-d060-4b74-a49d-7686a8353481", "Accept": "application/json" }, body})Example Response
{ "status": true, "message": "Invoice updated successfully", "response": { "id": 12887, "merchant_id": 84, "reference_number": "bb01-0000008", "name": "test", "phone": "96512345678", "email": "test@gmail.com", "amount": "100.000", "description": "Due Payment", "status": 1, "has_schedule": 0, "schedule_time": null, "schedule_status": 0, "schedule_sent_at": null, "created_at": "2025-10-13 12:14:45", "updated_at": "2025-10-13 13:35:10" }}