1.0.5 • Published 2 years ago

@enova/eu-vat v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

eu-vat

Reference documentation for EU VAT rates retrieval: https://taxation-customs.ec.europa.eu/online-services/online-services-and-databases-taxation/tedb-taxes-europe-database_en Unfortunately, it is an old SOAP web service. This module simplifies the retrieval of the latest rates, in a simpler way.

Example of use of the module:

const getEuVat = require("@enova/eu-vat");

async function test() {
  const vat = await getEuVat(
    "./iva.xml"
  );
  console.log(vat);
}
test();

Example of .xml file:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ec.europa.eu:taxud:tedb:services:v1:IVatRetrievalService" xmlns:urn1="urn:ec.europa.eu:taxud:tedb:services:v1:IVatRetrievalService:types">
   <soapenv:Header />
   <soapenv:Body>
      <urn:retrieveVatRatesReqMsg>
         <urn1:memberStates>
            <urn1:isoCode>AT</urn1:isoCode>
            <urn1:isoCode>BE</urn1:isoCode>
            <urn1:isoCode>BG</urn1:isoCode>
            <urn1:isoCode>CY</urn1:isoCode>
            <urn1:isoCode>CZ</urn1:isoCode>
            <urn1:isoCode>DE</urn1:isoCode>
            <urn1:isoCode>DK</urn1:isoCode>
            <urn1:isoCode>EE</urn1:isoCode>
            <urn1:isoCode>EL</urn1:isoCode>
            <urn1:isoCode>ES</urn1:isoCode>
            <urn1:isoCode>FI</urn1:isoCode>
            <urn1:isoCode>FR</urn1:isoCode>
            <urn1:isoCode>HR</urn1:isoCode>
            <urn1:isoCode>HU</urn1:isoCode>
            <urn1:isoCode>IE</urn1:isoCode>
            <urn1:isoCode>IT</urn1:isoCode>
            <urn1:isoCode>LT</urn1:isoCode>
            <urn1:isoCode>LU</urn1:isoCode>
            <urn1:isoCode>LV</urn1:isoCode>
            <urn1:isoCode>MT</urn1:isoCode>
            <urn1:isoCode>NL</urn1:isoCode>
            <urn1:isoCode>PL</urn1:isoCode>
            <urn1:isoCode>PT</urn1:isoCode>
            <urn1:isoCode>RO</urn1:isoCode>
            <urn1:isoCode>SE</urn1:isoCode>
            <urn1:isoCode>SI</urn1:isoCode>
            <urn1:isoCode>SK</urn1:isoCode>
            <urn1:isoCode>XI</urn1:isoCode>
         </urn1:memberStates>
         <urn1:situationOn>${DATE}</urn1:situationOn>
      </urn:retrieveVatRatesReqMsg>
   </soapenv:Body>
</soapenv:Envelope>

NOTE: replace ${DATE} with current (or older) date.

Example of output

[
  {
    memberState: 'AT',
    rate: '20.0',
    type: 'DEFAULT',
    situationOn: '2022-07-01+02:00',
    comment: ''
  },
  {
    memberState: 'BE',
    rate: '21.0',
    type: 'DEFAULT',
    situationOn: '2022-07-01+02:00',
    comment: '<p>Article 1, paragraph 1, of the Royal Decree n° 20 of 20 July 1970</p>'
  },
  {
    memberState: 'BE',
    rate: '21.0',
    type: 'DEFAULT',
    situationOn: '2022-07-01+02:00',
    comment: '<p>Article 1, paragraph 1, of the Royal Decree n° 20 of 20 July 1970</p>'
  },
  {
    memberState: 'BG',
    rate: '20.0',
    type: 'DEFAULT',
    situationOn: '2022-07-01+02:00',
    comment: ''
  },
    .
    .
    .
]
1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago