Skip to content

EU VAT ID check (VIES)

The EU VAT ID check (VIES) module in Polski for WooCommerce checks a customer's EU VAT number against the European Commission's VIES service from the order screen and records the answer on the order. Enter your own VAT number in its settings and every check also returns a consultation number, the proof that you checked. The module is off by default.

The NIP module validates a Polish tax number and reads company data from the GUS register. Neither can say anything about a VAT number issued by another member state, which is what an intra-EU B2B sale at 0% VAT turns on.

Turn it on under Polski > Modules > EU VAT ID check (VIES).

Setting Default What it does
Your own VAT number empty Makes every check a qualified one, which returns a consultation number. For example PL5260250274; a number without a prefix is read as Polish
Cache answers for (hours) 24 How long a repeat lookup of the same number is answered from cache. A check recorded on an order always calls VIES fresh

The settings are stored in the polski_vies option.

Open the order. Under the billing address a panel shows the VAT ID recorded on it and a Check in VIES button. The answer is stored on the order, so it stays visible afterwards and survives a later look.

The module looks for the VAT ID in these order meta keys, in this order: _polski_billing_nip, _billing_nip, _billing_vat_id. An order without any of them shows no panel. The button needs the edit_shop_orders capability, and the result is saved in the _polski_vies_result order meta.

Panel shows Meaning
Not checked yet. No check has been recorded on this order
Valid: company name, checked date VIES confirmed the number; the consultation number follows when you set your own VAT number
Not valid in VIES (reason) VIES answered that the number is not valid
Could not check: VIES did not answer (reason). Try again later. VIES or the member state registry could not be reached

A valid number returns the registered company name. An invalid one returns the reason VIES gave.

Enter your own VAT number in the module settings, for example PL5260250274. That turns the call into a qualified check, and only then does VIES return a consultation number such as WAPIAAAAaB6nrzVa.

That number is the evidence that the check happened, which is what matters if the 0% rate is ever questioned. Without your own number the check still works, but there is nothing to keep.

A result recorded on an order is always fetched fresh from VIES, never from the cache, because a cached consultation number would document a consultation that never took place for that order. Ordinary repeat lookups are cached for 24 hours by default.

The module reads the country from the VAT ID itself when it carries a prefix, otherwise from the billing country. Two cases are not what you would guess:

  • Greece is EL in VIES, although WooCommerce and ISO both use GR. The module translates it.
  • Northern Ireland is XI.

At checkout, a number with a prefix must also match that country's format (for example DE plus 9 digits, NL plus 9 digits, B and 2 digits) before the field accepts it.

VIES depends on each member state's own registry and both can be down. When VIES cannot be reached or a registry does not answer, the panel says the check could not be made and asks you to try again; that is not reported as "not valid". Only an INVALID answer from VIES reads as not valid. Only a definite answer is cached, so a temporary outage is not remembered as a rejection. An EU number is never reported as valid unless VIES said so.

Swiss numbers (CHE plus 9 digits) are not in VIES. The module checks them against the Swiss UID register when PHP's SOAP extension is available, and accepts a well-formed number when that register cannot be reached.

It does not change the tax charged on the order, apply the 0% rate, or block a checkout. It answers whether the number is registered and records that answer. Deciding how to tax the sale stays yours.

Do I need my own VAT number to use the VIES check?

Section titled "Do I need my own VAT number to use the VIES check?"

No. Without it the check still says whether the number is valid. Only with your own number does VIES return a consultation number, which is what you keep as evidence for a 0% sale.

Does the module check the VAT number automatically at checkout?

Section titled "Does the module check the VAT number automatically at checkout?"

No. At checkout the field only checks the format of a foreign VAT ID. The VIES call happens when you press Check in VIES on the order screen.

The panel shows "Could not check" with the technical reason and the answer is not cached. Press the button again later; an outage is never recorded as an invalid number.