Lueira — Management software for active tourism

Error handling

Every error returns a consistent JSON body, regardless of the endpoint.

Shape

  • error_code — stable code you can use to handle the error programmatically.
  • message — human-readable description of the error.
  • errors — optional; per-field detail on validation errors.
shell
{
  "error_code": "VALIDATION_ERROR",
  "message": "\"email\" is required",
  "errors": {
    "email": "required"
  }
}

Status codes

StatusMeaning
400Invalid request (field validation)
401Missing, invalid, or revoked key
402Subscription access blocked or monthly quota exhausted without auto top-up
403The key lacks the required scope
404Resource not found (or not in your tenant)
409Conflict — resource already exists or state disallows it
422Business rule violated (e.g. no availability)
429Rate limit exceeded — see Rate limits
500Internal error; retry later

Retry strategy

Retry with exponential backoff on 429, 502, 503 and 504. Don't automatically retry other 4xx: they'll fail the same way.

Public Store API errors

The Store API has a separate error contract from the admin API. Every Store API error uses this shape:

  • 400 invalid_request — invalid request, JSON, or parameters.
  • 401 invalid_api_key, invalid_customer_token, or customer_authentication_required — a valid credential is missing.
  • 402 store_api_subscription_required — inactive or unavailable API subscription.
  • 403 insufficient_scope, api_key_type_not_permitted, or forbidden — the key type, scope, or permission is insufficient.
  • 404 not_found or store_not_found — the API is disabled, or the store or resource is unavailable.
  • 409 idempotency_conflict or commerce_conflict — idempotency conflict or incompatible purchase state; a pending operation needs reconciliation.
  • 410 cart_link_expired — cart link expired.
  • 422 invalid_selection — invalid product or availability selection.
  • 429 rate_limit_exceeded — the per-minute limit was reached; honor Retry-After.
  • 503 *_unavailable — a dependent service is unavailable.
  • 500 store_api_error — unexpected internal error; contact support and include the request_id.
shell
{"error":{"code":"invalid_request","request_id":"..."}}
For purchase operations, never blindly retry a 409: a pending operation may already have created a booking or started a payment. Keep the same Idempotency-Key and check its state before retrying.