We are in the UK and EU VAT works as follows for us (supply of digital goods) VAT is 20%
UK Customer - Charge VAT even if they supply a TAX ID
EU Customer - Charge VAT unless they supply a valid TAX ID for their country
Rest Of World - Do Not Charge VAT
We integrated the Vatlayer API using the pre-payment webhook to validate the EU VAT number supplied at checkout is both valid and for the right country.
We set-up Taxes in Foxycart as Region European Union Tax rate 20% exempt customers with TAX ID. The problem is if the customer is in the UK they can enter a TAX ID and the VAT becomes zero.
We added another tax rate for United Kingdom at 20% and did not allow a TAX ID to exempt. This caused all UK customers to be charged 20% but if they didn't enter a VAT number that were also charged 20% for the European Union Rate (2 x 20%)
To get the configuration correct we added all member states individually as countries with a tax rate of 20% and exempt if a valid TAX ID supplied. Except for UK where this is unchecked.
This results in the desired behaviour. Yes it took some time to configure but only have to do it once.
It would be simpler if Foxycart allowed the specification of a "Home Country" when selecting "European Union". Every EU country needs this option as they have to charge VAT in their own country no matter what. The "Home Country" is a country where VAT is always charged even if a TAX ID is supplied. This should be optional however as I understand the use case for the need to charge VAT to every EU country for merchants outside of the EU with a EU VAT ID.