Error response format
All errors follow this structure:Error code catalog
Example error responses
401 Unauthorized — missing or invalid API key
403 Forbidden — AHJ not in subscription
422 Unprocessable Entity — invalid parameter
There are two forms of 422 errors depending on the source. Business validation errors (raised by Fordje Connect when a parameter value is logically invalid) use a machine-readable error code:details array with per-field information:
When handling 422 responses programmatically, check for both
"INVALID_PARAMETER" and "Invalid request parameters" in the error field. If the details array is present, iterate over it for per-field error messages.429 Too Many Requests — rate limit exceeded
Error handling in practice
Here are code examples showing how to handle errors from Fordje Connect, including retry logic for transient failures.Basic error checking
Retry with exponential backoff
For transient errors (429 and 502), implement retry logic with exponential backoff:
Best practices
- Always check
response_typeto distinguish success from error responses - Use the
errorfield for programmatic error handling (not thedescription) - Check the
warningsarray on successful responses for partial access information - Implement retry logic with exponential backoff for
429and502errors - For
429responses, use theRetry-Afterheader (seconds) to determine when to retry - Log the full error response body for debugging — the
descriptionfield provides useful context