Errors
A failed request answers with a problem document. The code never changes, the words may.
Errors use the media type application/problem+json (RFC 9457).
{
"type": "https://invoicing.respiresoft.com/docs/api/errors#resource_missing",
"title": "Not found",
"status": 404,
"code": "resource_missing",
"detail": "There is no invoice with the id \"inv_x\" in this account.",
"param": "id"
}
- Branch your code on
code. It is stable. detailis plain words that you can show to a person.paramnames the field when one field is wrong. For a failed validationerrorsmaps each field to a list of messages.
Statuses
| Status | Meaning |
|---|---|
| 400 | The request could not be understood, for example a bad limit or cursor. |
| 401 | No key, or a wrong, revoked or expired key. |
| 403 | The key may not do this: missing scope, or the feature is off for the business. |
| 404 | No such object in this account (also for objects of another mode). |
| 409 | The object is in the wrong state, or the same Idempotency-Key is still being processed. |
| 413 | The request is too large. |
| 422 | A field is wrong or unknown. |
| 429 | Too many requests. |
| 5xx | Our side. Retry with the same Idempotency-Key. |
Codes
| Code | When |
|---|---|
invalid_api_key | The key is missing or unknown. |
insufficient_scope | The key lacks the scope the endpoint needs. |
rate_limited | More than 600 requests a minute. |
resource_missing | The id does not exist in this account and mode. |
validation_failed | A field is invalid; see errors. |
unknown_parameter | A field the endpoint does not know. Unknown fields are refused, never ignored. |
invalid_cursor, invalid_limit, invalid_type, invalid_status | A bad list parameter. |
idempotency_key_required | A POST without an Idempotency-Key header. |
idempotency_key_reused | The same key was used with a different request. |
idempotency_in_progress | The first request with this key is still running. |
invalid_state | The object cannot do this now, for example running a plan that is paused. Commands that are refused use their reason as the code. |
endpoint_disabled | The webhook endpoint is switched off; switch it on first. |
not_replayable | A test event cannot be replayed. |
too_many_endpoints | You have the maximum of 20 webhook endpoints. |
server_error | Our side. Retry; if it keeps happening send us the Request-Id. |