Vietnam e-invoice rules API
When a Vietnamese e-invoice must be issued (NĐ 254/2026, Điều 9) and how a wrong one is fixed: notice 04/SS, adjustment or replacement invoice.
action=timing takes a transaction type (goods, export, services, staged, reconciliation, construction, real_estate, lending, insurance, taxi, healthcare, casino, lottery, ETC toll…; action=types lists all 27) and the event dates you know (delivery_date, customs_clearance_date, completion_date, payment_date, reconciliation_date, service_month…). It returns the rule with its article, the latest invoice date (exports: next working day after clearance, holidays included; reconciled services: the 7th of the next month or 7 days after the agreed period; airline agents: the 10th), the latest signing / sending date (next working day) and, with invoice_date, whether the invoice is on time.
action=fix takes the error (buyer_name, buyer_address, amount_in_words → notice only with Mẫu 04/SS-HĐĐT; tax_code, goods, quantity, unit_price, amount, tax_rate, tax_amount → adjustment or replacement), the invoice_kind (with_code, without_code, pos, registered_asset), buyer_type and previous_fix, and returns the steps, whether a written agreement is needed and the exact line "Điều chỉnh / Thay thế cho hóa đơn Mẫu số… ký hiệu… số… ngày…" filled from original. event covers trade discounts, returns, insurance refunds, cancelled prepaid services and settlement changes. action=fields lists the compulsory invoice contents.
Rules by date: from 1/7/2026 Nghị định 254/2026/NĐ-CP and Thông tư 91/2026/TT-BTC (which replaced NĐ 123/2020, NĐ 70/2025 and TT 32/2025); 1/6/2025–30/6/2026 the NĐ 70/2025 version. Read from the official gazette (Công báo). Reference only, with a confidence flag where the text needs interpretation.
Markdown · OpenAPI · Postman · llms.txt
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
action | query|body | string | no | timing | timing, fix, fields or types (guessed from the other parameters when omitted). |
type | query|body | string | no | timing: goods, export, services, staged, reconciliation, telecom_interconnect, construction, real_estate, airline_web, airline_agent, lending, taxi, healthcare, healthcare_bhxh, etc_toll, insurance, lottery, casino, consumer_transactions, night_sales… | |
delivery_date / customs_clearance_date / completion_date / payment_date / reconciliation_date / acceptance_date | query|body | string | no | Event dates (YYYY-MM-DD) used to compute the deadline; service_month (YYYY-MM) and period_end for reconciled services. | |
invoice_date | query|body | string | no | Check an issued invoice: on_time, late or early. | |
error | query|body | string | no | fix: comma list of buyer_name, buyer_address, amount_in_words, other_info, tax_code, goods, quantity, unit_price, amount, tax_rate, tax_amount, other_required. | |
event | query|body | string | no | fix: commercial_discount, goods_return, registered_asset_return, insurance_refund, cancelled_prepaid, bank_fee_refund, settlement_change, fx_gas. | |
invoice_kind | query|body | string | no | with_code | with_code, without_code, pos (cash register) or registered_asset. |
buyer_type | query|body | string | no | business | business or individual (fields also: budget_unit, foreigner). |
original | body | object | no | Wrong invoice: {form, symbol, number, date} for the correction line. | |
date | query|body | string | no | Date deciding the rules (default: the invoice / event date, else today). |
Example
curl "https://apibox.io.vn/v1/vn-invoice-rules?action=timing&type=export&customs_clearance_date=2026-11-06&invoice_date=2026-11-10" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch('https://apibox.io.vn/v1/vn-invoice-rules?action=timing&type=export&customs_clearance_date=2026-11-06&invoice_date=2026-11-10', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const data = await res.json();
console.log(data);import requests
res = requests.get(
"https://apibox.io.vn/v1/vn-invoice-rules?action=timing&type=export&customs_clearance_date=2026-11-06&invoice_date=2026-11-10",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/vn-invoice-rules?action=timing&type=export&customs_clearance_date=2026-11-06&invoice_date=2026-11-10');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"action": "timing",
"type": "export",
"name_vi": "Xuất khẩu hàng hóa (kể cả gia công xuất khẩu)",
"rule_vi": "Người bán tự xác định nhưng chậm nhất không quá ngày làm việc tiếp theo kể từ ngày hàng hóa được thông quan.",
"ref": "NĐ 254/2026/NĐ-CP Điều 9 khoản 1 đoạn 2",
"confidence": "high",
"deadline": "2026-11-09",
"deadline_basis": "next working day after customs clearance 2026-11-06",
"check": {
"invoice_date": "2026-11-10",
"deadline": "2026-11-09",
"status": "late",
"days_late": 1
},
"signing": {
"rule_vi": "Nếu thời điểm ký số khác thời điểm lập hóa đơn: ký số và gửi cơ quan thuế cấp mã / chuyển dữ liệu chậm nhất là ngày làm việc tiếp theo kể từ thời điểm lập hóa đơn (trừ trường hợp gửi theo Bảng tổng hợp).",
"latest_signing_date": "2026-11-10",
"ref": "NĐ 254/2026/NĐ-CP, Phụ lục mục 7"
},
"date": "2026-11-10",
"regime": "nd254",
"reviewed": "2026-11-11",
"disclaimer": "Reference only, not legal / tax / accounting advice; check the official text."
}
Use cases
- Warn a POS or billing app before an invoice is late
- Answer accountants' "invoice when?" questions in a chatbot
- Generate the adjustment / replacement line for an e-invoice provider API
- Check export invoices against the customs clearance date
FAQ
What changed on 1 July 2026?
NĐ 254/2026/NĐ-CP and TT 91/2026/TT-BTC replaced NĐ 123/2020 and NĐ 70/2025. The timing rules stay close; a services deposit no longer triggers the invoice for any service (before, only a listed set), and new cases were added (consumer transaction data, night sales).
Can I cancel a wrong e-invoice?
No. A wrong invoice is either reported with Mẫu 04/SS-HĐĐT (minor errors such as the buyer name or address) or fixed with an adjustment or replacement invoice, after a written agreement with business buyers.
Does it check the invoice XML?
Not here: /v1/vn-einvoice parses and checks the XML. This endpoint gives the rules and deadlines; send the invoice symbol and number as original to get the correction line.
Related APIs
JSON Validator
Check JSON syntax with exact line and column of errors, and validate data against a JSON Schema (draft 4, 7, 2019-09 or 2020-12).
{ }JSON Formatter
Pretty print JSON with 0-8 spaces or tabs, minify it, or sort object keys recursively. Syntax errors are reported with line and column.
CSVCSV to JSON
Convert CSV into an array of JSON objects using the header row, with delimiter auto-detection, number and boolean typing, and row-level errors.