upstream_error
HTTP Status: 503 Service Unavailable
Example response
What happened?
The upstream VAT validation service (HMRC) returned an unexpected error status code. This happens when:- HMRC’s API is experiencing internal errors
- HMRC returned a non-success, non-404 HTTP status
- There’s a temporary issue with HMRC’s infrastructure
upstream_unavailable.
How to fix
- Retry after the
Retry-Afterheader — The response includesRetry-After: 10, telling you to wait 10 seconds before retrying - Check the
messagefield — It includes the specific HTTP status HMRC returned, which can help diagnose the issue - Use the
X-Request-Id— Include it in any support requests for faster debugging
Common mistakes
- Retrying immediately in a tight loop — Add exponential backoff between retries
- Treating this as a permanent failure — Upstream errors are almost always temporary
- Confusing with
upstream_unavailable—upstream_errormeans the service responded with an error;upstream_unavailablemeans it couldn’t be reached at all
Stale cache fallback
If Vatly has a previous cached result for the same VAT number, it will serve that result withmeta.stale: true instead of returning a 503 error. See Caching for details.
Related errors
upstream_unavailable— Upstream service is completely unreachable