<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3754830f-032a-4f4f-9dd8-faced6228851/pro1.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3754830f-032a-4f4f-9dd8-faced6228851/pro1.png" width="40px" /> This is a PRO feature. Upgrade now.

</aside>

<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/7bb10d49-e6e7-47a6-b7fc-11b3fdac5d20/home-icon-silhouette.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/7bb10d49-e6e7-47a6-b7fc-11b3fdac5d20/home-icon-silhouette.png" width="40px" /> Help homepage

</aside>

<aside> <img src="/icons/list_gray.svg" alt="/icons/list_gray.svg" width="40px" /> Page contents

</aside>

Introduction

The Notion API decides how line items are sorted, and this is normally ordered by ascending page creation time, i.e. the item you created first appear above the item you created second, even after reordering them in Notion.

PRO users can override this default ordering, by creating a Notion property for sorting. This should be a number property and Notion Invoice will sort line items from the lowest to highest number.

Line items without sorting numbers will appear below items that do.

Set up your Notion databases

If you are using our latest Starter Template (after 25 August, 2023), then you can skip straight to Set-up custom sorting in your invoice template.

If you are using an older Starter Template or using your own custom invoice database, follow the setup below.

  1. Create a new number property in your Invoice Line Items database. Here I have created one called “Sort order”, but you can name it anything you want.

    Untitled

  2. Now you need to make this property visible in your invoices, by editing the Invoice template in your Invoices database.

Click the down arrow next to the “New” button to reveal the templates, then click on the … dots to edit the Invoice Template.

![line items ordering.png](<https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c5a594ac-8923-4675-a330-a81c24199a71/line_items_ordering.png>)
  1. In the template, scroll down to the Invoice line items table and click on the … dots next to the New button. Go into the Properties menu and make the sorting property visible (see the video below).

    sorting-1.mp4

  2. That’s it. Your Notion databases is now set up for custom line item sorting.

Set-up custom sorting in your invoice template

  1. In Notion Invoice, edit your template, then scroll down to the Line Items section, and find the Line item ordering subsection. It should default to “None”, which is to use default ordering.

    line items ordering2.png

  2. Select the property you just created.

    Untitled

  3. Scroll down to the bottom of the page and click Save.

Sort your line items

When creating an invoice, type in the sorting order numbers in your line items. The lowest number will be at the top, and the highest number will be at the bottom, when the PDF is generated.

You can leave sort orders blank too. Items with blank sort orders will be shown below the items with sort order numbers. This can be useful sometimes when you just want one item to be at the top.

I recommend that you use larger numbers between items. E.g., instead of 1, 2, 3 use 10, 20, 30. This way, if you want to insert a new item as the second item, for example, you can just give it a sort order of 15, instead of having to renumber all the items just to make space for the new item.

line items ordering5.png