A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
When querying the line items for an order, I noticed that the discountedTotalSet (which should be the original price - discount) shows the original value and does not apply the discount. https://shopify.dev/docs/api/admin-graphql/2023-10/objects/lineitem#field-lineitem-discountedtotalse...
The discount can be seen in the discountAllocations but not in the totalDiscountSet nor the discountedTotalSet .
I have attached a redacted query and the results: (ignore the .csv as they are really .txt).
Solved! Go to the solution
This is an accepted solution.
Hey @minsko and @wilson_02!
This is a great question. I tested to replicate here, and it is working as expected.
The discountedTotalSet field must be explicitly set using draft orders, Shopify scripts, or the API. It's recommended instead to use discountAllocations.
Our GraphQL documentation is not as clear on this field as we are on REST, so I'll get that feedback over to our team.
Hope that helps!
- Kyle G.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Are you open for conversation??
Yes. To clarify, on this issue, I have applied a product discount, not an order discount.
This is an accepted solution.
Hey @minsko and @wilson_02!
This is a great question. I tested to replicate here, and it is working as expected.
The discountedTotalSet field must be explicitly set using draft orders, Shopify scripts, or the API. It's recommended instead to use discountAllocations.
Our GraphQL documentation is not as clear on this field as we are on REST, so I'll get that feedback over to our team.
Hope that helps!
- Kyle G.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog