Blog · 2026-08-27
Why an order number should only exist after payment
An order number is a promise to your accountant, not a label for a browser session. Why numbering starts at payment — and when it may start earlier.
TARGET PHRASES
order number · order numbering · sequential numbering · abandoned checkout · quote versus order · audit trail · make-to-order shop
BODY
Most shops number an order the moment somebody presses a button.
It looks harmless. It is the single decision that decides whether your books can be read a year later, and almost nobody makes it on purpose.
Two different things wearing the same name
There are two identifiers in every sale, and they do opposite jobs.
One is a session reference. It exists so the browser, the payment provider and your own server can talk about the same basket while the customer is still deciding. It is disposable. Nobody outside the machine ever sees it, and it is fine for thousands of them to be created and thrown away in a week.
The other is the order number. It goes on the invoice, on the delivery note, in the accounts, in the courier's system, and into the customer's e-mail. It is permanent, sequential, and somebody else relies on it.
Giving both jobs to one number is where the trouble starts.
The gaps nobody can explain
If the number is minted when the basket is created, then every abandoned checkout takes one with it.
Someone opens the page at eleven at night, gets as far as the card form, decides to ask their partner first, and closes the tab. That number is gone. It is not cancelled, not refunded, not anything — it simply never becomes a sale.
A year later the accountant asks what happened to 0147.
There is no answer. There is no document, no money, no customer, no record of a decision. Just a hole in a sequence that is supposed to be continuous, and a conversation you cannot win because you genuinely do not know.
Sequential means something to other people
Inside your own business a gap is an oddity. Outside it, a numbered series is treated as evidence that nothing was removed.
That is the whole point of numbering a document. Auditors, tax authorities and buyers all read a sequence the same way: if it runs unbroken, nothing was quietly deleted. Hand them a series with a third of the numbers missing and you have volunteered to explain each one.
Payment is the last irreversible moment
Before the money moves, everything is a draft.
The card can fail. The bank can decline. The 3-D Secure window can be abandoned halfway. The customer can change the quantity, change their mind, or never come back at all. None of that should leave a mark on your ledger, because none of it happened.
The moment the money confirms, the sale stops being a possibility and becomes a fact. That is the first instant at which a permanent number is honest.
One second
In the shop we built for a sauna manufacturer, the rule is written into the server, not into a habit.
The payment confirmed at 07:33:57. The order number was minted at 07:33:58.
That order came out of a real card payment, and the sequence behind it has no gaps, because nothing that failed to become a sale was ever given a number to hold.
What the customer sees instead
The obvious objection: the buyer needs something to refer to while they wait.
They get the session reference, and it is enough. It is in their browser and in the thank-you page, it survives a redirect to the bank and back, and it is what the shop uses to answer "did my payment go through?" while the payment provider is still confirming.
Then it is replaced by the real number, once there is one. The customer is never told a number that might not exist tomorrow.
The case where the number comes earlier, and it is correct
None of this means money always comes first.
Sell to another business on an invoice with thirty days to pay, and the invoice itself is the commitment. It is a legal document, it must be sequential, and it exists long before the transfer arrives. There the number is minted at the invoice, not at the payment — and the same principle is holding: the number appears at the first moment the sale becomes a document somebody else relies on.
A quote is not that document. A quote is a proposal, and proposals should be numbered in their own series or not at all.
Both halves of that live in the same flow — see [the eight steps from order to invoice](/blog/order-to-invoice-eight-steps-in-a-make-to-order-shop).
The rule underneath all of it
A number is minted when the thing it names becomes real, and never before.
Everything upstream of that moment — baskets, sessions, quotes, enquiries — can have as many disposable references as it likes.
Three questions for your own shop
How many numbers were issued last month, and how many of them became sales?
If somebody asks about a number in the middle of your series, can you produce a document for it?
And when your system creates the number, is it because money moved, or because a page loaded?