Lurox 1.0 is live — visual page building for Magento 2. Read the guide
Custom Order Number User Guide

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.

FieldWhat it doesDefault
EnableTurns 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 / SuffixText before / after the number. Supports date and scope tokens (below).e.g. ORD-
SeparatorCharacter between parts: none, dash, underscore, dot, slash.Dash
PaddingLeft-zero padding of the counter (1–24 digits).6
Increment StepHow much the counter advances per document.1
Date VariablesTokens substituted at generation — see below.(none)
Random ModeNone, Random Only, or Random Append (adds random digits).None
Random LengthHow many random digits (1–24).8
Reset ScheduleAuto-reset the counter: Never, Daily, Monthly, Yearly.Never
Next IncrementThe starting counter value (store-view scope).1
Live preview As you change fields, a preview panel shows exactly what your next number will look like, so you can dial in the format before saving.
The Custom Order Number admin configuration screen with a live number preview.
The configuration screen. The Live Preview (top) shows exactly how your next order, invoice, shipment and credit-memo numbers will look as you edit.

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
ConfigurationResulting number
Prefix [storeCode]-[yyyy], padding 6US-2026-000001
Prefix ORD, dates [mm][dd], padding 5ORD-0405-00001
Prefix INV, Random Only, length 8INV-92847563
Prefix ORD, counter 123, Random Append length 4ORD-000123-R8F3

Set up your first custom order number

  1. Go to Stores → Configuration → Sales → Custom Order Number and expand Order.
  2. Set Enable to Yes.
  3. Adjust the Prefix (e.g. ORD-) and, optionally, tick date variables [yyyy] and [mm].
  4. Check the preview reads the way you want (e.g. ORD-2026-04-000001).
  5. Click Save Config.
  6. Optionally repeat for Invoice, Shipment and Credit Memo — or leave Inherit Order Number on so they reuse the order's number.
  7. 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.

Avoid cross-store collisions If you reset counters (say, daily) but don't include a date or scope token, two stores can produce the same number on the same day. Add [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.

Version 1.1

30 June 2026

  • Added an annotated screenshot of the configuration screen with the live number preview.
Version 1.0

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