Skip to main content

Create and issue an invoice

This API lets you create and sign-and-issue an invoice in a single step (HSM signing). The invoice is officially issued as soon as it is created successfully.

POST
URLhttps://open-api.tingee.vn/v1/e-invoice/create-and-issue

Create, sign and issue an invoice in a single step (HSM signing).

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​

The body is identical to the Create a draft invoice endpoint (CreateInvoiceDto): it includes the invoice information fields, the buyer information (including buyerIdentity and buyerIdType), the items[] list and taxRateSummaries[].

See the full parameter table at Create a draft invoice — Body Parameter.

Code samples​

curl --location --request POST 'https://open-api.tingee.vn/v1/e-invoice/create-and-issue' \
--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 '{
"invoicePattern": "1",
"invoiceSeries": "C25TAB",
"invoiceCode": "INV-20251209-002",
"invoiceDate": "2025-12-09",
"buyerName": "Nguyen Van A",
"buyerLegalName": "CONG TY TNHH ABC",
"buyerTaxCode": "0109876543",
"buyerAddress": "123 Nguyen Hue, Quan 1, TP.HCM",
"paymentMethod": 2,
"paymentMethodName": "Chuyển khoản",
"items": [
{
"itemName": "Dịch vụ thanh toán",
"unitName": "Gói",
"quantity": "1",
"unitPrice": "1000000",
"taxRateCode": "10"
}
]
}'

Sample Response​

{
"code": "00",
"message": "Success",
"data": {
"invoiceCode": "INV-20251209-002",
"trackingCode": "INV-20251209-002",
"invoiceNumber": "C25TAB123",
"reservationCode": "ABC123XYZ",
"codeOfTax": "00A1B2C3D4E5F6A7B8C9D0E1F2A3B4C5D6",
"url": "https://vinvoice.viettel.vn/tracuu?masothue=0101234567&mabimat=ABC123XYZ"
}
}

The example above is the result with the SInvoice provider. Depending on the provider, some fields may be empty ("") or not returned.

FieldTypeDescription
codestringStatus code.
messagestringResult message.
data.invoiceCodestringInvoice code.
data.trackingCodestringTracking code / transaction code at the provider (SInvoice: transactionUuid, same as invoiceCode; XCyber: magiaodich; MISA: TransactionID; BKAV: lookup code MTC; HiLo: fkey).
data.invoiceNumberstringOfficial invoice number (after signing). For BKAV, the value consists of the invoice symbol + invoice number.
data.reservationCodestringSecret lookup code (SInvoice) or RefID reference code (MISA). Not returned for other providers.
data.codeOfTaxstringCode issued for the invoice by the tax authority (XCyber, SInvoice, HiLo). Empty for MISA, not returned for BKAV.
data.urlstringInvoice lookup link (XCyber: link returned by the provider; SInvoice: lookup link by tax code and secret code; HiLo: generic lookup page). Empty for MISA, not returned for BKAV.

Common error codes​

CodeDescriptionHow to handle
2034The invoice has already been issued successfullyDo not resend; use a new invoice code, or call Download invoice / Send email for the issued invoice.
2032No default provider account is configuredCreate an account with isDefault = true, or pass accountId.
1057No account found for accountIdCheck accountId with List accounts.
2038The provider does not support the item type (itemType)XCyber does not support itemType 2/6/7; HiLo and MISA do not support 6/7; BKAV does not support 6.
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.