New Shopify Certification now available: Liquid Storefronts for Theme Developers

Neither discountedTotalSet nor totalDiscountSet include the line item's discount

Solved
minsko
Shopify Partner
17 1 0

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).

 

Accepted Solution (1)
ShopifyDevSup
Shopify Staff
Shopify Staff
1203 190 420

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

View solution in original post

Replies 4 (4)
wilson_02
Shopify Partner
1 0 0

Are you open for conversation??

wilson
minsko
Shopify Partner
17 1 0

Yes. To clarify, on this issue, I have applied a product discount, not an order discount.

ShopifyDevSup
Shopify Staff
Shopify Staff
1203 190 420

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

minsko
Shopify Partner
17 1 0
Thank you for that explanation.

Regards,

Matt Insko