Validate a VAT number asynchronously
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
}
'import requests
url = "https://api.avatcado.com/v1/validate/async"
payload = {
"vat_number": "DE123456789",
"requester_vat_number": "NL987654321B01",
"cache": 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})
};
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
]),
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}")
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}")
.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}"
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",
"cached": true,
"cached_at": "<string>",
"stale": true,
"source_status": "live",
"mode": "test",
"request_duration_ms": 120
}
}{
"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"
},
"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"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Async Validation
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.
POST
/
v1
/
validate
/
async
Validate a VAT number asynchronously
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
}
'import requests
url = "https://api.avatcado.com/v1/validate/async"
payload = {
"vat_number": "DE123456789",
"requester_vat_number": "NL987654321B01",
"cache": 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})
};
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
]),
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}")
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}")
.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}"
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",
"cached": true,
"cached_at": "<string>",
"stale": true,
"source_status": "live",
"mode": "test",
"request_duration_ms": 120
}
}{
"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"
},
"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"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Body
application/json
⌘I