Vatchecker
java library for calling the eu vat checker web service
Install / Use
/learn @digitalfondue/VatcheckerREADME
vatchecker: a java library for fetching information from the VIES and TIN webservice
A small java client with 0 dependencies for calling:
- the European "VAT Information Exchange System" (VIES) webservice for validating the VAT numbers. See http://ec.europa.eu/taxation_customs/vies/ .
- the European "TIN" webservice. See https://ec.europa.eu/taxation_customs/tin/ .
License
vatchecker is licensed under the Apache License Version 2.0.
Download
maven:
<dependency>
<groupId>ch.digitalfondue.vatchecker</groupId>
<artifactId>vatchecker</artifactId>
<version>1.6.0</version>
</dependency>
gradle:
compile 'ch.digitalfondue.vatchecker:vatchecker:1.6.0'
Use
If you use it as a module, remember to add requires ch.digitalfondue.vatchecker; in your module-info.
VIES
As a static method:
EUVatCheckResponse resp = EUVatChecker.doCheck("IT", "00950501007");
Assert.assertEquals(true, resp.isValid());
Assert.assertEquals("BANCA D'ITALIA", resp.getName());
Assert.assertEquals("VIA NAZIONALE 91 \n00184 ROMA RM\n", resp.getAddress());
You can create an instance if you prefer:
EUVatChecker euVatChecker = new EUVatChecker();
EUVatCheckResponse resp = euVatChecker.check("IT", "00950501007");
Assert.assertEquals(true, resp.isValid());
Assert.assertEquals("BANCA D'ITALIA", resp.getName());
Assert.assertEquals("VIA NAZIONALE 91 \n00184 ROMA RM\n", resp.getAddress());
For error handling, see the tests, you may distinguish "invalid" and "error" which can have a Fault object:
- https://github.com/digitalfondue/vatchecker/blob/master/src/test/java/ch/digitalfondue/vatchecker/EUVatCheckerTest.java
You can use your own data fetcher if customization is needed, see:
- https://github.com/digitalfondue/vatchecker/blob/master/src/main/java/ch/digitalfondue/vatchecker/EUVatChecker.java#L183
- https://github.com/digitalfondue/vatchecker/blob/master/src/main/java/ch/digitalfondue/vatchecker/EUVatChecker.java#L67
TIN
As a static method:
EUTinCheckResponse resp = EUTinChecker.doCheck("BE", "00012511119");
Assert.assertEquals(true, resp.isValidStructure());
Assert.assertEquals(true, resp.isValidSyntax());
Like the VIES counterpart, you can see the tests for all the possibile outputs:
- https://github.com/digitalfondue/vatchecker/blob/master/src/test/java/ch/digitalfondue/vatchecker/EUTinCheckerTest.java
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
