How to Validate a VAT Number Using VIES

L'équipe PrestaInsights

Introduction

If your e-commerce business sells to other businesses (B2B) across the European Union, you are likely familiar with the reverse charge mechanism. This rule allows you to sell goods and services tax-free to B2B buyers in other EU countries—but there is a catch. You are legally required to verify that your customer’s VAT number is active and valid.

If you fail to validate a VAT number and process a tax-free sale to an invalid business, you may be held liable by tax authorities for the unpaid VAT, plus interest and penalties.

To help merchants stay compliant, the European Commission provides a database tool called VIES (VAT Information Exchange System). In this guide, we will walk you through how to validate a VAT number using VIES manually, how to automate the validation process on your PrestaShop store via API, and how to troubleshoot common VIES errors.


What is VIES (VAT Information Exchange System)?

VIES is a search engine hosted by the European Commission. It does not store VAT data itself; instead, when you input a query, VIES connects to the national VAT database of the respective EU country in real time to verify if the VAT registration is active.

VIES returns two primary pieces of information:

  • Validity: Whether the VAT number is active and registered.
  • Associated Details: The business name and registered address (depending on national privacy rules, some countries do not display the address).

This system is crucial for e-commerce because it serves as the official, legally binding proof needed to justify tax exemption on cross-border transactions.


How to Manually Check a VAT Number on VIES

If you are processing orders manually or need to double-check a client’s credentials, you can use the official web interface:

  1. Navigate to the official VIES website.
  2. Select the member state from the dropdown menu (e.g., Germany, France).
  3. Input the VAT number (excluding the country prefix).
  4. Enter your own business VAT details as the “requester” (optional, but highly recommended as it generates a unique Consultation Number for your audit log).
  5. Click “Verify.”

Save the PDF confirmation! If tax authorities ever audit your cross-border sales, showing a saved PDF invoice with the VIES Consultation Number is your shield against retroactive VAT claims.


Automating VAT Validation in PrestaShop

While manual lookups work for a handful of orders, they are impossible to maintain at scale. If you run a high-volume PrestaShop store, you must automate this check during checkout.

The PrestaShop Native Solution: “VAT Number” Module

PrestaShop comes with a built-in module called the **EU VAT Number** module (usually found under the customer modules category). It adds a VAT number input field to the checkout page and verifies it against the VIES database when a customer enters their company information.

If validated, PrestaShop automatically removes the tax from the cart total for eligible B2B orders.

Limitations of Native PrestaShop Validation:

  • Lack of fallback rules: If the VIES server goes offline (which happens frequently), native validation may fail or let invalid numbers bypass checkups.
  • No Audit Trail: The native module does not save a timestamped VIES Consultation Number for each transaction.
  • Limited checkout styling: The user experience isn’t optimized, which can lead to cart abandonment if a buyer runs into issues with formatting.

Upgrading to a Premium VIES Module

For professional B2B stores, we recommend choosing a premium module from the Addons Marketplace. A robust module will:

  • Validate numbers in real-time via AJAX as the customer types.
  • Auto-fill company names and addresses directly from VIES.
  • Log the validation token or consultation code to the database for tax record audits.
  • Provide a fallback mechanism (such as putting the order on hold for manual review if the VIES servers are down).

How to Use the Free VIES API for Developers

If you prefer a custom-coded solution for your store or ERP integration, the European Commission provides a free public API. The API is available in both REST (JSON) and SOAP (XML) formats.

VIES REST API Example:

You can query the REST API directly using a standard HTTP request. Here is an example endpoint structure:

https://ec.europa.eu/taxation_customs/vies/rest-api/ms/FR/vat/123456789

A successful JSON response looks like this:

{
  "isValid": true,
  "requestDate": "2026-05-31T10:40:00.000Z",
  "userError": "VALID",
  "name": "E-COMMERCE COMPANY SAS",
  "address": "123 RUE DE LA COMPLIANCE, 75001 PARIS",
  "vatNumber": "123456789",
  "countryCode": "FR"
}

By connecting your PrestaShop checkout logic directly to this API, you can customize the validation flow to perfectly match your brand’s checkout experience.


Troubleshooting Common VIES Validation Errors

When dealing with VIES validations, you will inevitably run into error messages. Understanding what they mean will help you resolve checkout blockages quickly.

1. “Invalid Input / Number Not Active”

The VAT number exists but is not registered for EU cross-border transactions.

  • The Fix: Inform your client that they must contact their local tax office to activate their VAT number for intra-community transactions. A company can have a valid national VAT number that is not registered for cross-border VIES validation.

2. “MS_UNAVAILABLE / Service Offline”

The national database of the country where the VAT number is registered is offline.

  • The Fix: Each member state maintains its own database. If the German registry goes offline, VIES cannot check German numbers. Implement a fallback rule in your store to store the order under review instead of flatly rejecting the checkout.

3. “TIMEOUT”

The gateway failed to respond in time.

  • The Fix: Ensure your module does not block checkout entirely. Set up an automated email notification to review the VAT number manually once the service comes back online.

How VAT Validation Connects to Other EU Rules

Ensuring compliance with VAT rules is only one piece of the puzzle. If you sell to EU merchants, you must also align your site with these updates:

Conclusion

Validating VAT numbers using VIES is an essential task for any B2B e-commerce merchant. By automating this process using native tools or premium PrestaShop modules, you protect your business from costly VAT liabilities and provide a seamless, professional experience for your business customers.

Configure your verification log records today, and make sure your customer data fields are set up to capture and archive valid Consultation Numbers for future audits.


Related articles you might find helpful:

Rédigé par

L'équipe PrestaInsights

Chez PrestaInsights, nous sommes spécialisés dans tout ce qui concerne PrestaShop, de l'hébergement et l'optimisation des performances au développement de modules et aux tutoriels approfondis. Notre objectif est d'aider les commerçants, les développeurs et les agences à réussir grâce à des guides à jour, des aperçus pratiques et des meilleures pratiques éprouvées. Que vous débutiez ou que vous développiez une boutique à fort trafic, nous sommes là pour vous guider.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont marqués d'une *