Demos & Use Cases

Automated VAT Number validation via VIES API

A ready-made bot from the Lexemo bot library checks VAT numbers directly against VIES, shows the result and creates a PDF record for your files.

Automated VAT Number validation via VIES API See it live

Law firms, in-house legal teams, tax advisors and accounting teams all need to check the VAT numbers of their EU business partners and be able to prove they did. This bot queries the number directly in VIES, the European Commission’s VAT Information Exchange System. The result is a PDF record of what VIES returned at the time of the check. The bot is a ready-made template in the Lexemo bot library and can be used right away, with no build required. See it live

Country and number as separate fields

The bot asks for country and number in two required fields. The Drop-Down holds the country codes of the EU member states as a fixed list. The Text field below takes only the number itself, without country code, spaces or separators. Description and placeholder show the expected format right at the field, and Required makes sure no check starts with an empty field.

Drop-Down configuration dd_land with the EU member state country codes, set to required

Text field in_vat for the VAT number with description, placeholder and Required enabled

Optional requester details

Two further fields are optional: the country code and VAT number of the user’s own company. Entering both lets VIES return a consultation number that can later serve as proof of the check. An Annotation explains this right in the form, shown on hover:

Optional: Enter both your own country code and your own VAT number to request a consultation number. The number entered above is the one being checked. This bot is not configured to match entered company names and addresses.

Annotation text explaining the optional requester details and the consultation number

The request to VIES

A Boilerplate combines all inputs into one JSON request. The variables in curly brackets point straight to the input fields, so nothing is entered twice:

{ "countryCode": "{dd_land}", "vatNumber": "{in_vat}", "requesterMemberStateCode": "{in_req_land}", "requesterNumber": "{in_req_vat}" }

The API Connector sends this request via POST to the VIES VAT Check (EU) connector. Its trigger is set to “When loading this node”: the check starts on its own as soon as the bot reaches this step.

Boilerplate bp_payload with the JSON request and the variables for country, number and requester

API Connector api_vies with the VIES VAT Check connector, POST method and trigger on node load

Reading the response

The Variable Mapper assigns the fields of the VIES response to named variables: validity (valid), name, address, date of check (requestDate) and, if returned, the consultation number. A Text Field places these variables in a result table. A note below makes clear that an empty name or address field alone does not mean the VAT number is invalid. Some member states simply do not return these details.

Variable Mapper assigning valid, name, address and requestDate from the VIES response

Result Text Field with a table of VAT number checked, validity, name, address, date of check and consultation number

Creating the PDF record

Finally, the bot creates the PDF VAT_Number_Validation_Record from the e! Template. Download is enabled, and generation again starts on its own when the bot reaches this step. The template “VAT number validation” uses the same variables as the result view. A source note at the bottom names VIES and states that the record reflects the response received at the time of the check.

Create PDF configuration pdf_nachweis with file name, e! Template, download enabled and trigger on node load

PDF template "VAT number validation" with result table and VIES source note

User view

The user view walks through the check in four steps. The start screen explains what happens: enter country and number separately, select Next to run the check, and the result and PDF record appear once a usable response is in.

Start screen "Validate a VAT number and save a record of the check" with a short explanation of the process

Entering the number

Input comes down to two required fields: the country from the list and the number without its country code. The fields for the user’s own company stay empty unless a consultation number is needed. Two info badges explain country codes and requester details right in the form.

Input form with country code, VAT number and optional requester details

Automatic VIES check

The check runs without another click. The status note makes clear that a technical error does not mean the VAT number is invalid. Once Next appears, the result is ready.

Status screen of the automatic VIES check with a note on technical errors

Validation result

The result table shows the number checked, the result and the date of check. In this example VIES reports the number as valid and returns no name or address. That is common for some member states and is no sign of an invalid number.

Validation result showing a valid VAT number and the date of check

Downloading the PDF record

One click on Download delivers the record as a PDF. It documents the check outside the form and can be filed with the records of the transaction.

Check completed screen with VAT_Number_Validation_Record.pdf ready to download

Part of the bot library

VAT number validation is one of the ready-made templates in the Lexemo bot library. Use it as it is or adapt it to your own processes, for example with your own PDF layout or extra fields.

Explore the bot library

Bot card "Validate a VAT Number and Document the Check" in the e! dashboard

More in this category