Errors
Errors are application/problem+json (RFC 9457) with a machine-readable code in code.
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/problem+json
{
"type": "https://api.abfaktura.cz/docs/chyby#DocumentLimitReached",
"title": "The request was refused",
"status": 422,
"code": "DocumentLimitReached"
}
Act on the code and the HTTP status, not on title and detail, which may change. Validation errors
(400) list the fields and their errors in errors:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": { "Lines": ["The field Lines must be a string or array type with a minimum length of '1'."] }
}
Codes
| Code | Status | Meaning |
|---|---|---|
Unauthorized | 401 | The API key or token is missing or not valid (revoked, expired). |
ApiKeyScope | 403 | The key or token lacks a permission; detail names it. |
Forbidden | 403 | The user of the key may not do this. |
PlanRequired | 402 | The API is part of the paid plans only. |
NotFound | 404 | The record does not exist or belongs to another company. |
ValidationFailed | 400 | The request is malformed; errors lists the fields and reasons. |
TooManyRequests | 429 | Too many requests; wait as Retry-After says. |
IdempotencyKeyReused | 422 | The same Idempotency-Key was used for another request. |
Conflict | 409 | A request with the same Idempotency-Key is still running, or the data conflict. |
PartnerRequired | 422 | The customer (customer) or supplier (supplier), or a contactId, is missing. |
DocumentLimitReached | 422 | The document limit of the plan is used up. |
DocumentNumberAlreadyUsed | 422 | Another document has this number. |
NumberSeriesNotFound | 422 | The number series does not exist. |
CorrectionReasonRequired | 422 | A credit note needs the reason of the correction. |
CorrectedInvoiceNotFound | 422 | The corrected invoice does not exist. |
ProformaNotFound | 422 | The proforma does not exist. |
ProformaAlreadySettled | 422 | Another invoice already settles the proforma. |
QuoteNotFound | 422 | The quote does not exist. |
AdvanceNotVatPayer | 422 | Only a VAT payer issues a tax document on a payment. |
AdvanceNothingToCover | 422 | The proforma has no paid amount without a tax document. |
WebhookUrlInvalid | 422 | The webhook address is not a public https address. |
WebhookEventsInvalid | 422 | Unknown webhook event. |
WebhookTooMany | 422 | The company already has 10 webhooks. |
Unexpected | 500 | An error on our side. Try again; if it persists, write to the support. |