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

# Errors

> HTTP status codes and error handling for the Inventory API.

## Error shape

Failed requests return JSON with `success: false` and an `error` message:

```json theme={null}
{
  "success": false,
  "error": "Missing or invalid API key"
}
```

## HTTP status codes

| Status        | Meaning                                                | What to do                                         |
| ------------- | ------------------------------------------------------ | -------------------------------------------------- |
| `400`         | Bad request — invalid `action`, malformed `skus`, etc. | Fix the request body                               |
| `401`         | Missing or invalid API key                             | Verify the `Authorization` header                  |
| `405`         | Wrong HTTP method                                      | Use `POST` only                                    |
| `500`         | Server error                                           | Retry with exponential backoff                     |
| `502` / `503` | Upstream unavailable                                   | Retry with backoff; contact Keystone if persistent |

## Retry guidance

* Use exponential backoff for `5xx` responses.
* `400` and `401` errors are not retryable without changing the request.
* For bulk syncs, paginate with `limit` / `offset` rather than sending very large `skus` arrays.
