Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Order API discount data doesn't add up

Order API discount data doesn't add up

ClementBR
Shopify Partner
161 2 51

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
Community Manager
3108 344 902

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
161 2 51

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

Liam
Community Manager
3108 344 902

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