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

# Errors - Status codes and error codes

> The error body of the Apexium API, every error code with its HTTP status, and which errors you can retry.

Errors share one body:

```json theme={null}
{
  "code": "INVALID_STAKE",
  "message": "stake.amount must be a positive decimal with at most 2 decimals"
}
```

* `code` is stable: branch on it.
* `message` is for humans and may change.
* `details` is present on some errors and described below.

New codes can be added. Treat an unknown code like any other error of its HTTP status.

## Request errors

| Code | Status | Meaning |
| - | - | - |
| `VALIDATION_FAILED` | 400 | The request does not match the schema. `details.errors` lists `{ field, message }` pairs. |
| `MODE_REQUIRED` | 400 | `mode` is missing on `POST /v1/orders`. It must be `"preview"` or `"place"`; there is no default. |
| `INVALID_STAKE` | 400 | `stake.amount` is not a positive decimal with at most two decimals. |
| `INVALID_PRICE` | 400 | `minPrice` is below 1.001. |
| `INVALID_EXPIRY` | 400 | `expiresAt` is in the past or more than one hour ahead. |
| `CURRENCY_NOT_SUPPORTED` | 400 | `stake.currency` is not the account currency. |
| `BOOKMAKER_NOT_AVAILABLE_VIA_API` | 400 | A requested bookmaker is closed to the API, even if it is enabled on your account. |
| `INVALID_CURSOR` | 400 | The pagination cursor is invalid. Restart the listing without one. |
| `INVALID_WINDOW` | 400 | `from` is not before `to`, or the window is longer than 366 days. |
| `NOT_FOUND` | 404 | No such resource on your account, or no such path. |

## Authentication and access

| Code | Status | Meaning |
| - | - | - |
| `INVALID_API_KEY` | 401 | The key is missing, unknown, revoked or expired. |
| `API_ACCESS_DENIED` | 403 | The account no longer has API access, or is suspended. |
| `ACCOUNT_NOT_ACTIVE` | 403 | The account cannot place orders in its current status. |
| `BOOKMAKER_NOT_AVAILABLE` | 403 | A requested bookmaker is not available on your account. |
| `BETTING_NOT_ALLOWED` | 403 | Your account's rules do not allow betting on this selection. |
| `FORBIDDEN` | 403 | The request is not allowed. |

## Order rejections

These are the checks made before anything is sent to a bookmaker. When one fails, nothing is recorded: no order, no bet.

Once the checks pass, the order is recorded. A bookmaker that then declines does not make the request fail. The order comes back with `201`, and each declined bet carries its `declineReason`. When every bet is declined, the order's status is `REJECTED`.

| Code | Status | Meaning |
| - | - | - |
| `INSUFFICIENT_FUNDS` | 400 | The available balance does not cover the stake. |
| `MAX_STAKE_PER_FIXTURE_EXCEEDED` | 400 | The stake exceeds your maximum for this fixture. `details` holds `maxStake`, `existingStake` and `remaining`. |
| `PRICE_NOT_AVAILABLE` | 400 | No active price at the requested bookmakers. |
| `PRICE_CHANGED` | 400 | The price moved below `minPrice`. |
| `NO_LIQUIDITY` | 400 | No liquidity at or above `minPrice`. |
| `INSUFFICIENT_LIQUIDITY` | 400 | The liquidity does not cover the full stake, and `acceptPartialStake` is `false`. |
| `CLIENT_ORDER_ID_REUSED` | 409 | The `clientOrderId` belongs to an order with different terms. See [Idempotency](https://docs.apexiumbet.com/guides/idempotency.md). |
| `PREVIOUS_ATTEMPT_UNRESOLVED` | 409 | An earlier attempt with this `clientOrderId` is still being resolved. Retry the same request later. |
| `ORDER_BUSY` | 409 | The order is being worked on right now. Retry the cancellation. |
| `CONFLICT` | 409 | The request conflicts with the current state. |

## Service errors

| Code | Status | Meaning | Retry |
| - | - | - | - |
| `RATE_LIMITED` | 429 | Too many requests. See [Limits](https://docs.apexiumbet.com/api-reference/limits.md). | After `retry-after` seconds |
| `INTERNAL_ERROR` | 500 | Unexpected error. | Yes, with backoff |
| `UPSTREAM_UNAVAILABLE` | 502 | The bookmaker gateway did not answer. The order may or may not exist. | Resend the same request with its `clientOrderId` to read the order |
| `FEED_UNAVAILABLE` | 502 | The market data service did not answer. | Yes, with backoff |
| `BETTING_SUSPENDED` | 503 | Betting is suspended for this selection or bookmaker. | Later |
| `EXPIRY_NOT_AVAILABLE` | 503 | Orders with `expiresAt` are not available on this environment. | Without `expiresAt` |
| `BALANCE_UNAVAILABLE` | 409 | The balance cannot be read right now. | Yes, shortly |
| `PUBLIC_API_DISABLED` | 503 | The API is temporarily disabled. | Later |
| `SERVICE_UNAVAILABLE` | 503 | The service is temporarily unavailable. | Yes, with backoff |
| `FEED_TIMEOUT` | 504 | The market data service took too long to answer. | Yes, with backoff |

> [!TIP]
>
> Every response carries an `x-request-id` header. Quote it when you report an error.


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