# EU VAT ID Validator API
> EU VAT identification number format validation as an API, computed locally and deterministically. The validate endpoint takes a VAT number, strips spaces, dots and hyphens, reads the two-letter country prefix and checks the remaining body against that member state’s official structure — Germany’s nine digits, Austria’s U-plus-eight, the Netherlands’ nine-digits-B-two, France’s two-character prefix plus nine digits, Italy’s eleven digits, and so on for all 27 EU countries plus Northern Ireland (XI), correctly using EL for Greece rather than GR. It returns whether the format is valid, the country, and the expected pattern, so DE123456789 and ATU12345678 pass while a German number with only eight digits or a US prefix is rejected. The format endpoint looks up the expected VAT pattern for any country code, or lists all supported ones. This is an offline structure check — a valid format does not prove the number is registered, for which a live VIES lookup is needed. Everything is computed locally and deterministically, so it is instant and private. Ideal for e-commerce, invoicing, accounting, B2B-checkout and tax-compliance app developers, VAT-field validation and onboarding tools, and finance software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 2 endpoints. This validates VAT-number format; for VAT tax rates use a VAT/tax API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/vatid-api/..."
```

## Pricing
- **Free** (Free) — 5,700 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 57,000 calls/Mo, 6 req/s
- **Pro** ($16/Mo) — 258,000 calls/Mo, 15 req/s
- **Mega** ($45/Mo) — 1,465,000 calls/Mo, 40 req/s

## Endpoints

### VATID

#### `GET /v1/format` — VAT format for a country

**Parameters:**
- `country` (query, optional, string) — EU 2-letter code (or omit to list all) Example: `IT`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/vatid-api/v1/format?country=IT"
```

**Response:**
```json
{
    "data": {
        "note": "The VAT number is the country prefix followed by this body format.",
        "inputs": {
            "country": "IT"
        },
        "prefix": "IT",
        "country": "Italy",
        "body_format": "11 digits"
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:12.911Z",
        "request_id": "bb0b09f2-6e14-4411-8481-eddb5ca35668"
    },
    "status": "ok",
    "message": "VAT format lookup",
    "success": true
}
```

#### `GET /v1/validate` — Validate a VAT number format

**Parameters:**
- `vat` (query, required, string) — VAT number (with country prefix) Example: `DE123456789`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/vatid-api/v1/validate?vat=DE123456789"
```

**Response:**
```json
{
    "data": {
        "note": "Offline format/structure validation against the country's VAT pattern. A valid format does not guarantee the number is registered — use a VIES lookup for that. Example: DE123456789, ATU12345678.",
        "valid": true,
        "inputs": {
            "vat": "DE123456789"
        },
        "country": "Germany",
        "normalized": "DE123456789",
        "country_code": "DE",
        "expected_format": "9 digits"
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:13.007Z",
        "request_id": "034e9fb7-198e-4942-9d06-3f5d3fdaa361"
    },
    "status": "ok",
    "message": "Validate VAT number",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/vatid-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Spaces, dots and hyphens are ignored. Greece uses the EL prefix and Northern Ireland XI. This is format validation, not a live VIES registration check.",
        "service": "vatid-api",
        "countries": [
            "AT",
            "BE",
            "BG",
            "CY",
            "CZ",
            "DE",
            "DK",
            "EE",
            "EL",
            "ES",
            "FI",
            "FR",
            "HR",
            "HU",
            "IE",
            "IT",
            "LT",
            "LU",
            "LV",
            "MT",
            "NL",
            "PL",
            "PT",
            "RO",
            "SE",
            "SI",
            "SK",
            "XI"
        ],
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/format": "Look up a country's VAT number format (or list all).",
            "GET /v1/validate": "Validate a VAT number's country prefix and format."
        },
        "description": "EU VAT identification number format/structure validation (offline) for all member states."
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:13.118Z",
        "request_id": "5443201d-eb26-4025-95ab-fc606ab29a3d"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/vatid-api
OpenAPI spec: https://www.oanor.com/api/vatid-api/openapi.json
