Skip to main content

Print a receipt from the device

This API instructs a Tingee Box device (TINGEE MAX models with printing support) to print a payment invoice or a receipt using a customizable template.

POST
URLhttps://open-api.tingee.vn/v1/device/print-receipt

Send a print receipt command to a Tingee Box MAX device.

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​

Receipt templates

The device supports 2 print templates, selected with templateType:

  • Template 1 – Simple retail (default): default title HÓA ĐƠN (or PHIẾU TẠM TÍNH when invoiceStage = PRE_PAYMENT).
  • Template 2 – Detailed sales: default title HÓA ĐƠN BÁN HÀNG (or PHIẾU YÊU CẦU THANH TOÁN when invoiceStage = PRE_PAYMENT).

Some fields are only printed on one template — see the "Applies to" note in the Description column. The total printed on the receipt is calculated by the system from items (unit price × quantity), minus lineDiscount, discount, vatReduction, plus tax per taxPercent/taxValue.

FieldTypeRequiredDescription
uuidstring✓Device identifier (the device must be linked to the Merchant).
merchantIdnumber~Merchant ID
(Required if you connect with a Master Merchant account).
templateTypenumber✕Receipt template:
- 1: Simple retail
- 2: Detailed sales
Default 1.
lineWidthnumber✕Print line width (number of characters), from 20 to 80. Default 30.
qrAlignmentnumber✕QR code alignment: 0 (Left), 1 (Center), 2 (Right). Default 1.
logostring✕Name of a logo preloaded on the device. Valid values: printer_receipt_logo, printer_receipt_logo2, printer_receipt_logo3, printer_receipt_logo4.
If omitted, no logo is printed.
copiesnumber✕Number of copies to print, from 1 to 9. Default 1.
Applies to: template 1.
voiceFilenumber✕Notification sound file, from 1 to 6 (1–5: noti_voice1-5.mp3, 6: print only, no sound). Default 1.
titlestring✕Receipt title (max 100 characters), printed in uppercase. If omitted, the template's default title is used.
storeNamestring✓Store name (max 100 characters).
branchNamestring✕Branch name (max 100 characters).
Applies to: template 1.
addressstring✕Store address (max 200 characters).
Applies to: template 1.
hotlinestring✕Phone number / hotline (max 20 characters).
Applies to: template 1.
sellerAddressLinesstring[]✕Seller address lines; each element is printed on its own line.
Applies to: template 2.
taxCodestring✕Store tax code (max 50 characters).
Applies to: template 2.
orderCodestring✕Order code / waybill code (max 50 characters). Printed as the receipt number when invoiceNo is not passed.
invoiceNostring✕Receipt number (max 50 characters).
createdAtstring✕Receipt creation time (ISO 8601, e.g. 2026-10-14T15:30:00+07:00), printed as dd/MM/yyyy HH:mm. Defaults to the time of the API call.
channelNamestring✕Sales channel (max 50 characters, e.g. Bán tại quầy, App).
Applies to: template 2.
employeeCodestring✕Sales employee code (max 20 characters).
Applies to: template 2.
customerNamestring✕Customer name (max 100 characters).
customerIdstring✕Customer code (max 50 characters).
Applies to: template 2.
itemsobject[]✓List of products. See the items element structure.
totalAmountnumber✓Total amount (VND), minimum 0.
Note: this value is not printed; the total on the receipt is calculated by the system from items.
discountnumber✕Discount on the whole receipt (VND), minimum 0. Default 0.
vatReductionnumber✕VAT reduction (VND), minimum 0.
invoiceStagestring✕Receipt stage:
- PRE_PAYMENT: Provisional bill (before payment)
- POST_PAYMENT: Receipt (after payment)
Default POST_PAYMENT.
paidAmountnumber✕Amount tendered by the customer (VND), minimum 0.
Applies to: template 1, when invoiceStage = POST_PAYMENT.
customerPaidnumber✕Amount tendered by the customer (VND), minimum 0. If omitted, it equals the amount due.
Applies to: template 2, when invoiceStage = POST_PAYMENT.
paymentMethodLabelstring✕Payment method label (max 30 characters, e.g. Tiền mặt, Chuyển khoản). Template 2 defaults to Tiền mặt.
Applies to: when invoiceStage = POST_PAYMENT.
paymentAmountnumber✕Actual payment amount (VND), minimum 0, printed next to paymentMethodLabel. If omitted, customerPaid or the amount due is used.
Applies to: template 2, when invoiceStage = POST_PAYMENT.
changeAmountnumber✕Change returned to the customer (VND), minimum 0.
Applies to: when invoiceStage = POST_PAYMENT.
notestring✕Receipt note (max 200 characters).
Applies to: template 1.
qrCodestring✕Content of the QR code printed on the receipt (max 500 characters).
qrHintstring✕Message shown with the QR code, e.g. scanning instructions (max 500 characters).
Applies to: when invoiceStage = PRE_PAYMENT (template 1 also requires qrCode).
bankAccountNamestring✕Receiving account holder name (max 50 characters).
Applies to: template 1, when invoiceStage = PRE_PAYMENT.
bankAccountNostring✕Receiving account number (max 100 characters).
Applies to: template 1, when invoiceStage = PRE_PAYMENT.
bankNamestring✕Receiving bank name (max 50 characters, e.g. MBB, VCB).
Applies to: template 1, when invoiceStage = PRE_PAYMENT.
barcodestring✕Code128 barcode (max 20 characters).
Note: not printed on the receipt yet.
footerNotestring✕Note / thank-you message at the bottom of the receipt (max 200 characters).

items element structure​

FieldTypeRequiredDescription
namestring✓Product name.
quantitynumber✓Quantity, minimum 0.
unitPricenumber✓Unit price (VND), minimum 0.
codestring✕Product code (max 50 characters). Currently not printed on any template.
unitstring✕Unit of measure (max 20 characters, e.g. Cái, Hộp), printed after the product name.
Applies to: template 1.
lineDiscountnumber✕Discount on the product line (VND), minimum 0. Template 1 sums these into a "Giảm KM" (promotion discount) line; template 2 prints it right below the product.
promotionLabelstring✕Promotion label printed next to lineDiscount (max 20 characters). Default KM.
Applies to: template 2.
taxPercentnumber✕Tax rate applied to the product, from 0 to 100 (e.g. 8, 10). Tax is grouped by rate at the bottom of the receipt.
taxValuenumber✕Precomputed tax amount for the product (VND), minimum 0. Only takes effect when taxPercent is set.
If omitted, it is calculated as (unitPrice × quantity − lineDiscount) × taxPercent / 100.

Code samples​

curl --location --request POST 'https://open-api.tingee.vn/v1/device/print-receipt' \
--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",
"copies": 1,
"storeName": "Cửa hàng tiện lợi",
"orderCode": "DH123456",
"totalAmount": 150000,
"items": [
{
"name": "Sản phẩm A",
"quantity": 1,
"unitPrice": 100000
},
{
"name": "Sản phẩm B",
"quantity": 1,
"unitPrice": 50000
}
],
"voiceFile": 6
}'

Sample Response​

{
"code": "00",
"message": "Success",
"data": {
"uuid": "DEVICE-001"
}
}
FieldTypeDescription
codestringResult code (00 = success).
messagestringResponse message.
data.uuidstringIdentifier of the device that received the print command.
note

code = 00 means the print command was sent to the device; it does not confirm that the device has finished printing.


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.