curl --request POST \
--url https://api.avatcado.com/v1/validate/async \
--header 'Content-Type: application/json' \
--data '
{
"vat_number": "DE123456789",
"requester_vat_number": "NL987654321B01",
"cache": true,
"fallback": true
}
'import requests
url = "https://api.avatcado.com/v1/validate/async"
payload = {
"vat_number": "DE123456789",
"requester_vat_number": "NL987654321B01",
"cache": True,
"fallback": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
vat_number: 'DE123456789',
requester_vat_number: 'NL987654321B01',
cache: true,
fallback: true
})
};
fetch('https://api.avatcado.com/v1/validate/async', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.avatcado.com/v1/validate/async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'vat_number' => 'DE123456789',
'requester_vat_number' => 'NL987654321B01',
'cache' => true,
'fallback' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.avatcado.com/v1/validate/async"
payload := strings.NewReader("{\n \"vat_number\": \"DE123456789\",\n \"requester_vat_number\": \"NL987654321B01\",\n \"cache\": true,\n \"fallback\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.avatcado.com/v1/validate/async")
.header("Content-Type", "application/json")
.body("{\n \"vat_number\": \"DE123456789\",\n \"requester_vat_number\": \"NL987654321B01\",\n \"cache\": true,\n \"fallback\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avatcado.com/v1/validate/async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"vat_number\": \"DE123456789\",\n \"requester_vat_number\": \"NL987654321B01\",\n \"cache\": true,\n \"fallback\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending",
"vat_number": "DE123456789"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"request_duration_ms": 120,
"mode": "test",
"source": "vies",
"source_status": "live",
"cached": true,
"stale": true,
"cached_at": "<string>"
}
}{
"error": {
"code": "webhook_not_configured",
"message": "Configure a webhook URL before using async validation. See https://docs.avatcado.com/webhooks",
"docs_url": "https://docs.avatcado.com/errors/webhook_not_configured"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key",
"docs_url": "https://docs.avatcado.com/errors/unauthorized"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "tier_insufficient",
"message": "Async validation requires a Pro or Business plan",
"docs_url": "https://docs.avatcado.com/errors/tier_insufficient"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "invalid_vat_format",
"message": "The VAT number format is invalid. Expected format: CC123456789",
"docs_url": "https://docs.avatcado.com/errors/invalid_vat_format",
"vat_number": "DE123"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Monthly validation limit exceeded",
"docs_url": "https://docs.avatcado.com/errors/rate_limit_exceeded",
"vat_number": "DE123456789"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Validate a VAT number asynchronously
Submit a VAT number for asynchronous validation. Returns 202 immediately. The result is delivered to your configured webhook URL when processing is complete. Invalid VAT formats are rejected immediately (422), never queued.
Pro and Business tiers only. Requires a configured webhook URL. Test keys are rejected.
curl --request POST \
--url https://api.avatcado.com/v1/validate/async \
--header 'Content-Type: application/json' \
--data '
{
"vat_number": "DE123456789",
"requester_vat_number": "NL987654321B01",
"cache": true,
"fallback": true
}
'import requests
url = "https://api.avatcado.com/v1/validate/async"
payload = {
"vat_number": "DE123456789",
"requester_vat_number": "NL987654321B01",
"cache": True,
"fallback": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
vat_number: 'DE123456789',
requester_vat_number: 'NL987654321B01',
cache: true,
fallback: true
})
};
fetch('https://api.avatcado.com/v1/validate/async', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.avatcado.com/v1/validate/async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'vat_number' => 'DE123456789',
'requester_vat_number' => 'NL987654321B01',
'cache' => true,
'fallback' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.avatcado.com/v1/validate/async"
payload := strings.NewReader("{\n \"vat_number\": \"DE123456789\",\n \"requester_vat_number\": \"NL987654321B01\",\n \"cache\": true,\n \"fallback\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.avatcado.com/v1/validate/async")
.header("Content-Type", "application/json")
.body("{\n \"vat_number\": \"DE123456789\",\n \"requester_vat_number\": \"NL987654321B01\",\n \"cache\": true,\n \"fallback\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avatcado.com/v1/validate/async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"vat_number\": \"DE123456789\",\n \"requester_vat_number\": \"NL987654321B01\",\n \"cache\": true,\n \"fallback\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending",
"vat_number": "DE123456789"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"request_duration_ms": 120,
"mode": "test",
"source": "vies",
"source_status": "live",
"cached": true,
"stale": true,
"cached_at": "<string>"
}
}{
"error": {
"code": "webhook_not_configured",
"message": "Configure a webhook URL before using async validation. See https://docs.avatcado.com/webhooks",
"docs_url": "https://docs.avatcado.com/errors/webhook_not_configured"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key",
"docs_url": "https://docs.avatcado.com/errors/unauthorized"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "tier_insufficient",
"message": "Async validation requires a Pro or Business plan",
"docs_url": "https://docs.avatcado.com/errors/tier_insufficient"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "invalid_vat_format",
"message": "The VAT number format is invalid. Expected format: CC123456789",
"docs_url": "https://docs.avatcado.com/errors/invalid_vat_format",
"vat_number": "DE123"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Monthly validation limit exceeded",
"docs_url": "https://docs.avatcado.com/errors/rate_limit_exceeded",
"vat_number": "DE123456789"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Body
The VAT number to validate asynchronously
1"DE123456789"
Your own VAT number (for consultation numbers)
"NL987654321B01"
Whether to use cached results. Defaults to true, or to false when requester_vat_number is supplied (no stored result is served then, not even during an outage). Pass true explicitly to opt back in.
true
Whether a VIES outage may be answered from the national register (Pro and Business). Defaults to true, or to false when requester_vat_number is supplied, because register answers never carry a consultation number. Pass true explicitly to opt back in.
true