A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We are trying to determine via the API if a given customer has used a "Buy X Get Y" automatic discount. I have review the various APIs related to discounts and I do not see a way to do that.
I there an API to do this?
Thanks,
John
You can check discounts used from the get Order call.
Hi @jfkScollar 👋
@JustinW is exactly right, the `Order` resource is connected to the `DiscountApplication` interface that includes the `AutomaticDiscountApplication` object. It would look something like this:
{
customer(id:"gid://shopify/Customer/9876543210"){
orders (first:20) {
nodes {
id
discountApplications (first:3){
nodes {
... on AutomaticDiscountApplication {
title
}
}
}
}
}
}
}
Hope that helps!
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 replies with suggestions. I see I can get it from the order API call and the