Create a Magento 2 Custom Order Number

Create a Magento 2 Custom Order Number

The Magento 2 customer order number feature makes your ecommerce workflow easier. It allows customers to track and manage their orders efficiently. Online shoppers can view order status shipment details and reorder previous purchases from their account.


Customizing your online store’s order numbers disguises your sales information from competitors. It also allows you to strengthen the brand value of your business. Let’s understand how to use the custom order number feature in Magento 2.

Best Magento Hosting now

Key Takeaway

  • Discover how to customize order numbers in Magento 2 to enhance your e-commerce workflow.
  • There are two methods to change order numbers: database modification and Magento 2 custom order number extensions.
  • Explore the steps to install and configure a custom order number extension.
  • Find out how to configure the extension for order documentation, including invoices, shipments, and credit memos.

How to Create a Custom Order Number in Magento 2 Store

1. Change the Magento 2 order number in the database

You can change the order number in your Magento 2 database by customizing it according to your needs. Modifying the order number sequence provides flexibility to create a unique format and structure for your order numbers.

To change the order number in the Magento database, you must:

  1. Open the PHP My Admin database.
  2. Next, find and open the table "sales_sequence_profile".
  3. Then, you can change the default order numbers in Magento 2.

2. Use Magento 2 custom order number extension

Using a Magento 2 custom order number extension is a simple alternative to order numbers set up manually. It allows easy configuration and management of your order numbering system in Magento 2.


An extension allows you to customize order numbers according to your specific requirements. You can set up unique prefixes, suffixes, start numbers, and padding for your order numbers. It also allows generating unique order numbers that help differentiate your orders. Adding extensions to your Magento site can affect its speed. It will be best to consider a Magento hosting service to keep your site’s performance consistent.

Configure Magento 2 extension for Order Documentation

1. Download the Extension

  1. Visit the official Magento Marketplace or a trusted extension provider.
  2. Purchase and download the Magento 2 custom order number extension.

2. Access Your Server

Connect to the server where your website source folder is located with SFTP or FTP. It will allow access your Magento server.

3. Upload Extension Files

  1. Unzip the extension package.
  2. Upload the extension files from app folder to your Magento root folder. Use the ‘Merge’ upload mode.

4. Connect to Magento Root Directory

Access your root directory with with SSH.

5. Enable Maintenance Mode

To avoid potential issues during installation, enable maintenance mode by running the following command:

bin/magento maintenance:enable

6. Install the Extension

From your Magento root directory, run the following commands:

bin/magento setup: upgrade
bin/magento setup:di: compile
bin/magento setup:static-content: deploy
bin/magento cache: flush

7. Configure the Extension

  1. Log in to your Magento Admin Panel.
  2. Navigate to the extension's settings under Stores > Configuration.
  3. Configure the custom order number settings as per your requirements.

8. Test and Verify

Place a test order to ensure the custom order numbers are generated correctly.

9. Disable Maintenance Mode

After successful installation and testing, disable maintenance mode:

bin/magento maintenance: disable

10. Clear Cache

Clear the cache to ensure the changes take effect:

bin/magento cache: flush

11. Monitor and Troubleshoot

Keep an eye on your store for any issues. Refer to the extension's documentation or support if needed.

Benefits of Magento 2 custom order number functionality

  • The customized order number disguises the number of sales in your store. By default, Magento 2 discloses it in the order ID number.
  • Assign ID numbers for order documentation by flexible patterns. For example, you can include counters, store names, and dates in the ID number.
  • Allows specific number start, increment intervals, and number padding for order numbers.
  • Makes monitoring order status easier and complying with external order tracking systems.

Why do you need a Magento 2 extension for custom order numbers?

Magento 2 custom order number extensions are useful if you want to:

1. Use increment to cover the details of your total orders.

By default, the ID number generated in Magento exposes your order details to anyone, including competitors. The total number of orders is displayed in the order ID number. Every time your sore has a new order, default Magento increases the previous number’s value by one.


An extension allows you to change the order ID number to hide the total number of orders. You can create a pattern for ID numbers that share important details with customers and store managers. For example, use the current date and state the document type - Magento shipping, invoice number, or credit memo.

2. Add flexible patterns and edit order ID numbers.

Magento 2 custom order number with flexible patterns for better e-commerce workflow

Your order ID must convey the shipping, invoice, and credit memo number in a user-friendly way. Easy to track orders improve the order fulfillment journey and enhance user experience.


Creating a pattern for your order numbers allows you to distinguish your brand. Customers can easily spot their orders from your store among other packages in the mailbox. For example, you can create order numbers like ORD-2023-10-08.

3. Individual ID number style for order management

Magento 2 individual ID number style for efficient order management

An extension allows making the documentation ID numbers look consistent. You can customize an ID number template for orders and apply it to shipping, invoice, or credit memos. Depending on your business requirements, you can use a different visual style for each order-related document.

FAQs

1. How can I create a custom order numbering in Magento?

First, access the ‘order number configuration’ from the admin panel. Modify the existing settings on 'settings' to get your custom invoice number.


2. How can I change the order number prefix in Magento 2?

To customize the order number in Magento 2, you can use an extension for Magento 2. Extensions modify the native Magento numbering and enable adding a unique prefix to the order number. It gives you control over your order documents.


3. Do Magento extensions enable increment ID?

An Increment id is an ID through which store owners communicate with the customer. Magento 2 custom order number modules enable order increment ID to maintain the order number format. It ensures you have a real order number customized to meet your specific requirements.


4. How can I customize the prefix to the order number in Magento 2?

You can use third-party extensions to enhance your Magento store’s order management.

The right extension will enable you to add an invoice number prefix and suffix. You can set a custom order number and invoice prefix. It also ensures smooth order processing and customizes the shipment and credit memo numbers.

Summary

Magento 2 custom order number format and structure allow businesses to create unique and easily identifiable order numbers. Using the custom order number extensions helps improve the order management processes.


Create custom order numbers in Magento 2 and enhance your Magento 2 site’s brand value. Always check your third-party integrations and ensure they do not affect your site’s performance. Consider a Magento hosting service to maintain your site’s performance.

Vaishali Sharma
Vaishali Sharma
Technical Writer

As a seasoned writer, Vaishali consistently expands her knowledge in Magento hosting. She has four years of professional experience, with a focus on crafting diverse Magento-related content.


Get the fastest Magento Hosting! Get Started