We’ve got our shop hooked up to our Shopify store, and I’m trying to pull order and shipment data to be imported into our financial system. When looking at the data structure for an order, I see a fields related to the total
, subtotal
, tax
, and discounts
.
I’ve queried against our production account and the “total_discounts” value seems to always be null, regardless if the discount is for the entire order or just a line-item. The total_price seems accurate; however, the subtotal seems to be a calculated value of “line item base price
x quantity ordered
”.
Is this a known issue with Shopify integrations? Are other integrations going to suffer the same missing data? Is this a planned update to support reporting on all these financial details of orders and line items?
Ideally I’d like to see the total_discounts
property at the order level have the value be the total discount applied to the order (not including line-item discounts). Then update the subtotal
key for a line-item to match the “pre tax price” or “sale price” of the line (e.g.for regular items: price
is 50, quantity
is 2, subtotal
would be 100; for discounted lines: price
is 50, quantity
is 2, subtotal
is now 75 which I can calculate a discount of 12.50 per item).
A couple of examples I’ve seen of missing or incorrect information:
From Shopify:
Line-item discount:
Subtotal in Shopify:
The total, including tax, in Shopify is: $40.22
When querying ShipHero for the same order the tax and total price are correct; however, every other value is wrong or empty.
From ShipHero:
The order subtotal
should be 37.50 and the item subtotal
should be 37.50.
The LineItem object returned from ShipHero doesn’t include a discount (or a way to calculate if the product was discounted).
From Shopify:
This order has a coupon code used which provided a discount of $42.00.
From ShipHero:
The subtotal is correct, the total price is correct; however, it’s missing the $42.00 for “total_discounts”.
This is a scenario where I can easily do the math to calculate the discount; however, is this property for specific integrations and not Shopify (and if so, can this be called out in the GraphQL documentation)?