Skip to main content

Get invoice templates

This API lets you get the list of invoice templates registered with the provider.

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

Get the list of invoice templates registered with the provider.

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 (if empty, the default account is used).
providerstring~Provider: x-cyber, hilo, s-invoice, misa, bkav.
taxCodestring~Tax code.
usernamestring~Username of the provider account.
passwordstring~Account password.
invoiceNoToChecknumber~Invoice number to check (greater than 0).
Required when the provider is HiLo (provider = hilo, or the account selected by accountId / the default account belongs to HiLo).
Two ways to query invoice templates
  • By a configured account: pass accountId (or leave it empty to use the default account).
  • By direct login credentials: if you pass any of provider, taxCode, username, password, you must pass all 4 fields.

Code samples​

curl --location --request POST 'https://open-api.tingee.vn/v1/e-invoice/invoice-templates' \
--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 '{
"invoiceNoToCheck": 100
}'

Sample Response​

{
"code": "00",
"message": "Success",
"data": [
{
"invoicePattern": "1",
"invoiceSeries": "C25TAB",
"quota": 950
}
]
}
FieldTypeDescription
codestringResult code (00 = Success).
messagestringResponse message.
dataarrayList of invoice templates.
data[].invoicePatternstringInvoice template number (mẫu số).
data[].invoiceSeriesstringInvoice symbol (ký hiệu).
data[].quotanumberNumber of invoices remaining that can be issued. Currently only HiLo returns this field.

Common error codes​

CodeDescriptionHow to handle
2032No default provider account is configuredConfigure a default account, pass accountId, or pass all of provider/taxCode/username/password.
1057No account found for accountIdCheck accountId with List accounts.
1005Missing invoiceNoToCheckPass an invoiceNoToCheck greater than 0 when using a HiLo account.
2007The provider does not support retrieving invoice templatesBKAV does not support this API; enter the invoice template number and invoice symbol yourself.
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.