What field to use to calculate total discounts in Shopify API post June 2022?

We used to use shopify_order.total_discounts_set.shop_money.amount to figure out how much discounts a store had. However, somewhere around June 2022, the API changed and our results started to diverge from what some stores see in the Shopify Dashboard.

Does anyone know what we should be using instead?

Kind regards,

Piam

Hi @Piam , Do you have examples of orders where your seeing divergent results or can you share more details of the call and response headers that you are using? We have some example query for grapqhQL here if it helps.

{
orders(first: 10) {
nodes {
discountApplications(first: 5) {
nodes {
allocationMethod
value
targetType
targetSelection
__typename
}
}
cartDiscountAmountSet {
shopMoney {
amount
}
}
totalDiscountsSet {
shopMoney {
amount
}
}
}
}
}

2 Likes

Thank you for your response!

The issue was that I couldn’t search the docs correctly:

If you don’t click the “show 67 hidden fields” arrow nothing in it is searchable.

So I missed the documentation!

Cheers,

Piam

2 Likes