vies-validate
v1.0.5
Published
A Europe VAT Number Validator with VIES
Downloads
391
Maintainers
Readme
Getting started
Installation
npm install vies-validate
Usage
import { validate } from "vies-validate";
const { data, error } = await validate("NL", "853746333B01");
When valid:
data: {
countryCode: 'xx',
vatNumber: 'xxxxxxxxx',
requestDate: '2013-11-22+01:00',
valid: true,
name: 'company name',
address: 'company address'
}
error: null
When invalid:
data: {
countryCode: 'xx',
vatNumber: 'xxxxxxxxxx',
requestDate: '2013-11-22+01:00',
valid: false,
name: '---',
address: '---'
}
error: null
When error:
data: null;
error: "INVALID_INPUT";
License
The MIT License (MIT)