A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
How do I query for the discount code and discount value (e.g. 10%, 20%, $5) discounted from each lineItem in orders?
With the following query I am able to get the actual final amount discounted on a line, but not the discount value - and I get the discount code applied to the entire order, but I need to know by lineItem (in case there is some mixing and matching of discounts).
query orders_discounts($id:String){
orders(first:1, query:$id ){
nodes{
discountCodes
lineItems(first:20){
nodes{
quantity
originalUnitPrice
discountAllocations{
allocatedAmount{
amount
}
}
}
}
}
}
}
Would this data be stored within discountAllocation.discountApplication? If so, how does one query it?
Thanks in advance!
Hi everyone, is there an answer to this question by now? I also have the requirement of how much the discount amount is per line and discount code.
It is possible to apply different discounts, some of which apply to the entire order and others only to specific items.
Thanks