Missing Financial Data From Orders

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: Screen Shot 2020-06-08 at 17.13.44
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:

Screen Shot 2020-06-08 at 17.15.45 Screen Shot 2020-06-08 at 17.15.58

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:

Screen Shot 2020-06-08 at 17.28.33
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)?

Hi @brett
Thank you very much for the level of details on your request!
I already made a request for this to be changed/added (total_discounts + line_items.subtotal + line_items. promotion_disccount)
As for the value you are seeing on product:{warehouse_products:{value}}} that one corresponds to the value of the product in ShipHero. You can find this value going to the product detail page in ShipHero.
I will let you know as soon as I have an update about this, and please let me know if there is anything else I could help you with.
Thanks again!
Tom

Thanks for the clarification on the warehouse product value. I assumed as much. This gives me a point of reference as that value shouldn’t change, but the line_items.subtotal or line_items.price may change which I could then use product.warehouse_products.value as a way to calculate the “total discount” for that line item. I just need the values to actually be populated to be able to do that.

Another field we would need is the authorizations.transaction_id field.

I will need to get back to you about that field. I’m not really sure if we are still using that one, so I may need to request for that to be added.
I will let you know as soon as I have a better insight on that
Thanks again!

So I see that some of the missing fields now have values. Thanks for pushing out that fix so quickly.

One problem I see is that an order with a line-item discount isn’t actually coming from ShipHero as a line-item discounted item and instead is reflecting it at the order level.

For example, here is a screenshot from the Shopify order screen showing that the discount is a line-item discount:

This manifests in the Shopify JSON in two places: the overall discount amount (total_discounts) at the order level: Screen Shot 2020-06-11 at 13.49.53 and a difference between the price and pre_tax_price of the line item, and the discount is listed in the discount_applications section of the line item:

For the same order, ShipHero is reporting the discount at the order level only, and ignoring the fact that this is a line-item specific discount:

Screen Shot 2020-06-11 at 13.49.53

Screen Shot 2020-06-11 at 13.49.27

Is this something that can be addressed? Even something as simple as just updating the subtotal to reflect the pre_tax_price as reported by Shopify (multiplied by the quantity) would be helpful.

Hi @brett
Thank you very much for the detailed explanation about this.
Is there any chance you can provide the request_id you are getting when making the request?
That way I could use that same order to provide as example when requesting this change.
Thanks again!
Tom

Sure thing! The request_id from yesterday’s testing was: 5ee26d0127c8a7104646926a

Thanks @brett ! I will look into that and get back to you as soon asap

Hi @brett
I think the field you might be looking for is promotion_discount inside the line item, something like this:

line_items(first: 25) {
            pageInfo {
              hasNextPage
              hasPreviousPage
              startCursor
              endCursor
            }
            edges {
              node {
                id
                legacy_id
                quantity
                subtotal
                sku
                price
                promotion_discount
                product {
                  warehouse_products {
                    price
                    value
                    value_currency
                  }

Let me know if that is not what you were looking for,
Thanks again!

That would be the one. Apparently I didn’t refresh the documentation in Altair after the release. Once I updated it, I see the information I need.

Thanks!

1 Like

Hi @brett
I wanted to provide some feedback about the transaction_id field.
It seems like Shopify is not including that field in the payment_details section of the Orders API, so that is the reason we are not storing that information under the transaction_id (it shows as null because its actually empty on our DB).
I requested this to be added but I was told that won’t be possible at the moment.
Let me know if I could still help you with anything about this.
Thanks again!
Tom

Thanks for the explanation @tomasw.

1 Like

@tomasw Is it possible to retrieve the transactions.receipt (or eventually transactions.receiptJson) from the Shopify order(s)? Having this data from Shopify would at least allow us to retrieve the some of the transaction data even if the transaction ID isn’t available this gives me something to work with.

Hi @brett
I checked with our team and we don’t store that data on our side.
I apologize if this question might be too obvious but, is there a reason why you are not calling Shopify API to get that data?
Thanks again!
Tom

Yes, as there will be multiple ecommerce shops integrating with ShipHero, and all need the same data reported to it. So to keep our integration simple, it’s easier to call out to ShipHero for all orders, than split it up and “Shop A” I call ShipHero but “Shop B” I have to call Shopify. The hope was to have a single source of data to pull from.

Hi @brett
I apologize for the delay in responding to this.
Unfortunately, we are not supporting any of the transactions.reciptJson field as we are not storing those when sent by Shopify, so in this case would be best to request it directly from the store.
I made a Feature Request but it has bee said to me that we won’t be able to work on this at the moment.
Thanks again for your patience in this Brett and please let me know if there is anything else I could help you with
Tom