Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

European VIES VAT number validator

License

NotificationsYou must be signed in to change notification settings

itaibo/vies-checker

Repository files navigation

EU API Works

European VIES VAT number validator (https://ec.europa.eu/taxation_customs/vies)

Installation

npm install vies-checker

Usage

Require/Import the module

const{ isValid}=require('vies-checker');import{isValid}from'vies-checker';

Use the isValid function

constCOUNTRY_CODE='IT';constVAT_NUMBER='B12345678';// isValid returns a boolean. If something is wrong, it will throw an errortry{constvalidVAT=awaitisValid(COUNTRY_CODE,VAT_NUMBER);console.log(`VAT number${(validVAT ?'is' :'is not')} in VIES`);}catch(e){console.error(e);}

Errors

These are the errors that might occur. Use a try/catch to handle them properly.

Error nameDescription
GLOBAL_MAX_CONCURRENT_REQYour Request for VAT validation has not been processed; the maximum number of concurrent requests has been reached
MS_MAX_CONCURRENT_REQYour Request for VAT validation has not been processed; the maximum number of concurrent requests for this Member State has been reached
SERVICE_UNAVAILABLEAn error was encountered either at the network level or the Web application level, try again later
MS_UNAVAILABLEThe application at the Member State is not replying or not available
TIMEOUTThe application did not receive a reply within the allocated time period, try again later

Thanks to@pano9000 forpointing out these errors


[8]ページ先頭

©2009-2025 Movatter.jp