How to get the value of the order the line items appear on a Hubspot deal?

New Contributor



Our customers at Paycove use Hubspot products to create invoices, quotes, and other documents. After our users add line items to a deal in Hubspot, they want the line items to appear in the same order in Paycove. 


We're currently pulling in the line items for a deal using the CRM Associations endpoint (code 19). However, "display_order" of the deal is not an available field, only the "hs_quote_display_order". This is problematic because most of our customers don't create quotes on Hubspot, but use Paycove to create invoices / quotes. I've tried sorting the line items by the HS created datetime, but it appears that this does not respect the order the line items appear on the deal either. 


Example: line item order in Hubspot:

Line item order returned through CRM Assocations endpoint:


Any suggestions on this?

3 Replies 3
Community Manager

Hi @paycove_rich,


I hope all is well with you 😄


On my end, I created a deal and added five products like this:

This is product one

This is product two

This is product three

This is product four

This is product five


Next, I used this endpoint: Get associations for CRM object and I was return the following results:

240363021 (the line item id) 

240363022 (the line item id) 

240363024 (the line item id) 

240363025 (the line item id) 

240363026  (the line item id) 


Plucking in those line item id into this endpoint: Get line item by ID, I was able to see that the results of the product in the line items is showing the same as what I'm seeing on the UI.


In this case, would you mind sharing with me an example deal where you're seeing a mismatch of the display order from the UI and the endpoint?

Occasional Contributor

Hey Wendy!


Ok great! Your answer helped me realize that I can sort on the line item id that your API provides -- thank you! 


For explanation, the issue is here:

When our app consumes the response from your api, it seems like it's storing them in our database in a random order. I'm not sure if this is on Hubspot's end or ours. Furthermore, we can't sort on the created time because they all have the same time. However, it looks like the line items will be in the order they list on the display. 


I'll try sorting on the line item id and see if that works.




Community Manager

Hi @wooglin,


Awesome! Glad that it helps and do let me know if this works!