Error codes
Branch on error.code, not on the message text. Messages may change; codes don’t.
400 · invalid_request_error
validation_failed- One or more fields are invalid. `error.details` lists each path and message.
invalid_json- The body is not valid JSON.
missing_idempotency_key- This endpoint requires an Idempotency-Key header.
invalid_idempotency_key- Idempotency keys must be 1–255 visible ASCII characters (0x21–0x7E). Spaces are rejected.
invalid_amount- Amounts must be positive integers in minor units (e.g. 4500 = 4.500 KWD).
location_required- Branch-scoped credentials must send a location_id.
same_customer- Source and target customer are the same.
payload_too_large- Request bodies are limited to 1 MB.
unsupported_media_type- Send Content-Type: application/json.
401 · authentication_error
missing_credentials- No Authorization header.
invalid_api_key- The API key is unknown, revoked or expired.
invalid_token- The bearer token is invalid.
token_expired- The OAuth access token expired; request a new one.
invalid_credentials- Wrong client ID or secret at /oauth/token.
402 · plan_error
plan_limit_exceeded- A plan limit (passes, locations, staff, campaigns) was reached. `details` has metric, limit and used.
403 · permission_error
insufficient_scope- The credential lacks a scope for this operation.
ip_not_allowed- The request IP is not in the credential’s allow-list.
location_not_allowed- The credential or user may not act on this branch.
tenant_not_active- The live environment is not activated yet — use the sandbox.
tenant_suspended- The account is suspended; balance changes are blocked.
separation_of_duties- An approver cannot approve their own request.
404 · invalid_request_error
resource_not_found- The object does not exist in this environment (IDs from another account or environment are never visible).
409 · conflict_error
duplicate_transaction- This POS receipt (external_id) was already recorded; the original transaction is returned in details.
idempotency_in_progress- A request with this Idempotency-Key is still running. Retry shortly with the same key.
concurrent_conflict- A conflicting write happened at the same time. Retry with the same Idempotency-Key.
customer_exists- A customer with this email, phone or external_id already exists.
already_reversed- The transaction was already reversed.
reward_already_redeemed- The issued reward was already used.
invalid_status_transition- The object cannot move to that status from its current one.
422 · business_rule_error
insufficient_balance- Not enough points or stamps for this redemption.
idempotency_key_reused- The Idempotency-Key was used with a different request. Use a new key.
no_active_program- The account has no active loyalty program.
program_not_active- The program is a draft or archived.
account_closed- The loyalty account is closed.
customer_inactive- The customer was anonymized or merged.
currency_mismatch- The sale currency differs from the program currency.
not_reversible- This transaction type cannot be reversed, or the reversal window has passed.
reward_limit_reached- The customer reached this reward’s limit.
reward_expired- The issued reward expired.
coupon_exhausted- The coupon code has no redemptions left.
no_pass_template- No published pass template for this program.
pass_inactive- The pass is voided or expired.
enrollment_closed- Public enrollment is closed for this program.
429 · rate_limit_error
rate_limited- Too many requests for this credential. Wait for Retry-After seconds.
5xx · api_error
internal_error- Unexpected error. Safe to retry with the same Idempotency-Key; contact support with the request_id if it persists.