/v3/risk endpoint has the same body: the HTTP status, a fixed message, a stable machine code, and retry_after_seconds.
- Branch on
code, never onmessage. Messages are for people and can change.messageis a list of strings when several query parameters failed validation. - Codes are an open list. Handle a code you do not know by its HTTP status.
retry_after_secondsis the number of seconds until a retry can succeed. When it is set, the response also carries aRetry-Afterheader with the same value. It isnullwhen retrying will not help or the wait is unknown.- Errors are free. A request that ends in an error is not charged. See Credits.
Error codes
A 401 rejected before the request reaches the endpoint, or a 500 from an unexpected failure, can arrive without a
code. Handle it by status.
Errors inside a successful screen
A screen can succeed while one of its providers failed. That failure is not an HTTP error: it is a result inresults[] with status: failed, an outcome, and a problem block.
outcome is an open list. problem.detail is always null: no text from a provider’s error is passed on. See Screen an Address for examples.
Retrying safely
- Fix 400, 401, 403, 404, 422 and 409
provider_connection_requirederrors before you send the request again. They fail the same way every time. 422network_not_coveredmeans this network cannot be screened for risk: do not retry it. - For 409
idempotency_in_progress, wait forRetry-Afterand send the same request with the same key. - For 429
rate_limited, 500 and 503provider_unavailable,range_unavailableorall_providers_failed, retry with exponential backoff and a retry cap. - For 429
network_monthly_limit, wait forRetry-After. For 503network_capacity_exhausted, do not retry in a loop. - Send an
Idempotency-Keyon every screen. A retry with the same key within 10 minutes returns the screen already answered, free. Without a key, a screen retried after a client timeout is a new screen: if the first request was answered, both are recorded and charged. See Safe retries.