Skip to main content

Response Format

Every Avatcado response follows the same envelope pattern: either data 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 }. The data object is the exact same shape as the single validate endpoint
  • Error: { error, meta }. The meta contains the vat_number that failed
Per-item 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 an X-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.