How are invoices numbered correctly?
Published
The rule
Every tax invoice carries a unique sequential number: ascending, gapless, never repeated, never reused. Sequencing is not housekeeping - it is a control: it makes the completeness of your sales record provable. If your last invoice is 1500 and the year opened at 1001, your record holds 500 invoices - nothing hidden above, nothing deleted below.
Why a gap is an audit flag
A sequence gap (…1447, 1448, 1450…) asks one question with no comfortable answer: where is 1449? An invoice issued and deleted? Sales left off the return? This is why compliant systems don't offer deletion at all: a wrong invoice stays in the sequence and is neutralised by a credit note - the record stays complete, and the correction is documented.
Multiple series
More than one numbering series may run in practice - one per branch or per invoicing device/unit - provided each series is internally sequential and distinguishable (a prefix, typically):
RYD-2026-00042 Riyadh branchJED-2026-00017 Jeddah branchCN-2026-00005 Credit note series
Credit and debit notes are numbered series under the same controls, linked to the original invoice reference.
A structural tip: don't load the number with meanings that change (customer name, service type) - a reclassification then breaks your numbering logic. Branch prefix and year are enough, and stable.
What Phase 2 added
Linkage stopped being procedural and became cryptographic: each invoice carries an ascending counter and a reference to the hash of the previous invoice in its series, forming a chain in which no link can be deleted, and no invoice inserted retroactively, without verification breaking. Sequence became a mathematical property rather than an administrative rule.
Frequently asked questions
A new year started - do I reset the counter?
An annual series with a year prefix is common, accepted practice as long as each sequence is complete in itself and distinguishable. What matters is that numbers cannot be confused across years.
I issued a test invoice on the live environment by mistake?
It keeps its number and receives a full credit note. The simulation environment exists precisely for this - experiments have no place in the production series.
Is the invoice number the same as the UUID?
No. The sequential number serves human reading and accounting control; the UUID is a technical identifier the system generates under Phase 2. An invoice carries both, for two different jobs.