How Shopify calculates taxes when percentage discount applied?

For Shopify stores configured to handle prices with inclusive taxes, below is Shopify logic on calculating taxes with discount applied

This article explains how Shopify's tax engine calculates taxes when discounts are applied.

This method potentially reduces the taxable amount, which may be legally questionable and could violate tax laws.

The Shopify support team is reportedly aware of this issue.

When discounts are applied, the logic is: 

  1. The Discount amount calculated using a formula:  Total product amount (including taxes) * Discount %
  2. Taxable amount calculated using formula: Total product amount (including taxes) / (1+VAT rate of delivery country) – Discount amount from step 1
  3. Tax amount calculated using formula: Taxable amount * VAT rate of delivery country.

When a 100% discount is applied, taxes are not calculated for the affected items.

Example:

Order delivery country is Netherlands.

VAT rate in Netherlands is 21%.

How Shopify calculated total Tax 8.07€?

  1. Discount amount = 35€(Subtotal = Products amount including taxes) * 10%(Discount) = 3.5€
  2. Taxable amount = 35€(Subtotal)/(1 + 21%(VAT rate)) – 3.5€(Discount amount) = 28.93€
  3. Tax for the products = 28.93€ * 21%(VAT rate) = 5.34€
  4. Tax for the Delivery 12.99€ * 21% (VAT rate) = 2.73€
  5. Total tax = Tax for the products + Tax for the Delivery = 5.34€ + 2.73€ = 8.07€

Need to keep in mind that Shopify applies rounding to 2 decimals  on each step.