One of the standard Shopify reports is “Total Sales by Order” - this has a column called “Gross Sales” - this is the full unit price of an item with tax removed (but crucially no discounts applied). I need to access the same value via Graphql but unable to find an appropriate variable. Is there one ?
In the Shopify GraphQL Admin API, there isn’t a direct field that corresponds exactly to the “Gross Sales” column from the “Total Sales by Order” report.
You need to iterate through the orders and calculate the gross sales.
Sorry if I wasn’t clear in my original post but it’s the line item “Gross Sales”, ie the “Gross Sales” for one item in one order - I know it’s a poorly named column in Shopify’s report but that’s what they have called it. It represents the original price of the item excluding VAT.
Each order line item contains a variant field, which includes the original price of the item. Can you use this to calculate the gross sales?
Unfortunately not, simply dividing by (1 + VAT) creates rounding errors - sometimes shopify rounds up sometime rounds down - I think it tweaks the on 1p if it needs to make the overall TAX on the order correct.