Hello,
Me and my team are trying to get the following:
- All orders for a specific time period
- All refunds for a specfiic time period
- Match orders and refunds with specific product ID
With the above information we want to construct a daily view of how much each product made per day in net sales (orders - refunds) incluing the amount of units sold.
Also, we want to track partial refunds that potentially do not refer to a speicfic product (if there is such case).
We want to do this via the bulkOperationRunQuery
to avoid throttling. We tried to do this by having the bellow example (is not fully complete) but we keep ruinning into the same error “Queries that contain a connection field within a list field are not currently supported.”
mutation GetOrdersBulk {
bulkOperationRunQuery(
query: """
{
orders {
edges {
node {
id
createdAt
billingAddress {
countryCodeV2
}
lineItems {
edges {
node {
id
title
quantity
variant {
product {
id
}
}
discountedTotalSet {
shopMoney {
amount
currencyCode
}
}
}
}
}
refunds {
id
createdAt
refundLineItems {
edges {
node {
lineItem {
title
}
}
}
}
}
}
}
}
}
"""
) {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}
Any guidance on how we can construct the report we want for each day by product and net sales would be greatly appreciated as we’ve been going in loops always running into the same errors.
Many thanks!