Skip to main content
Customizing the invoice number

Instructions for how to change the invoice number sequence in your documents, to match your accounting invoice numbers.

Bjorn Forsberg avatar
Written by Bjorn Forsberg
Updated over 5 months ago

Having your invoice numbers different from the default number sequence is needed in some countries, where the number must match an existing sequence.

Note: The following guide is relevant if you are using the template designs that are provided within the Order Printer Pro app.

It is possible to have a custom invoice number sequence in your documents through a small change to the template code. The way to do it would be to find this code in your template:

{{ name }}

And replace it with:

#{{ order_number | minus: xxxx }}

Note: You must replace the xxxx in the above code with the correct number to start your sequence.

You can also change

{{ name }}

to

#{{ order_number | plus: xxxx }}

If what you need instead is to increase your order number.

The order number starts at 1 for your first Shopify order, so you need to do the math and adjust the number to get the correct number series based on your needs.

Add a prefix or suffix to the Invoice number

By default, Shopify offers the option to display a prefix or suffix to your new order numbers. For this, go to your Shopify admin-> Settings -> Store details- > Order ID format. Once this is set up, all new orders will include it, and so will our templates.

However, if you want the suffix or prefix added only on our template without configuring it on your Shopify Admin, it's possible. For this, you need to find this variable in your template:

{{ name }}

And replace it with

{{ order_number}} 

Now, add the characters just before the variable (for prefix) or after ( for suffix). As in

#AB{{order_number}}

Then save, and you'll be all set! Any document you generate, whether the order is old or new, will have the characters added.

Draft orders

Shopify creates a different numeration for regular and draft orders. The instructions above will only work with regular and POS orders, so to achieve this in documents meant to be created from Draft orders, such as the Quote for Draft Orders template, please follow the instructions below. In your template, please look for the variable:

{{ name }}

If you want to decrease the number shown, please replace it with:

D{{ name | split: "D" | last | minus: xxx }}

On the other hand, if you require a greater number in your template, you can change

{{ name }}

to

D{{ name | split: "D" | last | plus: xxx }}

Please remember this will be based on the order number given by Shopify to Draft orders, which will usually be #D1, #D2, and so on. This is the number on which you should base the calculation to find the numbers to replace xxx in the snippets suggested above.

Note:💡The invoice number matches the corresponding Shopify order number Thus, the app cannot generate different sequential numbers for different types of orders, such as Online stores vs. POS orders. Since Shopify already assigned them an order number, the app will use that number as the base.

If you have any questions or require help with the above changes, please do get in contact with our friendly 24/7 support team.

Did this answer your question?