Errors
The single error format of the API, the error code table, the request_id and how to handle each case in your integration.
When a request fails, the API answers with an HTTP 4xx or 5xx status and a JSON body that always has the same shape, whatever the endpoint.
Format
{
"detail": "Los datos enviados no son válidos.",
"code": "validation_error",
"errors": [
{ "field": "lines.0.quantity", "code": "invalid", "message": "Un número válido es necesario." },
{ "field": "customer", "code": "required", "message": "Este campo es requerido." }
],
"request_id": "req_01JBQ7X9K2M4N6P8R0S2T4V6W8"
}| Field | Type | Description |
|---|---|---|
detail | string | Human-readable message (in Spanish). It may change: don't compare it in code. |
code | string | Stable error code. This is what your logic should use. |
errors | array | Validation errors only: one item per problem, with field (dotted path, e.g. lines.0.quantity), code and message. |
request_id | string | Request id. Same value as the X-Request-Id header. |
required_scope | string | insufficient_scope only: the missing scope. |
retry_after | integer | rate_limited only: seconds to wait. |
error_id | string | server_error only: internal incident reference. |
Compatibility with the previous format
Validation errors (400) also keep the previous per-field keys at the top level, next to errors, for example "lines": {"0": {"quantity": ["Un número válido es necesario."]}}. New integrations should read errors.
Error codes
| HTTP | code | When | What to do |
|---|---|---|---|
| 400 | validation_error | A field is invalid or missing, or a filter has a wrong value. | Fix the fields in errors. Don't retry unchanged. |
| 400 | parse_error | The body is not valid JSON. | Check your serialization. |
| 401 | not_authenticated | No key was sent. | Add Authorization: Bearer blr_…. |
| 400 | idempotency_key_invalid | The Idempotency-Key header has an invalid format. | Use 1 to 255 printable characters. |
| 401 | authentication_failed | Unknown or revoked key. | Check the key in Settings → API. |
| 401 | api_key_expired | The key is past its expiry date. | Create a new key. |
| 400 | invalid_phone | The SMS phone number is not valid. | Use international format (+34600111222). |
| 402 | quota_exceeded | A plan quota was reached (e.g. invoices per year). | Upgrade the plan or wait for the next period. |
| 402 | insufficient_sms_credits | No SMS credits left (free or bundles). | Buy an SMS bundle in the app. |
| 403 | permission_denied | The role or the resource state doesn't allow the operation. | Read detail. |
| 403 | insufficient_scope | The key lacks the required scope (required_scope). | Create a key with that scope. |
| 403 | api_key_not_allowed | The endpoint doesn't accept API keys (account, session, subscription…). | Only use endpoints from the public reference. |
| 403 | api_key_creator_inactive | The key's creator is no longer an active owner/admin. | Create a new key with an active admin. |
| 403 | plan_no_api_access | The current plan doesn't include API access. | Switch to Pro or Business. |
| 403 | module_not_available | The resource belongs to a module that is not subscribed (CRM, cases…). | Enable the module in the subscription. |
| 403 | feature_not_available | The feature isn't included in the plan. | Change plan. |
| 404 | not_found | The resource doesn't exist or belongs to another organization. | Check the id. |
| 405 | method_not_allowed | HTTP method not supported on that path. | Check the reference. |
| 409 | conflict | The resource's current state prevents the operation (e.g. a posted journal entry) or you are deleting something other records use (e.g. a series with documents). | Read the resource again and decide. |
| 409 | idempotency_key_in_use | Another request with the same Idempotency-Key is still being processed. | Wait and retry with the same key. |
| 409 | accounting_error | The accounting operation is not possible in the current state: closed fiscal year, opening balance that does not add up, accounting start with closed fiscal years affected… | Read detail and fix the cause. See accounting. |
| 409 | revolut_not_configured / revolut_auth_error / revolut_signing_key_exists / revolut_auth_mode / revolut_sync_in_progress / revolut_account_has_transactions / foreign_currency_account | The Revolut Business connection is not configured (the API key is missing), Revolut has rejected the credentials, a signing key already exists (confirm with regenerate), the operation belongs to the other connection method, a sync is already running, the account already has imported transactions or the transaction belongs to an account that is not in euros. | See Revolut Business. |
| 415 | unsupported_media_type | Unsupported Content-Type. | Use application/json or multipart/form-data. |
| 422 | idempotency_key_reused | The Idempotency-Key was already used with a different request. | Generate a new key per operation. |
| 424 | revolut_api_error / revolut_rate_limited / revolut_unreachable | Revolut answered with an error, is throttling requests or does not respond. The failure is at the external service. | Retry later. See Revolut Business. |
| 429 | rate_limited | Too many requests. | Wait Retry-After seconds. See Rate limits. |
| 429 | sms_rate_limited | SMS anti-abuse limit (10 per minute per organization, 1 per minute to the same number). | Wait Retry-After seconds. |
| 500 | server_error | Unexpected error at Billora. | Retry with backoff; if it persists, contact support with the request_id. |
| 502 | delivery_failed / sms_delivery_failed | The external provider could not deliver the signature request or the SMS. | Retry later. |
| 503 | sms_unavailable | The SMS service is unavailable. | Retry later. |
| 503 | quota_unavailable | The plan quota couldn't be checked at that moment. | Retry in a few seconds. |
Handle unknown codes according to their HTTP status: new codes may appear in the future (that is a compatible change).
Some business rules return 400 with a domain-specific code, for example external_invoice when you try to issue a third-party invoice from Billora. Each resource guide covers them.
Examples
Missing scope
{
"detail": "Tu API key no tiene permisos para este recurso.",
"code": "insufficient_scope",
"required_scope": "expenses:write",
"request_id": "req_01JBQ80C3D5F7H9K1M3P5R7T9V"
}Missing resource (or one from another organization)
{
"detail": "No encontrado.",
"code": "not_found",
"request_id": "req_01JBQ81E4G6J8L0N2Q4S6U8W0Y"
}Rate limit
{
"detail": "Has superado el límite de peticiones. Vuelve a intentarlo en 12 segundos.",
"code": "rate_limited",
"retry_after": 12,
"request_id": "req_01JBQ82F5H7K9M1P3R5T7V9X1Z"
}The request_id
Every response, successful or not, carries the X-Request-Id header. If you send your own X-Request-Id (up to 128 characters A-Z a-z 0-9 . _ -) we reuse it, so you can correlate your logs with ours. Otherwise we generate one shaped req_ + 26 characters.
Log it with every error and include it when you write to support: it lets us find the exact request.
What to retry
| Response | Retry? |
|---|---|
| Network error or timeout | Yes, with the same Idempotency-Key on POST/PATCH. |
429 | Yes, after Retry-After. |
500, 502, 503, 504 | Yes, with exponential backoff and jitter (a few attempts at most). |
424 revolut_* | Yes, later: the failure is at Revolut and nothing was applied halfway. |
409 idempotency_key_in_use | Yes, after a short wait, with the same key. |
Any other 4xx | No: fix the request. |
See the full recipe in Rate limits.
