@opuscapita/electronic-address

0.6.0 • Public • Published

electronic-address

Library to decode and encode electronic addresses for routing

Encoding is based on ISO6523. Details can be found at https://www.galaxygw.com/iso6523/


Setup

Install library by running:

npm install @opuscapita/electronic-address

Examples to decode and encode electronic addresses:

const electronicAddress = require('@opuscapita/electronic-address');

// decode an electronic invoice
electronicAddress.decode('9930:DE12345678542');
// returns object { type: 'vat', value: 'DE123456785', ext: '42' }

// encode an electronic invoice
electronicAddress.encode({ type: 'gln', value: '4324565678967' });
// returns '0088:4324565678967'

// For type `orgnr`, the country must be specified. E.g.
electronicAddress.encode({ type: 'orgnr', value: '54323456', country: 'DK' });
// returns '9902:54323456'

type can be one of the following:

  • vat
  • gln
  • ovt
  • duns
  • orgnr

Readme

Keywords

Package Sidebar

Install

npm i @opuscapita/electronic-address

Weekly Downloads

23

Version

0.6.0

License

Apache-2.0

Unpacked Size

13.5 kB

Total Files

3

Last publish

Collaborators

  • ariusz
  • ilhamkadduri
  • smachnow
  • piotr.krzysztof.murdzia
  • kuos
  • elaczapiewska
  • janek.bug
  • ocmachineuser
  • ocautomation
  • maciej-wakula-opuscapita