Shopify mit Fehler bei der Mehrwertsteuer

Technisches

Shopify might miscalculate VAT

Responsible Disclosure: Even though the behavior discussed here is not a security risk, I believe it merits comparable importance and urgency due to the legal and tax risks implied for stores using Shopify. On HackerOne’s Responsible Disclosure page, Shopify gives itself up to four days to respond. What actually happened: I reported the bug on February 4 at 19:38 (all times CET), chat support ended at 20:12. Several times I pointed out the risk and the need for quick response with maximum empathy. Except for an automatic confirmation with chat transcript, nothing happened. On February 8 at 23:54 I followed up by email, no response. On February 10, I contacted Twitter support, but they had no insight into the tickets and recommended that I create another ticket.

I am not an attorney or tax advisor. The following post does not constitute legal advice or recommendation on tax issues or actions.

According to my research, the widespread Shopify system, which is used to operate more than a million stores worldwide, outputs partially incorrect amounts for VAT calculation, at least in Germany. As far as can be seen from the outside, the assumption is that the error can occur in all countries and territories with tax rates. The actual error amounts to only one cent in each case, but may expose the stores behind it to risks and is likely to require at least additional effort in correcting the invoices in numerous cases. In extreme situations, it is conceivable that a significant amount from the point of view of the tax authorities could be miscalculated.

Reconstruction

In Shopify, there is an option to specify that all prices already include taxes. So in the end, you simply enter the final price (say 119€) and Shopify calculates the tax portion itself (in this example, a convenient 19€).

For certain prices, this results in some sort of rounding error, even though the underlying problem is not with rounding, but with variable types. Such an example:

Shopify store example with possibly incorrect VAT calculation.

For a total amount of 44,75€ Shopify gives a tax charge of 7,15€. And this is… almost correct. The actual tax percentage would be calculated as follows:

Tax share = total amount / (100 + tax rate) * tax rate, so in the case of a non-reduced product in the Federal Republic of Germany, tax share = total amount / 119 * 19.

If you now pull out your calculator or digital assistant, you will get 7,14495798319328 € for the above example. Almost roundable to 7,15€ – but only almost. I have consulted numerous, numerous, numerous sources and calculated and recalculated. No explanation allows for the amount of 7.15€. Every VAT calculator – online or on my PC with the software I’ve been entrusting income and sales tax returns to for years – comes up with the other amount.

The net price – that is, the low one, without VAT – is determined in this context as net = total amount / (100 + tax rate) – 100, so in this country *100/119. And as far as I can see from the outside, Shopify first calculates this and then determines the tax via subtraction.

Possible error source

In fact, I noticed the error when I was doing some work myself with invoice templates in Shopify and had to enter taxes manually. Depending on how the calculation is written, Liquid, the template language invented by Shopify, gives a different result for the calculations (code examples slightly simplified):

{% price_without_taxes_correct = product_total_price | times: 100 | divided_by: 119.0 %} 
{% price_without_taxes_wrong = product_total_price | times: 100 | divided_by: 119 %}

Presumably, the reason for this is an implementation decision, as Liquid uses an integer for the result when dividing by integers. I suspect that the internal calculation of the tax is somewhat different after all, because a complete reconstruction of the described procedure would result in almost every second price being erroneous (I have written a small Liquid routine for this purpose), and thankfully this is not the case. It’s not quite possible to estimate how frequent this error happens and whether it might also occur in jurisdictions with other tax rates.

By the way, it is not possible to manually adjust the rate from „19“ to „19.0“ as a hack.

Possible consequences for merchants

A miscalculation of 1 cent – in the above case to the disadvantage of the store – will not let the tax office call in a SWAT team. But:

  • if a store sells thousands of products with such an error per year, the absolute numbers become interesting as well
  • if the error also occurs with small-priced products, a significant loss would also be possible here in relative terms
    formally, the bill is wrong and needs to be corrected
  • possibly legal disputes in competition-intensive scenarios
  • without knowing the exact cause of the error, it cannot be completely ruled out – even though I consider it unlikely – that too little sales tax is charged for individual amounts.

What Shopify should do

Fixing the actual error for Shopify is obviously required – but, if my above assessment of the cause is correct, trivial. For the time being, the organization- after all, Canada’s largest publicly traded company by market capitalization – would be well advised to automatically display corrective invoices and appropriate notices for transactions affected in the past.

Previous

Schreiben Sie einen Kommentar

Ihre E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert