This module does a request to https://ec.europa.eu
to fetch trader information for a given VAT number and country code.
npm install eu-vat-info
// or
yarn add eu-vat-info
const EuVatInfo = require('eu-vat-info');
const response = await EuVatInfo({
countryCode: 'EL',
vatNumber: '123456789'
})
Option | Type | Required |
---|---|---|
countryCode |
string ex. DE, IT, SE |
true |
vatNumber |
string |
true |
Field | Type | Optional |
---|---|---|
status |
"success" or "error" |
false |
error |
{ name: EUVatError, message: string } |
true |
info |
EUVatInfo |
true |
{
status: 'success',
info: {
countryCode: 'EL',
vatNumber: '12345678',
requestDate: '2021-09-24+02:00',
valid: true,
traderName: 'TRADER NAME',
traderCompanyType: 'COMPANY TYPE',
traderAddress: 'ADDRESS, ZIP, ATHENS'
}
}
countryCode: string;
vatNumber: string;
requestDate: string;
valid: boolean;
traderName: string;
traderCompanyType: string;
traderAddress: string;
INVALID_EU_CODE
INVALID_VAT_NUMBER
SERVER_ERROR
PARSE_ERROR