Order API discount data doesn't add up

ClementBR
Shopify Partner
153 2 42

We are investigating a number of orders using the REST API. The discounts data doesn't always seem to add up and we're wondering why.

 

What is the relationship between order.total_discount and order.discount_applications?

 

Here are some example:

 

Below. Why is the total_discount not equal to the discount_allocations amounts?

Are they both applied simulatenously?

 

ClementBR_0-1701724371741.png

 

Replies 3 (3)

Liam
Shopify Staff
2731 294 746

Hi ClementBR,

 

If you test this out with the GraphQL API (using the GraphiQL app to easily run queries), are you seeing the same results? 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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

ClementBR
Shopify Partner
153 2 42

Aren't the REST and GraphQL API supposed to return the same data?

Liam
Shopify Staff
2731 294 746

Correct - but if you're seeing something different then we could narrow what you're seeing down to a possible issue with how you've structured your REST query, or a possible bug on our side. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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