Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
/ siren2tva Public archive
forked from startxfr/siren2tva

Node module to convert siren /siret code into French VAT Number

License

Notifications You must be signed in to change notification settings

wavyapp/siren2tva

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

siren2tva siren2tva last commit licence

NodeJS module to manipulate French SIREN / SIRET or VAT Number in either way. This module will also retrieve legals informations such as legal form, company name, capital and adress from valid SIRET, SIREN or VAT numbers.

Features included :

  • Convert SIRET to VAT number
  • Convert SIREN to VAT number
  • Convert VAT number to SIREN
  • Clean SIRET / Siret or VAT number form space between numbers
  • Check if a number is a valid SIRET
  • Check if a number is a valid SIREN
  • Check if a number is a valid VAT number
  • Return legals informations about the company coresponding to a given SIREN / SIRET or VAT number
  • Return the name of the company coresponding to a given SIREN / SIRET or VAT number
  • Return the adress of the company coresponding to a given SIREN / SIRET or VAT number
  • Return the capital amount of the company coresponding to a given SIREN / SIRET or VAT number
  • Return the legal form of the company coresponding to a given SIREN / SIRET or VAT number
  • Return the last update recorded for the company coresponding to a given SIREN / SIRET or VAT number

Installation

npm install siren2tva --save

Usage

Load module

var siren2tva = require('siren2tva');

Configure module

siren2tva({ longCode: true });

Convert SIRET into VAT code

console.log(siren2tva.siret2tva('44997052400038'));
// Return FR26449970524

Convert SIREN into VAT code

console.log(siren2tva.siren2tva('449970524'));
// Return FR26449970524

Convert VAT code into SIREN

console.log(siren2tva.tva2siren('FR26449970524'));
// Return 449970524

Check if SIRET is valid

console.log(siren2tva.check.isSIRET('44997052400038'));
// Return true
console.log(siren2tva.check.isSIRET('01234567890123'));
// Return false

Check if SIREN is valid

console.log(siren2tva.check.isSIREN('449970524'));
// Return true
console.log(siren2tva.check.isSIREN('012345678'));
// Return false

Check if VAT code is valid

console.log(siren2tva.check.isTVA('FR26449970524'));
// Return true
console.log(siren2tva.check.isTVA('FR00012345678'));
// Return false

Get name of the company coresponding to a SIREN

siren2tva.getInfoNom('449970524', function (err, name) {
  console.log(name);
});
// Return STARTX

Get the adress of the company coresponding to a SIREN

siren2tva.getInfoAdress('449970524', function (err, adress) {
  console.info(adress);
});
// Return { add: '171 Avenue Georges Clémenceau', cp: '92000', ville: 'Nanterre' }

Get capital amount of the company coresponding to a SIREN

siren2tva.getInfoCapital('449970524', function (err, capital) {
  console.log(capital);
});
// Return 50005

Get legal form of the company coresponding to a SIREN

siren2tva.getInfoLegal('449970524', function (err, legal) {
  console.log(legal);
});
// Return SARL

Get last official public registry update of the company coresponding to a SIREN

siren2tva.getInfoLastUpdate('449970524', function (err, date) {
  console.log(date);
});
// Return 2013-11-03

Get all legals informations about the company coresponding to a SIREN

siren2tva.getInfo('449970524', function (err, company) {
  return (err) ? console.error(err) : console.log(company);
});
// Return {company}

Troubleshooting

If you run into difficulties installing or running siren2tva, you can create an issue.

Built With

Contributing

Read the contributing guide for details on our code of conduct, and the process for submitting pull requests to us.

Authors

This project is mainly developped by the startx dev team. You can see the complete list of contributors who participated in this project by reading CONTRIBUTORS.md.

License

This project is licensed under the Apache License Version 2.0 - see the LICENSE file for details

About

Node module to convert siren /siret code into French VAT Number

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.3%
  • Shell 0.7%