The invoice counter (ICV)
A number that goes up by one with every document a device issues, never reset or reused, so any gap in the chain shows.
The controls call the counter tamper-resistant: it is not reset or reassigned to another document, and it increases with every invoice or note. Resetting it is a prohibited function of an invoicing solution.
The counter belongs to the unit, not the business: each invoicing device has one sequence covering standard and simplified documents, and the controls forbid a device from running more than one sequence at a time.
The counter is not the invoice number: the invoice number is the seller's, printed; the counter is a technical value in the ICV element, not printed. A document the platform rejects spends its value; the corrected document takes a new one.
In JooDax
BuiltThe counter advances in the same transaction that writes the sale, so no two documents share a value, and the data file refuses duplicates. A signed document cannot be edited or deleted (two database triggers). Onboarding a new unit, such as moving from local test mode to production, starts a new chain at 1 and stops the old one.
crates/jdx-einvoice-sa/src/schema.sql
Questions and answers
Can a rejected document's counter value be reused?
No. The technical guidelines say neither the counter value nor the UUID may be reused.
Related pages
- KSA-16 Invoice counter value (ICV)
- KSA-13 Previous invoice hash (PIH)
- BT-1 Invoice number
- BR-KSA-33 · Every document must carry an invoice counter value.
- BR-KSA-34 · The counter value contains digits only.
Related concepts
- The previous invoice hash (PIH) and the document chainEach document carries the hash of the one before it from the same device, so documents form a chain in which any deletion or change shows.
- The e-invoice generation unit (EGS)The device or software that issues invoices and holds their chain, key and certificate; each unit has one sequence and one certificate.
- Prohibited functions in e-invoicing solutionsFive things no invoicing solution may do from phase 1: uncontrolled access, tampering with invoices or logs, more than one sequence, exporting the stamping key, and changing the time.
E-invoicing in Saudi Arabia (FATOORA)
Sources
- الضوابط والمتطلبات والمواصفات الفنية والقواعد الإجرائية اللازمة لتنفيذ أحكام لائحة الفوترة الإلكترونية (قرار المحافظ رقم 62738 وتاريخ 1443/11/23هـ) (vfile dated 20230519 (decision 62738)) — ZATCA
- الدليل الإرشادي التفصيلي للفوترة الإلكترونية (vالنسخة الثانية) — ZATCA
- E-invoicing Detailed Technical Guidelines (vVersion 2) — ZATCA
- Electronic Invoice XML Implementation Standard to the E-Invoicing resolution dated 2023-05-19 (v1.2) — ZATCA
Checked on: 4 November 2026. What concerns JooDax is taken from the programs’ own code.