Skip to main content

Read an amount aloud on the device

This API makes a TingeeBox device read out the current transaction amount, keeping the system and the counter device in sync.

POST
URLhttps://open-api.tingee.vn/v1/device/read-amount-link-to-merchant

Send a command to the TingeeBox device to read out the amount.

Header Request​

HeaderRequiredDescription
Content-Type✓application/json
x-client-id✓Partner identifier issued by TINGEE.
x-signature✓HMAC SHA512 authentication signature. See How to generate the signature.
x-request-timestamp✓Time the request is sent (format: yyyyMMddHHmmssSSS, UTC+7)

Body Parameter​

FieldTypeRequiredDescription
merchantIdnumber~Merchant ID
(Required if you connect with a Master Merchant account).
uuidstring✓Device identifier (the device must be linked to the Merchant).
transactionIdstring✓ID of the transaction whose amount is read out.
amountnumber✓Transaction amount (VND).
bankBinstring✕Bank BIN of the transaction. See Supported banks.
If the device is locked to a bank, it only reads the amount when bankBin belongs to the locked bank.
firstDisplayTextstring✕Accompanying display text (line 1).
secondDisplayTextstring✕Accompanying display text (line 2).
thirdDisplayTextstring✕Accompanying display text (line 3).
playSoundboolean✕true to play a "ting ting" sound before reading the amount (Sacombank 970403 and VIB 970441 transactions always include this sound).
isPrintboolean✕Also print a receipt when reading the amount (for TINGEE MAX devices). Default false.
printDataobject~Receipt print data, required when isPrint = true (ignored when isPrint is not true). See the printData structure

printData structure​

printData has the same structure as the Body of the Print a receipt from the device API (excluding uuid and merchantId), including the receipt template (templateType), logo, store, customer and payment information, QR code and the items list. Required fields:

FieldTypeRequiredDescription
storeNamestring✓Store name (max 100 characters).
itemsobject[]✓List of products; each element includes name, quantity, unitPrice (required) and optional fields. See the items element structure.
totalAmountnumber✓Total amount (VND), minimum 0. The total printed on the receipt is calculated by the system from items.
note

In this API, printData.voiceFile has no effect: the device reads the amount from amount and then prints the receipt.

Code samples​

curl --location --request POST 'https://open-api.tingee.vn/v1/device/read-amount-link-to-merchant' \
--header 'accept: application/json' \
--header 'x-client-id: YOUR_CLIENT_ID' \
--header 'x-request-timestamp: 20240509154004003' \
--header 'x-signature: YOUR_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"uuid": "DEVICE-001",
"transactionId": "TX123456",
"amount": 150000,
"bankBin": "970422"
}'

Sample Response​

{
"code": "00",
"message": "Success",
"data": null
}
FieldTypeDescription
codestringResult code (00 = success).
messagestringResponse message.

Common error codes​

CodeDescriptionHow to handle
1028Device not foundCheck that the device uuid is linked to the Merchant (or the merchantId passed).
1095, 1096Master Merchant merchantId errorPass the merchantId of a sub-Merchant that belongs to the calling Master Merchant.
90, 91, 92, 97Request authentication error (timestamp, client-id, signature)See System error codes.
OthersOther errorsSee Error codes.