Verify the validity of a VAT number issued by any Member State of the European Union.
More info about this subject is found here.
- Java 1.7+
Add the linkID repositories to your pom file:
<!-- REMOTE ARTIFACT REPOSITORIES -->
<repositories>
<repository>
<id>repo.linkid.be.release</id>
<name>LinkID Public Repository</name>
<url>http://repo.linkid.be/releases</url>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
</repository>
<repository>
<id>repo.linkid.be.snapshot</id>
<name>LinkID Public Repository</name>
<url>http://repo.linkid.be/snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</releases>
</repository>
</repositories>
Add the eu-vat-check-client dependency to your pom file:
<dependency>
<groupId>net.lin-k.eu.eu-vat-check</groupId>
<artifactId>eu-vat-check-client</artifactId>
<version>0.4</version>
</dependency>
Example code:
CountryCode countryCode = CountryCode.BE;
String vatNumber = "0446495156";
logger.inf( "VAT Number check for %s %s", countryCode, vatNumber );
VatCheckServiceClient vatCheckServiceClient = new VatCheckServiceClient( countryCode, vatNumber );
boolean valid = vatCheckServiceClient.isVatNumberValid();
//After isVatNumberValid() you can get the name and address of the enterprise
logger.inf( "Returned: valid=%s; name=%s; address=%s",
valid, vatCheckServiceClient.getName(), vatCheckServiceClient.getAddress() );
- Release for repo.linkid.be move
- Added some utility methods. (See VATUtil class)
- Updated the WSDL location.
- Implemented all country codes.
- Initial release.