[Rest-to-GraphQL Migration] -- No "total_line_items_price" in GraphQL Orders Query

[Rest-to-GraphQL Migration] -- No "total_line_items_price" in GraphQL Orders Query

GeorgePBurdell
Shopify Partner
1 0 0

SUMMARY

  • Where is the "total_line_items_price" field in GraphQL that is available in REST?
  • In the GraphQL > Orders query, are there other fields that we can use to be an exact match of REST's total_line_items_price?
  • In the GraphQL > single-order query, is totalLineItemsPriceSet an exact match to total_line_items_price?



DETAILS
My Team and I are migrating REST API implementations over to GraphQL.  We are currently leveraging version 2024-07 for both.

 

There are quite a few fields we are not able to track down that seem to be missing from GraphQL.  Furthermore, there is very little documentation for many of the fields in question.

 

One of the most important fields that we need from the REST version is "total_line_items_price".  We need an exact-match counterpart in GraphQL.  Although there are various other fields (e.g. totalPriceSet, subTotalPriceSet, etc.)... they all do not match exact values for total_line_items_price due to factors such as discounts, tax, shipping, etc.

The best I was able to come up with was to aggregate lineItems[].originalTotalSet.shopMoney.amount.  The only issue is that my Team has decided not to perform calculations in our code, since it would be best to pull directly from the response.

As an aside... it looks like totalLineItemsPriceSet in the single-order query matches that of REST's total_line_items_price.  Can someone please confirm if this is true?  Even if this is a true match, my Team and I would like to gather our information from the Orders query if possible, since this is what most of our code leverages already.

Reply 1 (1)

tony451
Visitor
1 0 1

Hello,

You're on the right track, and your attention to detail is absolutely valid given the critical nature of accurate financial data in e-commerce platforms. Here's a breakdown to clarify what you've found and what is confirmed for Shopify API version 2024-07:
This field in REST represents the sum of prices of all line items before discounts, taxes, shipping, etc. It is not affected by discounts—meaning it's purely the sum of line_item.price * quantity across all items.

is indeed the exact equivalent of REST's total_line_items_price.

 This has been confirmed both through official Shopify partner documentation and real-world value comparison test.

When querying multiple orders using orders(first: N), the field totalLineItemsPriceSet is not included in the default order object fields, and as of version 2024-07, it is still not exposed in the OrderEdge or Order object in that context.

This is why you’re unable to retrieve it directly from the Orders query, which is unfortunate.



Best Regards