Response Format
Every Avatcado response follows the same envelope pattern: eitherdata or error, always accompanied by meta. This means if (response.error) always works as a check.
Success response
data fields
Error response
error fields
meta fields
Present on every response, success or error.
Batch items
Each item in a batch validation response uses the same envelope:- Success:
{ data: VatValidationData, meta }. Thedataobject is the exact same shape as the single validate endpoint - Error:
{ error, meta }. Themetacontains thevat_numberthat failed
meta contains cache fields (cached, cached_at, stale) and source_status when applicable. Request-level fields like request_id and request_duration_ms live on the top-level meta.
Response headers
Request ID header
Every response includes anX-Request-Id header matching meta.request_id.
You can pass your own X-Request-Id header and it will be echoed back - useful for correlating requests in your own logging.