
Custom Order Number for Magento 2 — Branded Order & Invoice IDs
Custom Order Number replaces Magento's default 000000001 order IDs with branded, meaningful numbers — like ORD-2026-04-0042 — built from your own template of prefixes, dates, counters and store codes. Set independent formats for orders, invoices, shipments and credit memos, choose padding and…
"Order 000000001" tells your customers — and competitors — too much
Magento's default order numbers are sequential and obvious. They make your store look brand-new, they leak your order volume to anyone who places two orders a week apart, and they're hard for your team to read on the phone. A proper order number does the opposite: it carries your brand, encodes the date and store, and looks like a business that's been trading for years. Custom Order Number lets you design exactly that — for orders, invoices, shipments and credit memos — from a simple template.
ORD-{yyyy}-{mm}-{counter} — mixing prefixes, dates, store code and a random token.What you'll use it for
- Look established — start at any number and brand every ID, so a new store doesn't advertise that its first order was yesterday.
- Match your accounting — make invoice and credit-memo numbers follow the format your bookkeeper or ERP expects.
- Read numbers aloud — a dated, padded, prefixed ID is far easier for support to quote and for customers to find.
- Separate your stores — give each store view its own counter and store code so numbers never collide or confuse.
How it works
The variables you can use
Combine them however you like. Invoices, shipments and credit memos can each mirror the order number (optionally swapping a prefix — turn ORD- into INV-) or run on a completely independent format with their own counter, padding and reset. A timezone offset makes sure date-based resets roll over at your local midnight, not the server's.
Guaranteed unique — even at peak
Two orders placed in the same instant will never get the same number. Naive numbering breaks under concurrent checkout, handing two customers the same ID. Custom Order Number increments its counter atomically through Magento's sequence system, with an option to use a separate database connection during high-concurrency checkout for an extra guarantee. The result is branded numbers that stay strictly unique no matter how busy your store gets.
Specifications
| Document types | Order, invoice, shipment and credit memo numbers |
|---|---|
| Format variables | {counter}, {store}, {yyyy}, {yy}, {mm}, {dd}, {rand}, {country_code} |
| Counter | Start value, increment step, zero-padding length |
| Reset | Never, daily, monthly or yearly — with a timezone offset |
| Derivation | Invoice/shipment/credit memo can mirror the order number (with prefix swap) or use an independent format |
| Scope | Independent counter per store view, optional |
| Concurrency | Atomic counter; optional separate DB connection for high-traffic checkout |
| Delivery & licence | Composer install, per-domain licence key, updates via Composer |
Works with
Part of the AgenticEcom suite for Sales, Customers & Marketing:
Branded numbers flow through every document Order Manager touches. Included in the Growth and Enterprise bundles.
Frequently asked questions
Can I change order numbers that already exist?
No — existing orders keep their numbers. The custom format applies to new orders (and invoices, shipments and credit memos) created after you set it up, so your historical records stay intact.
Can invoices and credit memos have different numbers from orders?
Yes. Each document type can either mirror the order number — optionally swapping a prefix like ORD- for INV- — or run on its own independent format with a separate counter, padding and reset schedule.
Will two simultaneous orders ever get the same number?
No. The counter increments atomically through Magento's sequence system, and you can enable a separate database connection for extra safety during high-concurrency checkout, so numbers stay strictly unique.
Can I reset the counter each year?
Yes. Choose never, daily, monthly or yearly resets, with a timezone offset so the reset happens at your local midnight rather than the server's.
Which Magento and PHP versions are supported?
Magento Open Source 2.4.9 and later 2.4.x, verified on PHP 8.4 and 8.5.

