Hi everybody !
We are trying to get an exact match between discounts from the API and what users see in the Shopify Dashboard.
But in some cases, around 50%, we do not get matching data. We have a small difference.
We use the discount allocation querie.
So I feel we are missing something here. Any idea what it could be ?
Here is our request :
{
orders(first: 250, sortKey: CREATED_AT, reverse: true, after: null, query: “status:any created_at:>2024-10-11 AND created_at:<2024-10-17”) {
edges {
node {
id
name
createdAt
processedAt
displayFinancialStatus
displayFulfillmentStatus
cancelledAt
originalTotalPriceSet {
shopMoney {
amount
currencyCode
}
}
refunds(first: 5) {
createdAt
totalRefunded {
amount
}
totalRefundedSet {
shopMoney {
amount
}
}
refundLineItems(first: 10) {
edges {
node {
id
lineItem {
currentQuantity
discountedTotal
discountedUnitPrice
id
isGiftCard
originalTotal
originalUnitPrice
quantity
totalDiscount
discountedTotalSet {
shopMoney {
amount
currencyCode
}
}
discountAllocations {
allocatedAmountSet {
shopMoney {
amount
currencyCode
}
}
allocatedAmount {
amount
currencyCode
}
}
}
price
subtotal
priceSet {
shopMoney {
amount
currencyCode
}
}
quantity
}
}
}
}
customer {
id
numberOfOrders
createdAt
orders(first: 1, reverse: false) {
edges {
node {
id
createdAt
processedAt
displayFinancialStatus
displayFulfillmentStatus
transactions(first: 8) {
id
kind
createdAt
processedAt
amountV2 {
amount
currencyCode
}
amountSet {
shopMoney {
amount
currencyCode
}
}
}
currentTotalPriceSet{
shopMoney {
amount
}
}
originalTotalPriceSet {
shopMoney {
amount
currencyCode
}
}
totalReceivedSet {
shopMoney {
amount
currencyCode
}
}
totalPriceSet {
shopMoney {
amount
currencyCode
}
}
subtotalPriceSet {
shopMoney {
amount
currencyCode
}
}
lineItems(first: 8) {
edges {
node {
id
isGiftCard
discountedTotalSet{
shopMoney {
amount
}
}
}
}
}
}
}
}
}
totalTaxSet {
shopMoney {
amount
}
}
additionalFees {
price {
shopMoney {
amount
}
}
}
totalShippingPriceSet {
shopMoney {
amount
}
}
totalRefundedShippingSet {
shopMoney {
amount
currencyCode
}
}
shippingLines(first: 20) {
edges {
node {
discountedPriceSet {
shopMoney {
amount
}
}
}
}
}
lineItems(first: 50) {
edges {
node {
id
quantity
isGiftCard
variant {
id
inventoryQuantity
inventoryItem{
id
unitCost{
amount
}
updatedAt
createdAt
}
}
originalTotalSet {
shopMoney {
amount
}
}
originalUnitPriceSet {
shopMoney {
amount
}
}
discountedTotalSet {
shopMoney {
amount
}
}
discountedUnitPriceSet {
shopMoney {
amount
}
}
discountAllocations {
allocatedAmountSet {
shopMoney {
amount
}
}
}
}
}
}
currentTotalPriceSet {
shopMoney {
amount
}
}
transactions(first: 10) {
id
kind
createdAt
processedAt
amountV2 {
amount
currencyCode
}
amountSet {
shopMoney {
amount
currencyCode
}
}
}
totalRefundedSet {
shopMoney {
amount
}
}
totalReceivedSet {
shopMoney {
amount
}
}
subtotalLineItemsQuantity
returnStatus
totalRefunded
}
}
pageInfo {
hasNextPage
endCursor
}
}
}