Magento2 – Change the order number’s prefix of a specific store
Some merchants want to customize order numbers or invoice numbers to be different than what Magento 2 produces by default. Because of the limitation of order number in default Magento 2, many merchants are finding a solution to make modifications to order number. Each order in your Magento 2 gets a unique number. It starts with the default 100000001, 100000002 and so on.
We can individually adjust the following properties of increment IDs for Orders, Invoices, Credit memos, & Shipments:
- Prefix
- Suffix
- Step
- Start-value
- Pad-length
You can manage it like below:
Magento 2 database contains a table name ‘sales_sequence_profile‘ which has prefix column and every row contains a meta_id which relates with table ‘sales_sequence_meta‘.
Table ‘sales_sequence_meta‘ sequence table names according to stores and type(order, invoice, shipment, creditmemo).
- sequence_order_* contains the last inserted order ids
- sequence_shipment_* contains the last inserted shipment ids
- sequence_invoice_* contains the last inserted invoice ids
- sequence_creditmemo_* contains the last inserted creditmemo ids
Basically this is just for understanding. You need to update the table ‘sales_sequence_profile‘ and related sequence tables.
You can change this using by changing related store db tables. i.e
if your store id is 1 :
change prefix column value in your sales_sequence_profile table against your meta_id = 1;