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"
}
JSON
FieldTypeDescription
detailstringHuman-readable message (in Spanish). It may change: don't compare it in code.
codestringStable error code. This is what your logic should use.
errorsarrayValidation errors only: one item per problem, with field (dotted path, e.g. lines.0.quantity), code and message.
request_idstringRequest id. Same value as the X-Request-Id header.
required_scopestringinsufficient_scope only: the missing scope.
retry_afterintegerrate_limited only: seconds to wait.
error_idstringserver_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

HTTPcodeWhenWhat to do
400validation_errorA field is invalid or missing, or a filter has a wrong value.Fix the fields in errors. Don't retry unchanged.
400parse_errorThe body is not valid JSON.Check your serialization.
401not_authenticatedNo key was sent.Add Authorization: Bearer blr_….
400idempotency_key_invalidThe Idempotency-Key header has an invalid format.Use 1 to 255 printable characters.
401authentication_failedUnknown or revoked key.Check the key in Settings → API.
401api_key_expiredThe key is past its expiry date.Create a new key.
400invalid_phoneThe SMS phone number is not valid.Use international format (+34600111222).
402quota_exceededA plan quota was reached (e.g. invoices per year).Upgrade the plan or wait for the next period.
402insufficient_sms_creditsNo SMS credits left (free or bundles).Buy an SMS bundle in the app.
403permission_deniedThe role or the resource state doesn't allow the operation.Read detail.
403insufficient_scopeThe key lacks the required scope (required_scope).Create a key with that scope.
403api_key_not_allowedThe endpoint doesn't accept API keys (account, session, subscription…).Only use endpoints from the public reference.
403api_key_creator_inactiveThe key's creator is no longer an active owner/admin.Create a new key with an active admin.
403plan_no_api_accessThe current plan doesn't include API access.Switch to Pro or Business.
403module_not_availableThe resource belongs to a module that is not subscribed (CRM, cases…).Enable the module in the subscription.
403feature_not_availableThe feature isn't included in the plan.Change plan.
404not_foundThe resource doesn't exist or belongs to another organization.Check the id.
405method_not_allowedHTTP method not supported on that path.Check the reference.
409conflictThe 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.
409idempotency_key_in_useAnother request with the same Idempotency-Key is still being processed.Wait and retry with the same key.
409accounting_errorThe 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.
409revolut_not_configured / revolut_auth_error / revolut_signing_key_exists / revolut_auth_mode / revolut_sync_in_progress / revolut_account_has_transactions / foreign_currency_accountThe 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.
415unsupported_media_typeUnsupported Content-Type.Use application/json or multipart/form-data.
422idempotency_key_reusedThe Idempotency-Key was already used with a different request.Generate a new key per operation.
424revolut_api_error / revolut_rate_limited / revolut_unreachableRevolut answered with an error, is throttling requests or does not respond. The failure is at the external service.Retry later. See Revolut Business.
429rate_limitedToo many requests.Wait Retry-After seconds. See Rate limits.
429sms_rate_limitedSMS anti-abuse limit (10 per minute per organization, 1 per minute to the same number).Wait Retry-After seconds.
500server_errorUnexpected error at Billora.Retry with backoff; if it persists, contact support with the request_id.
502delivery_failed / sms_delivery_failedThe external provider could not deliver the signature request or the SMS.Retry later.
503sms_unavailableThe SMS service is unavailable.Retry later.
503quota_unavailableThe 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"
}
JSON

Missing resource (or one from another organization)

{
  "detail": "No encontrado.",
  "code": "not_found",
  "request_id": "req_01JBQ81E4G6J8L0N2Q4S6U8W0Y"
}
JSON

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"
}
JSON

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

ResponseRetry?
Network error or timeoutYes, with the same Idempotency-Key on POST/PATCH.
429Yes, after Retry-After.
500, 502, 503, 504Yes, 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_useYes, after a short wait, with the same key.
Any other 4xxNo: fix the request.

See the full recipe in Rate limits.