Skip to main content

Download an invoice

This API lets you download an invoice as a Base64 PDF.

POST
URLhttps://open-api.tingee.vn/v1/e-invoice/download

Download an issued invoice as a Base64 PDF by invoice code.

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).
accountIdnumber✕Account configuration ID.
The system prefers the account that issued this invoice; only if that cannot be determined does it use accountId (or the default account if empty).
invoiceCodestring✓Invoice code (invoiceCode) you passed when calling Create and issue an invoice.
The invoice template number (mẫu số) and invoice symbol (ký hiệu) are determined by the system.

Code samples​

curl --location --request POST 'https://open-api.tingee.vn/v1/e-invoice/download' \
--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 '{
"invoiceCode": "INV-20251209-001"
}'

Sample Response​

{
"code": "00",
"message": "Success",
"data": {
"invoiceCode": "INV-20251209-001",
"pdfBase64": "JVBERi0xLjQKMSAwIG9iago8PA..."
}
}
FieldTypeDescription
codestringStatus code.
messagestringResult message.
data.invoiceCodestringInvoice code.
data.pdfBase64stringPDF file content in Base64.

Common error codes​

CodeDescriptionHow to handle
2035The invoice has not been issued successfullyYou can only download invoices issued via Create and issue an invoice.
2032No default provider account is configuredConfigure a default account or pass accountId.
1057No account found for accountIdCheck accountId with List accounts.
1095, 1096Master Merchant merchantId errorPass the merchantId of a sub-Merchant belonging to the Master Merchant calling the API.
90, 91, 92, 97Request authentication error (timestamp, client-id, signature)See System error codes.
OthersOther errorsSee Error codes.