Appearance
Errors
Errors are always JSON - also without an Accept header - and never a redirect to a login page. Every error has a message; many carry a machine-readable error code as well.
json
{ "message": "The access token needs the scope \"user\" or \"console-zones\".", "error": "missing_scope", "scope": "console-zones", "scopes": ["user", "console-zones"] }Use error (where present) for decisions in your code, and message for logs and humans.
Status codes
| Status | When | Body |
|---|---|---|
401 | no, invalid, expired or revoked token; unknown user | {"message": "Unauthenticated."} |
401 | the token's app may not use the Console API beta | {"message": "…", "error": "client_not_allowed"} |
402 | a direct purchase: the charge failed | {"message": "…", "error": "order_failed", "order": {…}} |
403 | the token lacks the scope | {"message": "…", "error": "missing_scope", "scope": "…", "scopes": […]} |
403 | you may not access the object or action | {"message": "…"} |
404 | no such object or endpoint - also objects you cannot see | {"message": "…"} |
409 | the request conflicts with the object's state | {"message": "…", "error": "<code>"} |
422 | validation failed | {"message": "…", "errors": {"field": ["…"]}} |
429 | rate limit exceeded | {"message": "Too Many Attempts."} (see Rate limits) |
500 | an order request failed after its order was recorded (see Idempotency) | {"message": "…", "error": "order_unknown_state", "order_id": "…"} |
502 | the checkout could not be opened on Anikeen ID beta | {"message": "…", "error": "checkout_unavailable", "order": {…}} |
503 | a backend the request needs is not reachable right now | {"message": "…"} |
Validation errors
422 lists the problems per field. Fields of order items are keyed by their position:
json
{
"message": "The selected location is invalid.",
"errors": {
"items.0.attributes.location_id": ["The selected location is invalid."]
}
}Error codes
Codes marked beta belong to features that are not yet released to production.
error | Status | Meaning |
|---|---|---|
client_not_allowed beta | 401 | the token's app may not use this API |
missing_scope | 403 | the token lacks a scope; scope names it |
email_not_verified beta | 403 | the user's e-mail address is not verified in Anikeen ID |
owner_only beta | 403 | a team member may not order: the owner does not allow members to buy |
team_managed_by_app beta | 403 | the team is managed by an app: orders go through that app |
no_app_team beta | 404 | GET /app-team with a token that is not an app token |
account_conflict beta | 409 | the user's e-mail address belongs to another Console account |
owner_sign_in_required | 409 | the team owner's Anikeen ID login expired - the owner must sign in to the Console once |
order_refused | 409 | e.g. no default billing address or payment method |
billing_suspended beta | 409 | the server is suspended for an unpaid invoice (containers answer 409 without a code) |
provisioning beta | 409 | the product is still being set up (or its setup is stuck and with support) - see Products being set up |
server_protected beta | 409 | the server's deletion protection is on |
idempotency_key_in_progress | 409 | the first request with this key still runs - see Idempotency |
idempotency_key_reused | 422 | the key was used with another body |
order_failed | 402 | the charge of a direct purchase failed |
order_unknown_state | 500 | the order request failed after its order was recorded; order_id names it |
checkout_unavailable beta | 502 | the checkout could not be opened; try again with a new key |
rate_limited | 429 | more than 10 orders per minute and team |
The reseller API adds reseller_terms_required, reseller_offboarding and reseller_orders_blocked.
In the PHP SDK
The SDK throws one exception class per case - see SDK errors.