Custom Order Number User Guide
Branded, formatted order numbers — prefixes, dates, counters and resets, per store.
Why custom order numbers?
Out of the box, Magento gives orders plain sequential IDs like 000000123.
Custom Order Number replaces those with branded, formatted numbers that suit your business —
add a prefix, a date, store or website codes, padding, even a random component, and reset the
counter daily, monthly or yearly. It applies to orders, invoices, shipments and credit memos,
and each store keeps its own independent counter.
Where to configure it
Stores → Configuration → Sales → Custom Order Number.
There's a section for each document type — Order, Invoice, Shipment, Credit Memo. They share the same fields; the three child documents add an Inherit Order Number toggle.
| Field | What it does | Default |
|---|---|---|
| Enable | Turns custom numbering on for this document type. | No |
| Inherit Order Number (child docs) | Reuse the parent order's number instead of generating a new one. | Yes |
| Prefix / Suffix | Text before / after the number. Supports date and scope tokens (below). | e.g. ORD- |
| Separator | Character between parts: none, dash, underscore, dot, slash. | Dash |
| Padding | Left-zero padding of the counter (1–24 digits). | 6 |
| Increment Step | How much the counter advances per document. | 1 |
| Date Variables | Tokens substituted at generation — see below. | (none) |
| Random Mode | None, Random Only, or Random Append (adds random digits). | None |
| Random Length | How many random digits (1–24). | 8 |
| Reset Schedule | Auto-reset the counter: Never, Daily, Monthly, Yearly. | Never |
| Next Increment | The starting counter value (store-view scope). | 1 |

Format tokens & worked examples
Use these tokens in the Prefix or Suffix:
[yyyy]four-digit year,[yy]two-digit year[mm]month,[dd]day[storeCode]store view code,[websiteCode]website code
| Configuration | Resulting number |
|---|---|
Prefix [storeCode]-[yyyy], padding 6 | US-2026-000001 |
Prefix ORD, dates [mm][dd], padding 5 | ORD-0405-00001 |
Prefix INV, Random Only, length 8 | INV-92847563 |
Prefix ORD, counter 123, Random Append length 4 | ORD-000123-R8F3 |
Set up your first custom order number
- Go to Stores → Configuration → Sales → Custom Order Number and expand Order.
- Set Enable to Yes.
- Adjust the Prefix (e.g.
ORD-) and, optionally, tick date variables[yyyy]and[mm]. - Check the preview reads the way you want (e.g.
ORD-2026-04-000001). - Click Save Config.
- Optionally repeat for Invoice, Shipment and Credit Memo — or leave Inherit Order Number on so they reuse the order's number.
- Place a test order to confirm the number appears as expected.
Multi-store & scope
Settings apply at Default, Website or Store View scope, so each brand can have its own prefix, format and reset schedule. Next Increment (the starting counter) is set per store view. Each store keeps an independent counter.
[storeCode] or a date token to the prefix to keep
numbers unique across stores.FAQ
My invoices show the order number — is that right? Yes. By default invoices, shipments and credit memos inherit the parent order's number. Turn off Inherit Order Number to give them their own format.
Can I change the starting counter later? Yes — set a new Next Increment (store-view scope) and the next document uses it.
What if I disable the module? Magento's native sequential IDs take over; your configuration is preserved for when you re-enable.
What happens on a random-number collision? Random-only mode checks that a generated number hasn't been used and retries; in the rare event it can't find a free one it falls back to a native ID.
Changelog
This guide is itself a Lurox page. Every revision is a published version in Lurox's built-in content history, so we can roll any guide back to an earlier version at any time. The public changelog below tracks what changed and when.
30 June 2026
- Added an annotated screenshot of the configuration screen with the live number preview.
30 June 2026
- Initial publication: configuration fields, format tokens, setup walkthrough, multi-store scope and FAQ.
Explore the rest of the library
Browse every Cabbage Patch Studios user guide in one place.
All User Guides