Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vateu

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vateu

EU VAT Number validation via European Union VIES API including company information

  • 1.2.5
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

VATEU - European VAT Number Validation

What is VATEU ?

VATEU is a lightweight quick and easy to use tiny NPM package written in node.js A simple request for country code & VAT number ( timeout optional ) will allow you to verify the validity of a VAT number issued by any European Union Member State via the VIES API. The returned response will show whether the VAT number is valid or not and any extra company information if available.

What is VIES (VAT Information Exchange System) on-the-web?

It is an electronic means of validating VAT-identification ( VATIN ) numbers of economic operators registered in the European Union for cross border transactions on goods or service.

Get started

npm install vateu --save
Callback example
var vateu = require('vateu');

var vateuOptions = {
    "countryCode": "xx", // ie FR
    "vatNumber": 'xxxxxx', // vat Number without country code
    "timeout": 10000 // optional - default 30000 ( 30 seconds )
}

vateu(vateuOptions, function (error, vateuInfo) {
    if (error) console.log('vateu callback test - error ', res.error)
    
    console.log('callback test ', vateuInfo)
});

async/await example
var vateu = require('vateu');

awaitTest()
async function awaitTest() {
    var vateuOptions = {
        "countryCode": "xx", // ie FR
        "vatNumber": 'xxxxxx', // vat Number without country code
        "timeout": 10000 // optional - default 30000 ( 30 seconds )
    }

    var res = await vateu(vateuOptions)
    if (res.error) console.log('vateu sync test - error ', res.error)

    console.log('vateu sync test Result ', res.vateuInfo)
}
Valid countryCodes
'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'EL', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'XI'
Valid Response
{
  valid: true,
  countryCode: 'xx',
  vatNumber: 'xxxxxxx',
  requestDate: '2021-12-08+01:00',
  name: 'Company Name', // if available
  address: 'Company Address' // if available
}
Invalid Response
{
  valid: false,
  countryCode: 'xx',
  vatNumber: 'xxxxxxxxxx',
  requestDate: '2021-12-08+01:00',
  name: false,
  address: false,
  error : 'Error message'
}
Error Messages
  'vateu Badly formed request - Check vatNumber & countryCode'
  'vateu Badly formed request - vatNumber is empty'
  'vateu Badly formed request - countryCode is empty'
  'vateu Badly formed request - Not EU Country'
  'vateu vies call error' // check you can ping 'ec.europa.eu' from the host server
  'vateu Unknown error'

Change Log

1.2.5

Make for public use on GITHUB

License

The MIT License (MIT)

Copyright (c) 2021 bitinix@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Package last updated on 08 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc