I'm posting this only because I keep losing this simple VATMOSS logic, and my blog doubles as my online memory bank. It's also important for me to say VATMOSS does not rule, it's terrible.

Anyway, this is the logic that states when VAT should be applied to which kinds of customers.

MY WORKSHOPMaster Next.js

Everything you need to master universal React with Next.js in a single intense master class. Includes full pass to ffconf, the web developer conf.

What to capture

  • VAT (optional and validated though all kinds of silly methods)


This is from the perspective of being in the UK.

IF country IS "GB"
IF country IS IN (eu) AND vat IS EMPTY
IF country IS IN (eu) AND vat IS NOT EMPTY


List of EU countries and ISO codes (from GOV.UK):

Austria AT, Belgium BE, Bulgaria BG, Croatia HR, Republic of Cyprus CY, Czech Republic CZ, Denmark DK, Estonia EE, Finland FI, France FR, Germany DE, Greece EL, Hungary HU, Ireland IE, Italy IT, Latvia LV, Lithuania LT, Luxembourg LU, Malta MT, Netherlands NL, Poland PL, Portugal PT, Romania RO, Slovakia SK, Slovenia SI, Spain ES, Sweden SE and the UK GB.

var EU = ['AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'EL', 'ES', 'FI', 'FR', 'GB', 'HR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK'];

Where to get latest EU VAT rates: http://jsonvat.com

Usual caveat's apply: this not consistute as financial advice, if you copy and paste this and it's wrong, you're responsible!