Magento 2 order ID can be shown in the sales documents like invoice, shipment, or credit memo. The order ID in Magento 2 makes the admin’s order management task easier.
The admin can get invoice data from order ID as well as the order information in Magento 2.
Not only that, but the customers also use order ID to track their orders in Magento 2 store. The extensions like Magento 2 Order Tracking uses only order ID and email address to let customers track their orders. You can also create barcode and add it in Magento 2 invoice PDF as it helps the customer to scan and get the order id using which it is easy to get order details.
Hence, it can be quite useful to add order ID in invoice PDF in Magento 2.
Steps to Add Order ID in Invoice PDF in Magento 2

- Login to Magento 2 admin panel
- Go to Stores > Settings > Configuration
- Under Sales, select PDF Print-outs
- Expand the Invoice sectionto Add Order ID in Invoice PDF in Magento 2
- Set Yes in Display Order ID in Header to enable order ID in invoice PDF.
- Click Save Config
That’s it.
The admin can also add order ID in other sales documents like shipment and credit memo.
Once done, the invoice PDF displays the order id as shown here:

If you choose to not add order ID in the sales document, the invoice looks like this:

Moreover, the store owner can use Magento 2 Custom Order Number extension for customizing order numbers by prefixes, suffixes, letters, counter, or any random numbers to match your business needs.
Don’t forget to share this post with Magento Community via social media.
You can also refer to Add Order ID in Invoice PDF in Magento 2 from our Magento 2 video tutorial series:
Thank you.