sgf-gstin-validator
Version:
Module to validate GSTIN and verify Signed QR of GST eInvoice
33 lines (26 loc) • 1.46 kB
Markdown
# GSTIN Validator
* Validates GSTIN number for length (15 digits), format (State code, PAN, Entity Number, Z, Checksum) and checksum as per the algorithm published at [GSTN portal](http://developer.gstsystem.co.in/pages/apiportal/data/gsp/download/GSTIN_Validation_SampleCode.zip)
* Verifies [Signed QR of eInvoices](https://einvoice1.gst.gov.in/Documents/Qrcode_procedure.pdf) and returns invoice data of both signed QR of e-invoice as well as signed e-invoice data.



[](https://www.codacy.com/manual/srikanthlogic/gstin-validator)
[](https://gitpod.io/#https://gitlab.com/srikanthlogic/gstin-validator)
## Installation
```sh
npm install gstin-validator
```
## Use
```node
var validator = require('gstin-validator');
validator.isValidGSTNumber('12AAACI1681G1Z0');
validator.ValidateGSTIN('47AAACI1681G1Z0');
validator.getGSTINInfo('12AAACI1681G1Z0');
validator.validateSignedInvoice('SignedInvoiceString');
validator.validateEInvoiceSignedQR('SignedQROfEInvoice');
```
## Test
```sh
npm test
npm run test-coverage
```