Validate EU VAT Numbers via API (VIES) – cURL Guide
This guide shows how to check an EU VAT number programmatically using the /v1/validate-vat
endpoint. You’ll get a copy‑paste cURL request, a typical JSON response, and best‑practice tips for reliability and compliance.
Endpoint
POST https://api.vatifytax.app/v1/validate-vat
Request (cURL)
Send your API key via the Authorization: Bearer <API_KEY>
header and include the VAT number as JSON:
cURL
curl -s https://api.vatifytax.app/v1/validate-vat \ -H "Authorization: Bearer" \ -H "Content-Type": "application/json" \ -d '{"vat_number":"DE811907980"}'
Typical Response
{ "valid": true, "country_code": "DE", "vat_number": "811907980", "checked_at": "2025-09-12T10:21:00Z", "source": "VIES" }
Best Practices for EU VAT Validation
- Server‑side only: Keep API keys off the client. Call the API from your backend.
- Retry/backoff: Official sources (e.g., VIES) can be temporarily unavailable. Implement exponential backoff.
- Cache results: Cache positive validations for a short period to reduce latency and external calls.
- Log
checked_at
: Store the timestamp for audits and reconciliation. - Handle edge cases: Whitespace, country prefix normalization, and temporary service errors.
- Respect rate limits: Queue bursts and monitor HTTP status codes for graceful degradation.
Next steps
Ready to integrate? Start with the Free tier and read more about the features. If you need EU VAT rates or tax calculation, see the API examples on the landing page.
Written by Vatify • ©