Caching
Avatcado caches validation results so repeat lookups return faster and your integration stays resilient even when upstream services (VIES, HMRC, BFS, Bronnysund, or ABR) are down.How it works
- TTL: Validation results are cached for 25 days
- Cache key: The combination of the VAT number and the requester VAT number (if provided)
- Storage: Cached in the database alongside fresh results
Detecting cached responses
When a result comes from cache, two fields appear in themeta object:
Usage counting
Cached responses still count toward your monthly quota. This is because caching is a performance optimization, not a billing bypass. Check your remaining quota via theX-RateLimit-Remaining header on each response.
Stale cache fallback
When an upstream service (VIES, HMRC, BFS, Bronnysund, or ABR) is down and no fresh cache exists (within the 25-day TTL), Avatcado falls back to the most recent cached result for that VAT number, regardless of age. The response includesmeta.stale: true so you know the data may be outdated:
Stale results still count toward your monthly quota because you received data. If no cached result exists at all for the requested VAT number, the API returns a
503 error and that request is automatically refunded. See Non-billable failures for details.
Source status
When Avatcado fetches from an upstream service, the response includesmeta.source_status to communicate the reliability of the result:
When
source_status is "unavailable" or "degraded", the response also includes meta.stale: true and meta.cached: true.
source_status. The field only appears when an upstream call was attempted. If no stale cache exists when a member state is unavailable, the API returns a 503 error with code upstream_member_state_unavailable.
Non-EU validations
CH, LI, NO, and AU validations follow the same 25-day cache policy as EU and UK validations. Caching is especially important for Swiss and Liechtenstein validations because the BFS UID Register enforces a strict 20 requests per minute rate limit. Cached results help you avoid hitting this upstream limit.Force refresh
Passcache=false to bypass the cache and fetch a fresh result from the upstream service:
cache=false) will use it for the next 25 days. Force-refresh requests count toward your monthly quota like any other request.
If the upstream service is unavailable during a force-refresh, the API falls back to the most recent cached result (with meta.stale: true), the same as a normal request.
Batch caching
In batch responses, cache information appears per-item in each result’smeta object. Each item in a batch may have a different cache state. One may be a fresh lookup while another is served from cache.
cache parameter in the request body applies to all items in the batch. Setting cache: false forces fresh lookups for every VAT number.