POS Invoice

Resend POS invoice notification

POST
/api/v1/merchant/smartpos-transaction
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

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

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",
  "customer_name": "Salman",
  "customer_email":"",
  "customer_phone":"",
  "amount":0.100,
  "terminal_id":"29708454",
  "invoice_number":"",
  "description":"test", 
  "resend":1, // Pass 1 for resend
  "transaction_id": "297084548417629359279347779043" // Pass Invoice trans ID
}

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
customer_namePass the customer nameYes
amountPass the invoice amountYes
terminal_idPass the Terminal IDYes
resendPass 1 for resendYes
transaction_idPass invoice transaction_id from the response objectYes
customer_phonePass customer mobile numberOptional
customer_emailPass customer email addressOptional
invoice_numberPass the invoice numberOptional
descriptionPass invoice description detailsOptional

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

{
  "data": "0e7898bd7464d0c402fe8a949d9cbf9b191a5c36b416dd227c080e9e34889e3789f0a48c2a935932bc2698cfae0745a892b6fffc18bf86638fda8dcebd9e216416e552057bfe18900f0fd3e52c8f2d87ae1a2c74c68ae67b941d1f55e6a1ad3fbbbb043d5be213831c86448d163a473601f52f115944b2fe5f218424c0eaa54aa7af4880acf1ddd6e514617670691a3f6f539422c79992b3d6ea3cb6d1d3ead2dc334251842955c6a2b7d9feff3af3596d6c68e00ed474b6f03f3eeae347f11f62a19cb625d232245ed6be7676393bccd9fadbeacd6ec0e909b56c8d847c72d566f246b20d595cff94df0e5efb7188cd"
}

Step 3: Receive encrypted response from Hesabe:

{
  "response": "60a8f6241932227b840a9f5e36987f4d9bc63e437527339368fb94048810247047e87f2bd5f585e5f7601011b49134d0c8ffaaee0c71aa4d9dc245a646a7263c5a795c446e394b6e9598087aa74de33df87f0af89c7b68276bbd7a5a475c57bdede3765d14788364afbd48bd2915a771536a0f64d8937e58455dd59374cfaec55f2faf213425b173d5e8e2383460753fe53fcdcbfd90145b2c66c844f12fa4d1bcc51de9aa2d76e8bdf7872b0e52a372f1d377ef474a0328f2924f7983e0cb600d405fd01cf8472cd395573a42e2e7bb7a720155b98c748b96cde354baf63c07777e629d3d801379b0ed7934d8823af0dfe5cb68d826d3110036e3eda865b3ea9e6f988d6d3d24339b04873e08794f74387d89aba3900602b44e85ab963505e12c92714362e13693e15ddadfac23b9568d8246f16589c451a02f83503ecd52cc5d4b76ae7fa7deada9319fbbf999fa2d3366e4071c6a031c8caa7be52a39567beecbde0173a502eb2456abcdc66329cdb9ba4785f36c527f200f610e267215934fd7ef8f4c5a4f36e25f877acb9a30d82363934497f2ec60cc6ed2a64538c6aa8859aa94868e6ef356f68a840fd50aa042b2be636bdbb09bd9c29e293a1d756dcb2df913e0d13cc2bd7cfb2a4c712898af6daf45e020f1604aed362abf3b6a1c"
}

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

{
  "status": true,
  "message": "POS invoice resent successfully",
  "response": {
    "id": 267,
    "transaction_id": "297084548417629359279347779043",
    "invoice_number": "",
    "amount": "0.100",
    "terminal_id": 29708454,
    "merchant_id": 84,
    "merchant_name": "TestHome1",
    "terminal_name": "A99",
    "customer_name": "Salman",
    "customer_email": "",
    "customer_phone": "",
    "description": "test",
    "status": 0,
    "created_by": 84,
    "created_by_name": "test",
    "created_at": "2025-11-12 11:25:27",
    "updated_at": "2025-11-12 11:25:27"
  }
}

Response Body

application/json

application/json

application/json

application/json

const body = JSON.stringify({  "data": "0e7898bd7464d0c402fe8a949d9cbf9b191a5c36b416dd227c080e9e34889e3789f0a48c2a935932bc2698cfae0745a892b6fffc18bf86638fda8dcebd9e216416e552057bfe18900f0fd3e52c8f2d87ae1a2c74c68ae67b941d1f55e6a1ad3fbbbb043d5be213831c86448d163a473601f52f115944b2fe5f218424c0eaa54aa7af4880acf1ddd6e514617670691a3f6f539422c79992b3d6ea3cb6d1d3ead2dc334251842955c6a2b7d9feff3af3596d6c68e00ed474b6f03f3eeae347f11f62a19cb625d232245ed6be7676393bccd9fadbeacd6ec0e909b56c8d847c72d566f246b20d595cff94df0e5efb7188cd"})fetch("https://merchantapisandbox.hesabe.com/api/v1/merchant/smartpos-transaction", {  method: "POST",  headers: {    "Content-Type": "application/json",    "accessCode": "c333729b-d060-4b74-a49d-7686a8353481",    "Accept": "application/json"  },  body})
{
  "status": true,
  "message": "POS invoice resent successfully",
  "response": {
    "id": 267,
    "transaction_id": "297084548417629359279347779043",
    "invoice_number": "",
    "amount": "0.100",
    "terminal_id": 29708454,
    "merchant_id": 84,
    "merchant_name": "TestHome1",
    "terminal_name": "A99",
    "customer_name": "Salman",
    "customer_email": "",
    "customer_phone": "",
    "description": "test",
    "status": 0,
    "created_by": 84,
    "created_by_name": "test",
    "created_at": "2025-11-12 11:25:27",
    "updated_at": "2025-11-12 11:25:27"
  }
}
{
  "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
}