Magento 2 Order Number

Each order in your Magento 2 gets a unique number. It starts with the default 100000001, 100000002 and so on.

If you need to mask the real order number from your customers/ competitors, reduce the order number mess for multiple store views or want to make it more user-friendly, below are several ways how to do that.


Editing Order Number in Magento 2

This is how you can modify Order #:

  • change the first digit in the order number in phpmyadmin, MySQL Workbench or in any software that allows browsing a database,
  • shorten the length of the order number from the default 9 characters to the ‘as-much-as-you-need’ characters,
  • change the last digits.

The 1st option comes helpful if you have multiple stores and want to track orders coming from a certain site (e.g., for an English Store View you will get 100000001, while for the French one - 200000001). The 2d and 3d can be used in any scenario.

Important! Make a database backup before you start!


Difference Between 'Order ID' and 'Order Increment ID'

In the backend you can also find the order_id and order_increment_id value. Here is how it differs from order_id:

  • order_id is the internal Magento 2 order ID, the sales_flat_order table primary key value,
  • order_increment_id is the external Magento 2 ID, used for communication with customers.

To change the default order number, either manually edit certain database tables or automate the process with some 3d party extension.


How to Change 'Order Increment ID' in Magento 2

1. Open MySQL database of your Magento 2 store with the help of phpMyAdmin.
2. Find the 'sequence_order_1' table . Note, that this table is located in the database itself, not in the 'information_schema'.
3. Hit the 'Operations' tab and edit the necessary 'increment_id' number under it.


How to Modify the Very 1st Order # in a New Magento 2 Store

1. Open MySQL database of your Magento 2 store with the help of phpMyAdmin.
2. Find and open the 'sequence_order_1' table. Note, that this table is located in the database itself, not in the 'information_schema'.
3. Hit the 'Operations' tab and edit 'Auto_Increment' to the necessary order number.

Important! Don’t forget to make a database backup.

Related Products