Use API to determine if customer used automatic "Buy X Get Y" discount

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 :waving_hand:

@JustinW is exactly right, the Order resource is connected to theDiscountApplication 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!

Thank you for your replies with suggestions. I see I can get it from the order API call and the

discount_applications key in the response. I was hoping to use a call to a “discount” API that would then list the orders and/or customers who have used it in its response.