NodeJS API handler for ARES requests (Czech registry of economic subjects). Please read carefully security limits and other operations instruction. All the documents are in czech language.
It's really simple:
npm install czares --save
Let's start with initiation of the class and the object.
const CZAres = require('czares');
const ares = new CZAres();
For now, there are available only basic methods for accessing standard information like IČO, DIČ, etc. Before we go deeper into details, have a look at types definition, which gives you great overview.
When you need to get the basic information about company by its ID Number (in czech IČO), just use following code. When nothing is found '''undefined''' is returned:
const CZAres = require('czares');
const ares = new CZAres();
ares.getByIdentificationNumber('COMPANY_ID_NUMBER')
.then(data => console.log('Company details are:', JSON.stringify(data)))
.catch(err => console.error(err));
When you need to know whether a freelancer is registered to pay VAT, use this snippet of code:
const CZAres = require('czares');
const ares = new CZAres();
ares.isVATRegistered('71700650')
.then(isRegistered => console.log('Is Company registered?', isRegistered))
.catch(err => console.error(err));
When you need to know tax ID Number (in czech 'DIČ'), just use this:
const CZAres = require('czares');
const ares = new CZAres();
ares.getTaxIdNumber('COMPANY_ID_NUMBER')
.then(taxId => console.log('Company tax ID is:', taxId))
.catch(err => console.error(err));
To run the tests you'll need just:
$ npm install -g mocha
$ npm install
$ npm run test
Originally developed by Stepan Kouba.