Design checkout, payment and shipping

Number ranges

Order, delivery-note and return numbering your ERP and your accountant both accept.

Document numbers look like a formatting detail until an ERP rejects an order because the number does not match its expected pattern, or an auditor asks why your delivery notes jump from 000412 to 000418. Set the ranges before you go live; changing them afterwards is possible but leaves a visible seam.

Before you begin. Ask the person who owns your ERP what pattern it expects for incoming order numbers, and ask your accounting whether delivery notes and returns need their own sequences. Both answers are cheap now and expensive later.

How a number is built

A range is a template plus a counter:

{prefix}{counter, zero-padded}{suffix}
FieldMeaningExample
codeThe range's identifier. Three are seeded: order, delivery, returnorder
prefixText in frontORD-
suffixText behind-X
paddingWidth the counter is padded to6000123
counterThe last number handed out122
stepHow far the counter advances per draw1
position_stepThe gap between line-item numbers on a document10 → positions 10, 20, 30

With prefix: ORD-, padding: 6 and counter: 122, the next order is ORD-000123. The detail page shows the next number as a preview, so you can see the shape before you commit.

position_step is the one people overlook and later want. A step of 10 means position numbers 10, 20, 30, which leaves room to insert a line between two existing ones without renumbering the document. Most ERP systems number this way and some expect it.

Three documents, three ranges

CodeDraws for
orderThe order number
deliveryEach shipment, your delivery note
returnEach registered return

They are separate on purpose. A shared counter means your first return is number 4,412 and nobody can tell how many returns you have had.

Which range a document draws from is set per market. That is real multi-market numbering: a market can point its order key at its own range code and number off its own counter. A code that names no range is refused outright rather than falling back silently: a wrong number is worse than a failed call.

Per-channel numbering is not supported. A range carries a channel_id field, but it is a label, not a selector: one code is one range, and the draw never reads the channel. You cannot have webshop orders numbered WEB-000123 and EDI orders numbered EDI-000123 from two ranges both called order. If your accounting requires separate sequences per sales channel, plan for separate markets, or number in your ERP instead.

Create or change a range

  1. Go to Configuration › Number ranges.
  2. On a fresh tenant with nothing configured, select Seed defaults to create the order, delivery and return ranges.
  3. Select a range, or New range for an additional one.
  4. Set prefix, suffix and padding to match what the receiving system expects.
  5. Set step. Leave it at 1 unless you have a specific reason.
  6. Set position_step to 10 unless your ERP wants something else.
  7. Check the Next number preview before saving.

Migrating from an existing sequence

If you are moving from a shop or ERP that already issued numbers, set the counter to the last number that system handed out. The next draw continues from there, and you avoid issuing a number that already exists somewhere in your accounting.

Confirm what "last issued" means before you type it: the highest number the old system ever issued, rather than the highest number on an open order.

Never move a counter backwards on a live tenant. It will re-issue numbers that already exist on real documents, and nothing detects the collision for you. You find out when a customer receives two different deliveries with the same delivery-note number.

What to check

  1. Place a test order and confirm the number matches the pattern exactly, including padding.
  2. Create a shipment on it and confirm the delivery note draws from the delivery range, not the order range.
  3. Confirm positions are numbered with your position_step.
  4. Hand a real order number to whoever owns the receiving system and have them confirm it parses.
  5. Check the counter on Configuration › Number ranges has advanced by your step.

Gaps are normal

Your sequence will have gaps. An order that fails validation after the number is drawn, or an approval request that is rejected, consumes a number that is never reused; counters do not go backwards. If your accounting expects a gapless sequence, have that conversation with them before go-live.

Next