Nahrát soubory do „/“
This commit is contained in:
65
README.md
Normal file
65
README.md
Normal file
@ -0,0 +1,65 @@
|
||||
# VAT Number Validation API
|
||||
|
||||
This Node.js application provides an API interface to validate European VAT numbers using the official VIES SOAP service.
|
||||
|
||||
## Features
|
||||
|
||||
- Validate VAT numbers for any EU member state
|
||||
- GET and POST HTTP support
|
||||
- JSON responses with company name, address, and validity
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install express cors body-parser soap
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Start the server
|
||||
|
||||
```bash
|
||||
node server.js
|
||||
```
|
||||
|
||||
### Endpoints
|
||||
|
||||
#### GET `/api/validate-vat`
|
||||
|
||||
**Query parameters:**
|
||||
|
||||
- `countryCode`: ISO 2-letter country code (e.g., SK, DE, FR)
|
||||
- `vatNumber`: VAT number without country code
|
||||
|
||||
**Example:**
|
||||
|
||||
```
|
||||
http://localhost:3000/api/validate-vat?countryCode=SK&vatNumber=1234567890
|
||||
```
|
||||
|
||||
#### POST `/api/validate-vat`
|
||||
|
||||
**Request body (JSON):**
|
||||
|
||||
```json
|
||||
{
|
||||
"countryCode": "SK",
|
||||
"vatNumber": "1234567890"
|
||||
}
|
||||
```
|
||||
|
||||
**Response:**
|
||||
|
||||
```json
|
||||
{
|
||||
"country": "SK",
|
||||
"VAT": "1234567890",
|
||||
"name": "Example Company",
|
||||
"address": "Main Street 123, City, Country",
|
||||
"valid": true
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
Reference in New Issue
Block a user