MichelMichels.ViesSharp
1.0.0
dotnet add package MichelMichels.ViesSharp --version 1.0.0
NuGet\Install-Package MichelMichels.ViesSharp -Version 1.0.0
<PackageReference Include="MichelMichels.ViesSharp" Version="1.0.0" />
paket add MichelMichels.ViesSharp --version 1.0.0
#r "nuget: MichelMichels.ViesSharp, 1.0.0"
// Install MichelMichels.ViesSharp as a Cake Addin #addin nuget:?package=MichelMichels.ViesSharp&version=1.0.0 // Install MichelMichels.ViesSharp as a Cake Tool #tool nuget:?package=MichelMichels.ViesSharp&version=1.0.0
<h1 align="center"> 🛂 ViesSharp </h1> <p align="center"> <a href="https://www.nuget.org/packages/MichelMichels.ViesSharp"><img src="https://img.shields.io/nuget/v/MichelMichels.ViesSharp"/></a> </p>
<br />
<div align="center"> This projects is a C# wrapper library to <a href="https://ec.europa.eu/taxation_customs/vies/#/vat-validation">validate VAT numbers with VIES</a>. </div>
<br /> <br />
<details> <summary>Table of Contents</summary>
</details>
Prerequisites
Building
Use Visual Studio 2022 to build the project.
Installation
Get the NuGet packages from nuget.org or search for MichelMichels.ViesSharp
in the GUI package manager in Visual Studio.
You can also use the cli of the package manager with following command:
Install-Package MichelMichels.ViesSharp
<br /> <hr>
Getting started
This repository contains 2 projects:
MichelMichels.ViesSharp
- Core libraryMichelMichels.ViesSharpTests
- Testing library
Usage
There are only 3 REST calls on this API. You can find for each call example code below.
Check VAT number
This code below checks the VAT number for the Belgian national broadcasting company (VRT):
IViesSharpClient client = new ViesSharpClient();
VatNumberRequest request = new()
{
CountryCode = "BE",
VatNumber = "0244142664"
};
VatNumberResponse response = await client.CheckVatNumber(request);
Response:
{
"countryCode": "BE",
"vatNumber": "0244142664",
"requestDate": "2024-04-23T08:04:10.919Z",
"valid": true,
"requestIdentifier": "",
"name": "NV OR De Vlaamse Radio- en Televisieomroeporganisatie",
"address": "Auguste Reyerslaan 52\n1030 Schaarbeek",
"traderName": "---",
"traderStreet": "---",
"traderPostalCode": "---",
"traderCity": "---",
"traderCompanyType": "---",
"traderNameMatch": "NOT_PROCESSED",
"traderStreetMatch": "NOT_PROCESSED",
"traderPostalCodeMatch": "NOT_PROCESSED",
"traderCityMatch": "NOT_PROCESSED",
"traderCompanyTypeMatch": "NOT_PROCESSED"
}
Check VAT test service
This call can be used to test the VAT service with example VatNumbers 100
and 200
.
See the ViesSharpClientTests.CheckVatTestService()
method in the test library for more information.
Check status
This call can be used to verify if the service is active and which countries are supported.
IViesSharpClient client = new ViesSharpClient();
StatusResponse response = await client.CheckStatus();
Exceptions
This library throws ViesSharpException
s if the HTTP status code is not 200. This ViesSharpException
has a property ErrorResponse
with a deserialized error response of the VIES service to indicate what is wrong with the call.
Credits
Written by Michel Michels.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 540 | 4/23/2024 |
- Release 1.0.0