A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
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
Solved! Go to the solution
This is an accepted solution.
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
}
}
}
}
}
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
This is an accepted solution.
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
}
}
}
}
}
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
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