Update open invoice

Update the expiry date of an open invoice without creating a new one

PUT
/api/v1/open-invoice/{object_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

object_id*number

Pass the invoice object id

Request Body

application/json
  1. body
data*string

Convert payload JSON object to encrypted string and send it to the server

Payload parameter details:

Field NameDescriptionRequired
merchantCodePass the merchant code provided by HesabeYes
expiryDatePass the invoice expiry date (YYYY-MM-DD)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  "expiryDate": "2028-01-05"  // "YYYY-MM-DD" }

Step 2: Convert the JSON object into an encrypted string format and post to Hesabe

{  "data": "0e7898bd7464d0c402fe8a949d9cbf9b7734d714837b4f1ab326c37407f07df88435c794aefba42fca6e5d4ff2302de3676f931229d973a9ef7f6ee1b038841a"}

Step 3: Receive encrypted response from Hesabe:

{  "response": "60a8f6241932227b840a9f5e36987f4d407705b80c8cd7299384ef4f394c2f760ccd1ed949fdfc2cee16e6474af6ddc8b6f2d9ea37dedc8a22724f38440e22c2cf6f7b754e3ab51d29f6e3400cc6b689779033aeeee38462741e22bdd4a11638834e798ed7c2ba7bee731b395c02289b5c9f29e0dd3caec957bb433ed20eb1774567b362a7a62ccea8e850c77e502eaae9b6966a21845b95b51d758320a3b8687ef2a3073de8e19c0aa0d7c5212444ca4fe09b104d4febd761937dcb2bea53b78975c9a18f4c404ebdc0ec9a2c65a5d1d59e92e73a5537b4c8d9cf5394faf07e1ff634fa06ed851652b5058e28493d16645f043fe11006726671b14789ca4c0da1e3c4771ee564e25485e0ff65819a62dee339385163602e9ba3b6202cb63c253fe475bc983ba52bb4e011effd46d174b42b915dd82653b5600f4c3bd8bfff78d0861ead4dab0fa2d192961e4e3d471ff9f393dabfcfc1fff413127288fbedc4caffdef09bc24dbd0e302e0252ad51df82e522e97e00262d20533b67f7141bc14217ab6fc75abc8689584fd7e9be51e579ee4046afe4e74b2d492236808420ea2452bcc2c0f8c53b932e6f1f7ff9216497e7bf1a7214aa177d45df3bf4b96bc12d384489314eb5577e96ad6dda195138b977d3022f18aaf11e67f1c10b761d0882c2bfaed93a76a8fc27ed106c806bdbfdea4e58f665af39cbf815b9e1949ab868da2c0bdd2ab0a12ed33c449e821557c4f9624ad40d6b10c500902b9b4cefc611b7c2aae2cfd615f341e8ed77bc7afd5f6b00e40240ebe109176ff696824215764e0622970ba3fb99015fbc4447a90466074f5ffd15347ff313b6a23fe2f3bd"}

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

{    "status": true,    "message": "Open invoice updated successfully",    "response": {      "id": 927,      "merchant_id": 84,      "title": "openinvocie",      "reference_number": "841746101672953731162",      "type": 0,      "description": "",      "fixed_amount": "5.000",      "min_amount": "0.000",      "max_amount": "0.000",      "paid_status": 0,      "status": 0,      "created_by": 84,      "created_at": "2025-10-09 11:42:16",      "updated_at": "2025-10-09 11:42:16",      "expiry_date": "2029-01-05",      "url": "https://merchant.hesbstaging.com/open-invoice/checkout/841746101672953731162",      "total_amount_customer_paid": "0.000",      "total_customer_tried_count": null,      "total_customer_paid_count": 0    }}

Response Body

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

application/json
  1. response
status?boolean
message?string
response?
Example Request
const body = JSON.stringify({  "data": "0e7898bd7464d0c402fe8a949d9cbf9b7734d714837b4f1ab326c37407f07df89af55572b85cb9df22c386080a030858dabd6113763679d2eb19b56678dfc125"})fetch("https://merchantapisandbox.hesabe.com/api/v1/open-invoice/926", {  method: "PUT",  headers: {    "Content-Type": "application/json",    "accessCode": "c333729b-d060-4b74-a49d-7686a8353481",    "Accept": "application/json"  },  body})
Example Response
{  "status": true,  "message": "Open invoice updated successfully",  "response": {    "id": 927,    "merchant_id": 84,    "title": "openinvocie",    "reference_number": "841746101672953731162",    "type": 0,    "description": "",    "fixed_amount": "5.000",    "min_amount": "0.000",    "max_amount": "0.000",    "paid_status": 0,    "status": 0,    "created_by": 84,    "created_at": "2025-10-09 11:42:16",    "updated_at": "2025-10-09 11:42:16",    "expiry_date": "2029-01-05",    "url": "https://merchant.hesbstaging.com/open-invoice/checkout/841746101672953731162",    "total_amount_customer_paid": "0.000",    "total_customer_tried_count": null,    "total_customer_paid_count": 0  }}