2 min read
What it means
The service is temporarily unavailable.
Common causes
A brief maintenance window or an overloaded dependency.
Example response
{
"error": {
"type": "api_error",
"code": "api",
"message": "The service is temporarily unavailable."
}
}
How to handle
Retry with backoff; the service returns shortly.
Honour the Retry-After header and see Retrying failed requests.
Where it sits in the error model
A 503 is one of the api_error class of responses. On the Credicorp API the HTTP status is only the broad classification; the exact reason travels in error.code, and — for field-level problems — the offending input is named in error.param. Build your handling around the code, not the wording of error.message, which may be refined over time.
Because this class is transient, a well-behaved client retries it automatically with exponential backoff and jitter, so an occasional blip never surfaces to the user. Distinguish it clearly from the fix-the-request classes (400, 422) which must never be retried blindly.
Frequently asked questions
Should I retry a 503?
Yes — with exponential backoff. This class is transient.
Where is the specific reason?
In error.code and, for field errors, error.param. The HTTP status is the class; the code is the specifics.
Is the response body always JSON?
Yes — API errors are always the JSON error envelope. HTML back means you hit an edge/proxy layer, not the API.
Funding for UK limited companies
Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.