> ## Documentation Index
> Fetch the complete documentation index at: https://strapi-suite.littlebox.pt/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors and rate limits

> Handle every error code and rate limit of the storefront API.

Every error uses Strapi's error format:

```json theme={null}
{
  "data": null,
  "error": {
    "status": 409,
    "name": "ConflictError",
    "message": "Invalid request",
    "details": {
      "code": "TOTAL_CHANGED",
      "errors": [{ "path": "expectedTotal", "code": "TOTAL_CHANGED", "detail": "5190" }]
    }
  }
}
```

* `details.code` is the code to branch on. For a `400`, it is the first error's code. For a `409`, it is the first conflict code.
* `details.errors` (when present) lists every problem as `{ path, code, detail? }`. `path` points at the field, for example `lines.0.quantity` or `shippingAddress.postalCode`. Use it to show messages next to the right input.
* `WEAK_PASSWORD` adds `details.reason`.
* A `403` from a wrong token has no `details.code`.
* While the e-commerce module is off, every route answers `404` with no `details.code`.
* A `500` carries no details.

## Status Codes

| Status | Codes |
| - | - |
| 400 | Field codes: `required`, `invalid`, `too_long`, `too_many`, `invalid_email`, `invalid_country`, `invalid_locale`, `invalid_number`, `invalid_sort`, `invalid_amount`, `invalid_idempotency_key`, `same_email`. Business codes: `VARIANT_UNAVAILABLE`, `INSUFFICIENT_STOCK`, `SHIPPING_UNAVAILABLE`, `PROMOTION_CODE_INVALID`, `VERIFICATION_CODE_INVALID`, `STORE_CREDIT_NOT_FOUND`, `STORE_CREDIT_VOID`, `STORE_CREDIT_EXPIRED`, `STORE_CREDIT_EMPTY`, `INVALID_POSTAL_CODE`, `PICKUP_NOT_AVAILABLE`, `PICKUP_POINT_REQUIRED`, `PICKUP_POINT_INVALID`, `TOKEN_INVALID`, `WEAK_PASSWORD`, `INVALID_CREDENTIALS` (password and email change) |
| 401 | `SESSION_INVALID`, `LOGIN_REQUIRED`, `CUSTOMER_SESSION_INVALID`, `INVALID_CREDENTIALS` (login) |
| 403 | `ACCOUNTS_DISABLED`, `EMAIL_NOT_VERIFIED`, `CUSTOMER_BLOCKED`; no code for a wrong API token |
| 404 | `NOT_FOUND` (catalog, sessions), `ORDER_NOT_FOUND`; no code while the e-commerce module is off |
| 409 | `TOTAL_CHANGED`, `PROMOTION_UNAVAILABLE`, `EMAIL_VERIFICATION_REQUIRED`, `EMAIL_IN_USE`, `STORE_CREDIT_INSUFFICIENT`, `STORE_CREDIT_CONFLICT`, `NOTHING_DUE`, `PAYMENT_PENDING`, `ACTION_NOT_AVAILABLE`, `VERIFICATION_CONFLICT`, `IDEMPOTENCY_KEY_CONFLICT` |
| 429 | `RATE_LIMITED`, `VERIFICATION_LOCKED` |
| 502 | `STRIPE_UNREACHABLE`, `STRIPE_REQUEST_FAILED`, `EMAIL_SEND_FAILED`, `PICKUP_SEARCH_FAILED` and other carrier codes |
| 503 | `STRIPE_NOT_CONFIGURED`, `STOREFRONT_URL_MISSING`, `EMAIL_NOT_CONFIGURED`, `ACCOUNTS_UNAVAILABLE` |
| 500 | Unexpected error, no details |

## Retries

* **`401`**: drop the dead cookie (`SESSION_INVALID` or `CUSTOMER_SESSION_INVALID`), open a new session when needed, and repeat the call once. Never repeat an order on a new session.
* **`409`**: re-read the data (quote, store credit, status) and show the change. Retry `VERIFICATION_CONFLICT` and `IDEMPOTENCY_KEY_CONFLICT` as they are.
* **`429`**: wait the `Retry-After` seconds (also in `details.retryAfter`). Tell the customer to try again later.
* **`502`**: a provider failed. Retry a few times with a growing delay. For orders, keep the same idempotency key.
* **`503`**: a setup problem on the store. Show a friendly message and alert the store owner. Retrying does not help.

## Rate Limits

Strapi counts requests in fixed windows, per rule and per dimension: per session, per client IP (only with a valid `X-Storefront-Client-IP`) and per email (normalized and hashed, never stored in clear). A request counts only when every dimension allows it, so a request refused by one limit spends nothing in the others.

| Rule | Routes | Per session | Per client IP | Per email |
| - | - | - | - | - |
| `session.create` | `POST /checkout/session` (new sessions only) | | 20 / 60 min | |
| `catalog` | products, categories, collections | | 600 / 1 min | |
| `cart.quote` | `GET /cart`, `POST /cart/quote`, pickup points | 120 / 10 min | 600 / 10 min | |
| `discount.apply` | `POST /discounts/apply` | 20 / 10 min | 60 / 60 min | |
| `storeCredit.check` | `POST /store-credit/check` | 10 / 10 min | 30 / 60 min | |
| `email.send` | `POST /checkout/email-verification` | 3 / 15 min | 10 / 60 min | 5 / 60 min |
| `email.confirm` | `POST /checkout/email-verification/confirm` | 10 / 15 min | 30 / 60 min | 5 / 60 min |
| `order.create` | `POST /orders` | 5 / 10 min | 20 / 60 min | |
| `order.read` | payment link, order status | 120 / 10 min | | |
| `account.register` | `POST /account/register` | | 20 / 60 min | 5 / 60 min |
| `account.email` | resend verification, forgot password | | 20 / 60 min | 3 / 60 min |
| `account.login` | `POST /account/login` | | 10 / 1 min | 5 / 15 min (failed logins only) |
| `account.token` | verify email, reset password, confirm email change | | 20 / 60 min | |
| `account.private` | logout, me, orders, sessions | 120 / 10 min | | |
| `account.password` | change password, change email | 5 / 15 min | | |

Over a limit, Strapi answers `429` with a `Retry-After` header and `details: { code: "RATE_LIMITED", retryAfter }`. Password hashing also has a small queue on the server: when it is full, account routes answer `429 RATE_LIMITED` with a short `Retry-After`.

> [!WARNING]
>
> The counters live in memory on the Strapi process. They are exact only with a single Strapi instance, and they reset
> when Strapi restarts.


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