Docs / Checks
Validate a VAT number
Asks the European Commission VIES service whether an EU VAT number is listed as active. valid: false means VIES does not list it, not that the number never existed. A rejected format returns 400.
POST
/v1/vat/validateimport { Client } from "@liveapiio/liveapi";
const client = new Client({ token: process.env.LIVEAPI_TOKEN });
const vat = await client.validateVat("NL004495445B01", "NL");Request
Send Authorization: Bearer YOUR_TOKEN. The token stays on your server. Each library reads it from the environment and calls this endpoint for you.
| Field | Type | Description |
|---|---|---|
| vat_number | string | The VAT number. Required. |
| country | string | ISO country code. Optional when the number already includes the country prefix. |
Response
A 200 response uses one call, including when valid is false. name and address are null when the member state does not share them.
Errors
A failed request returns { "error": { "code", "message" } } and does not use a call.
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | VIES rejected the number format. |
| 503 | upstream_unavailable | VIES or the member state is unavailable. |
| 401 | unauthorized | The bearer token is missing or not recognized. |