We are using GraphiQL to fetch orders.
The discounts data is not fit to the UI reports.
one order for example,
API discounts - 29,980
UI discounts - 25,193.27
The other numbers, like taxes and total sales are fit -> it is not a currency difference.
The same results with totalDiscountsSet node and cartDiscountAmountSet node.
Please help me to explain the difference.
@Amichay how are you handling the GraphQL API request? Since there are specific fields that need to be referenced to determine the order line item discount amounts. And then you'd need to write code to iterate through the results to tally up the grand total.
For example, below where I'd consider the order's sum lineItem.discountAllocations.allocatedAmountSet.presentmentMoney.amount value to be the discounted amount.
{
order(id: "gid://shopify/Order/1863955054644") {
lineItems(first: 5) {
edges {
node {
discountAllocations {
allocatedAmountSet {
presentmentMoney {
amount
currencyCode
}
}
}
}
}
}
}
}
Hi @Greg_Kujawa
After using lineItem.discountAllocations.allocatedAmountSet.presentmentMoney.amount
I still get results that are different from the UI results.
Any idea why?
User | Count |
---|---|
13 | |
12 | |
7 | |
6 | |
5 |