Errors
Supplier API normalizes most service and HTTP exceptions into structured JSON responses.
Primary error shapes
Domain/HTTP normalized
{
"error": "not_found",
"message": "Order not found"
}
Middleware auth response
Some auth failures return:
{
"detail": "Not authenticated"
}
Clients should handle both shapes.
Common status codes
| Status | Typical meaning |
|---|---|
| 400 | Validation or business rule failure |
| 401 | Missing/invalid auth token |
| 403 | Forbidden (unverified supplier on exchange, MFA, disabled route, capability) |
| 404 | Resource not found in supplier scope |
| 409 | State conflict (invalid lifecycle transition) |
| 422 | Request schema validation error |
| 429 | Rate limited (edge/gateway or app policy) — back off and retry |
| 500 | Internal error |
| 503 | Dependency unavailable (auth backend, delegated connection service, etc.) |
Domain error codes
Examples include:
not_foundaccess_deniedvalidation_errorbusiness_rule_violationinvalid_stateexpiredinsufficient_balanceconflict
Integration recommendations
- Branch on machine-readable
erroror fallbackdetail. - Treat 409 as workflow conflict: refresh entity state before retry.
- Do not blind-retry other 4xx.
- Retry idempotent reads on transient 5xx/503 with bounded backoff.
- On 429, honour
Retry-Afterwhen present; use exponential backoff otherwise.