Magento
Custom Order Numbers
Magento’s default order numbers (000000123) tell a customer — and you — nothing. Custom
Order Numbers lets you design them: a prefix, the date, a padded counter, even the
store or country — e.g. ORD-2026-01024 or UK-260615-00042. The same applies to
invoices, shipments and credit memos, the counter can reset each day/month/year, and it’s all
concurrency-safe with built-in collision protection.

Compatibility
Section titled “Compatibility”PHP
Documents
Safe
Build your format
Section titled “Build your format”Compose the number from literal text and tokens:
| Token | Becomes | Token | Becomes |
|---|---|---|---|
{COUNTER} | the padded sequence counter | {YYYY} / {YY} | year |
{STORE_ID} | the store view ID | {MM} / {DD} | month / day |
{country_code} | store default country | {rand} | random hex (uniqueness) |
ORD-{YYYY}-{COUNTER} → ORD-2026-01024{country_code}-{YY}{MM}{DD}-{COUNTER} → GB-260615-00042INV-{YYYY}{MM}-{COUNTER} → INV-202606-00007Set the counter behaviour separately:
| Setting | What it does |
|---|---|
| Start Counter | The first number (e.g. start at 1000 so numbers look established). |
| Pad Length | Zero-pad the counter to a fixed width (5 → 01024). |
| Increment Step | How much the counter advances each order (e.g. 1, or 10). |
| Reset Frequency | Never, Daily, Monthly, or Yearly — the counter restarts at Start Counter each period. |
Reset that’s safe under load
Section titled “Reset that’s safe under load”Will two orders ever get the same number?
No. Numbers come from Magento’s atomic sequence (so the counter is always unique), and a collision guard double-checks each generated order number against existing orders and differentiates it if anything ever clashed — so duplicates can’t reach the database.
Can the counter restart each year (or month/day)?
Yes — set Reset Frequency. The first order of each new period restarts at your Start
Counter, and the date tokens in the format always match the period, so ORD-2026-00001 rolls
to ORD-2027-00001 cleanly on New Year’s Day.
Do invoices and shipments have to match the order number?
Your choice — give each document its own format, or tick same as order to reuse the order number on its invoice/shipment/credit memo.
Does it slow down checkout?
No. With reset set to Never there’s no extra database work at all, and even with a reset the overhead is a single indexed lookup. Verified clean on PHP 8.4 and 8.5.