Order discount discrepancy? How it could be calculate from REST API order or line items data?

aleksei_s_popov
Visitor
3 0 6

Hi! Could one please explain how "Discounts" are calculated for taxable orders?

For example - there is an order:

GDS Gross salesDiscountsReturnsNet salesShippingTaxTotal sales
46.48-15.06031.429.510.2351.15

 

The order itself has a "fixed_amount" discount of 20 euros and the following line items:

pricetax ratetax pricepre_tax_pricediscount_allocations
200.253.3210.196.49
11.90.251.986.063.86
17.850.252.969.15.79
11.90.251.976.063.86

 

As I understand - with this type of discount "discount_allocations" are calculated as a proportional value of a total discount to the line item price.

And total discount would be a sum of "discount_allocations"/(1+"tax rate"). And it should be 16$.

 

But Shopify says it is 15.06$ !

This is a huge difference! How a euro got lost on Shopify calculations?

Reply 1 (1)

Dive
Shopify Partner
23 1 1

Hello @aleksei_s_popov 

 

Just wanted to know if you found an answer to your problem?

I just try to rebuild your case and there is something weird.

 

The gross sales amount is not the good one. Are you sure about your tax rates?
Because following your table, we should have 49.32 as a gross sales amount. And in your table we got 46,48.

Here is a table that i created to rebuild the tax / discounts amounts.

 

Capture d’écran 2021-10-05 à 15.57.04.png

Hope it helps,

Thomas

E-commerce analytics should be easier, that is why we have created diveanalytics.co