> ## Documentation Index
> Fetch the complete documentation index at: https://developers-docs.easyorders.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> One error shape for every endpoint, and stable codes to branch on.

Every error of the Admin API has the same shape:

```json theme={"dark"}
{
  "error": {
    "code": "validation_failed",
    "message": "Validation failed",
    "details": {
      "fields": [
        { "field": "items[0].quantity", "rule": "between", "param": "1,10000" }
      ]
    }
  }
}
```

* `code` is stable and snake\_case: branch on it.
* `message` is for people. It may change.
* `details` is there when the error has more to say, shaped per code.

## Validation

`422 validation_failed` lists **every** problem at once in `details.fields`:

| Key | |
| - | - |
| `field` | The JSON path of the input, e.g. `areas[2].cost`. |
| `rule` | The rule that failed: `required`, `between`, `in`, `max`, `decimals`, `unique`, ... |
| `param` | The rule's parameter when it has one, e.g. `0,1000000` for `between`. |

## Status codes

| Status | Codes | Meaning |
| - | - | - |
| 400 | `invalid_request` | The body is not a JSON object, has a wrong type, or an unknown field. |
| 401 | `unauthenticated` | The access token is missing, invalid or expired. Refresh it. |
| 402 | `payment_required` | Your app's subscription on this store is suspended. |
| 403 | `insufficient_scope` | The token lacks the endpoint's scope; `details.required_scope` names it. |
| 404 | `not_found` | No such resource in this store. |
| 409 | per endpoint | The request conflicts with the resource's state, e.g. `insufficient_stock`, `area_exists`. |
| 413 | `body_too_large` | The body is over the limit. |
| 422 | `validation_failed`, `idempotency_key_reused`, ... | The input broke a rule. |
| 429 | `too_many_requests`, `daily_limit_exceeded` | A limit was reached. Wait `Retry-After` seconds. |
| 500 | `internal_error` | Our fault. Retry later. |
| 503 | `service_unavailable` | A service behind the API did not answer. Retry later. |

Each endpoint lists the codes it can answer in the [API reference](https://developers-docs.easyorders.ai/api-reference/orders/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.