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

# Error Codes

> Error codes returned by the Options order routes.

Every Options order error carries `error.slug` and `error.code` on the [Order Management Stream](/latest/options/websocket-api/order-management-stream), whether the order was sent over WebSocket or over HTTP: the HTTP routes answer `202` once the order is queued, and the engine reports its decision on the stream. The code names the class of refusal and the slug its cause; `10003` is a rejected request, and its slug says why. HTTP errors themselves use the shared codes of the [Error Reference](/latest/error-reference/error-code).

```json theme={null}
{
  "resultType": "createOrder",
  "data": {
    "statusCode": 400,
    "body": "order rejected",
    "clientRequestId": "3e2c3bb4-be3f-4d05-9133-51d3a27b74ef",
    "error": { "slug": "rate_limited", "code": "10006" }
  }
}
```

## createOrder

| Error Code | Error Slug                                                                | Server Status Code | Meaning                                                                                                                                                                 |
| ---------- | ------------------------------------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **10001**  | **contract\_not\_ready**                                                  | `400`              | The engine has not loaded the contract yet. Retry shortly.                                                                                                              |
| **10002**  | **inactive\_contract**                                                    | `400`              | The contract is not tradable: expired, retired or disabled.                                                                                                             |
| **10003**  | **order\_rejected**                                                       | `400`              | A rejection none of the slugs below names.                                                                                                                              |
| **10003**  | **invalid contract**                                                      | `400`              | The contract does not exist or is not open for trading.                                                                                                                 |
| **10003**  | **account not active**                                                    | `400`              | Your account is not in the `active` state.                                                                                                                              |
| **10003**  | **duplicate\_order\_id**                                                  | `400`              | An order with the same id is already on the book.                                                                                                                       |
| **10003**  | **unsupported time in force**                                             | `400`              | Only `GTC` is accepted.                                                                                                                                                 |
| **10003**  | **invalid quantity**                                                      | `400`              | The quantity is not a positive whole number of contracts.                                                                                                               |
| **10003**  | **invalid price**                                                         | `400`              | The limit price is not positive.                                                                                                                                        |
| **10003**  | **price exceeds tick size (max 2 decimal places)**                        | `400`              | The price has more than two decimal places.                                                                                                                             |
| **10003**  | **minimum contract value is \$10**                                        | `400`              | Price times quantity is below the minimum. Reduce-only orders are exempt.                                                                                               |
| **10003**  | **post-only requires limit order**                                        | `400`              | `postOnly` was set on a market order.                                                                                                                                   |
| **10003**  | **maxSlippage must be between 0 and 1 inclusive for market orders**       | `400`              |                                                                                                                                                                         |
| **10003**  | **maxSlippage is not supported for limit orders**                         | `400`              |                                                                                                                                                                         |
| **10003**  | **max open orders reached**                                               | `400`              | The [per-contract open-orders cap](/latest/options/guides/rate-limits#maximum-open-orders-per-contract) is reached.                                                     |
| **10003**  | **self trade not allowed**                                                | `400`              | The order would match one of your own resting orders.                                                                                                                   |
| **10003**  | **post\_only\_would\_cross**                                              | `400`              | A `postOnly` order would have taken liquidity.                                                                                                                          |
| **10003**  | **reduce-only order would increase position**                             | `400`              | A `reduceOnly` order exceeds what your position can close, or there is no position.                                                                                     |
| **10003**  | **insufficient margin**                                                   | `400`              | Available balance does not cover the order's initial margin and fee.                                                                                                    |
| **10003**  | **margin ratio exceeded**                                                 | `400`              | Your short exposure already uses too much of your collateral for this order to fit.                                                                                     |
| **10003**  | **mark price unavailable for open position**                              | `400`              | An open position has no mark price, so margin cannot be computed. Retry shortly.                                                                                        |
| **10003**  | **too\_many\_inflight\_orders**                                           | `400`              | Your account has too many orders [waiting for the engine](/latest/options/guides/rate-limits#in-flight-and-timing-limits). Wait for their outcomes before resubmitting. |
| **10003**  | **engine\_overloaded**                                                    | `400`              | The engine is shedding load across all accounts. Back off and retry.                                                                                                    |
| **10003**  | **engine\_timeout**                                                       | `400`              | The order waited past its deadline for a busy contract. Nothing was applied.                                                                                            |
| **10003**  | **balance\_version\_conflict**                                            | `400`              | Your balance changed while the order was being committed, and retries ran out.                                                                                          |
| **10003**  | **persist\_failed**                                                       | `400`              | The order store rejected the write. The book was rolled back.                                                                                                           |
| **10003**  | **delta\_failed**                                                         | `400`              | The order book update could not be published. The book was rolled back.                                                                                                 |
| **10003**  | **idempotency\_error**                                                    | `400`              | The duplicate-request check failed.                                                                                                                                     |
| **10003**  | **internal\_error**, **internal error**, **validation failed**, **panic** | `400`              | An internal failure while validating or processing the order. Verify before resubmitting.                                                                               |
| **10005**  | **receive\_window\_exceeded**                                             | `400`              | The request waited more than one second between queueing and engine pickup. Nothing was applied.                                                                        |
| **10006**  | **rate\_limited**                                                         | `400`              | The [creation or reduce-only budget](/latest/options/guides/rate-limits#account-level-rate-limit) is spent.                                                             |

A request the gateway cannot parse at all, a missing `quantity` or an unknown `tradeType` for instance, is also answered with `10003`; its slug is the parser's message rather than one of the names above.

## cancelOrder

| Error Code | Error Slug                                                                | Server Status Code | Meaning                                                                                                                             |
| ---------- | ------------------------------------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| **10001**  | **contract\_not\_ready**                                                  | `400`              | The engine has not loaded the contract yet. Retry shortly.                                                                          |
| **10002**  | **inactive\_contract**                                                    | `400`              | The contract is not tradable: expired, retired or disabled.                                                                         |
| **10003**  | **order\_rejected**                                                       | `400`              | A rejection none of the slugs below names.                                                                                          |
| **10003**  | **authorization rejected**                                                | `400`              | The order belongs to another account.                                                                                               |
| **10003**  | **too\_many\_inflight\_orders**                                           | `400`              | The engine's [cancel lane](/latest/options/guides/rate-limits#in-flight-and-timing-limits) is full. The order stays resting; retry. |
| **10003**  | **engine\_timeout**                                                       | `400`              | The cancel waited past its deadline for a busy contract. The order stays resting.                                                   |
| **10003**  | **persist\_failed**                                                       | `400`              | The order store rejected the write. The order stays resting.                                                                        |
| **10003**  | **delta\_failed**                                                         | `400`              | The order book update could not be published. The order stays resting.                                                              |
| **10003**  | **internal\_error**, **internal error**, **validation failed**, **panic** | `400`              | An internal failure while processing the cancel. Verify before resubmitting.                                                        |
| **10004**  | **order\_not\_found**                                                     | `404`              | No such order for your account: never accepted, or already filled or cancelled.                                                     |
| **10005**  | **receive\_window\_exceeded**                                             | `400`              | The request waited more than one second between queueing and engine pickup. The order stays resting.                                |
| **10006**  | **rate\_limited**                                                         | `400`              | The [cancellation budget](/latest/options/guides/rate-limits#account-level-rate-limit) is spent.                                    |

## modifyOrder

| Error Code | Error Slug                                                                | Server Status Code | Meaning                                                                                                                                                                 |
| ---------- | ------------------------------------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **10001**  | **contract\_not\_ready**                                                  | `400`              | The engine has not loaded the contract yet. Retry shortly.                                                                                                              |
| **10002**  | **inactive\_contract**                                                    | `400`              | The contract is not tradable: expired, retired or disabled.                                                                                                             |
| **10003**  | **order\_rejected**                                                       | `400`              | A rejection none of the slugs below names.                                                                                                                              |
| **10003**  | **invalid contract**                                                      | `400`              | The contract does not exist or is not open for trading.                                                                                                                 |
| **10003**  | **account not active**                                                    | `400`              | Your account is not in the `active` state.                                                                                                                              |
| **10003**  | **authorization rejected**                                                | `400`              | The order belongs to another account.                                                                                                                                   |
| **10003**  | **user\_mismatch**                                                        | `400`              | The resting order belongs to another account.                                                                                                                           |
| **10003**  | **unsupported time in force**                                             | `400`              | Only `GTC` is accepted.                                                                                                                                                 |
| **10003**  | **invalid quantity**                                                      | `400`              | The quantity is not a positive whole number of contracts.                                                                                                               |
| **10003**  | **quantity\_below\_filled**                                               | `400`              | The new quantity is below what has already filled.                                                                                                                      |
| **10003**  | **invalid price**                                                         | `400`              | The limit price is not positive.                                                                                                                                        |
| **10003**  | **price exceeds tick size (max 2 decimal places)**                        | `400`              | The price has more than two decimal places.                                                                                                                             |
| **10003**  | **minimum contract value is \$10**                                        | `400`              | Price times quantity is below the minimum. Reduce-only orders are exempt.                                                                                               |
| **10003**  | **post-only requires limit order**                                        | `400`              | `postOnly` was set on a market order.                                                                                                                                   |
| **10003**  | **max open orders reached**                                               | `400`              | The replacement order would exceed the [per-contract open-orders cap](/latest/options/guides/rate-limits#maximum-open-orders-per-contract).                             |
| **10003**  | **self trade not allowed**                                                | `400`              | The modified order would match one of your own resting orders.                                                                                                          |
| **10003**  | **post\_only\_would\_cross**                                              | `400`              | The modified `postOnly` price would take liquidity.                                                                                                                     |
| **10003**  | **reduce-only order would increase position**                             | `400`              | The modified `reduceOnly` order exceeds what your position can close, or there is no position.                                                                          |
| **10003**  | **insufficient margin**                                                   | `400`              | Available balance does not cover the modified order's initial margin and fee.                                                                                           |
| **10003**  | **margin ratio exceeded**                                                 | `400`              | Your short exposure already uses too much of your collateral for the modified order to fit.                                                                             |
| **10003**  | **mark price unavailable for open position**                              | `400`              | An open position has no mark price, so margin cannot be computed. Retry shortly.                                                                                        |
| **10003**  | **too\_many\_inflight\_orders**                                           | `400`              | Your account has too many orders [waiting for the engine](/latest/options/guides/rate-limits#in-flight-and-timing-limits). Wait for their outcomes before resubmitting. |
| **10003**  | **engine\_overloaded**                                                    | `400`              | The engine is shedding load across all accounts. Back off and retry.                                                                                                    |
| **10003**  | **engine\_timeout**                                                       | `400`              | The modify waited past its deadline for a busy contract. The original order is unchanged.                                                                               |
| **10003**  | **balance\_version\_conflict**                                            | `400`              | Your balance changed while the modify was being committed, and retries ran out.                                                                                         |
| **10003**  | **persist\_failed**                                                       | `400`              | The order store rejected the write. The original order is unchanged.                                                                                                    |
| **10003**  | **delta\_failed**                                                         | `400`              | The order book update could not be published. The original order is unchanged.                                                                                          |
| **10003**  | **idempotency\_error**                                                    | `400`              | The duplicate-request check failed.                                                                                                                                     |
| **10003**  | **internal\_error**, **internal error**, **validation failed**, **panic** | `400`              | An internal failure while validating or processing the modify. Verify before resubmitting.                                                                              |
| **10004**  | **order\_not\_found**                                                     | `404`              | No such order for your account: never accepted, or already filled or cancelled.                                                                                         |
| **10005**  | **receive\_window\_exceeded**                                             | `400`              | The request waited more than one second between queueing and engine pickup. The original order is unchanged.                                                            |
| **10006**  | **rate\_limited**                                                         | `400`              | The [modification budget](/latest/options/guides/rate-limits#account-level-rate-limit), or the reduce-only one for a resting `reduceOnly` order, is spent.              |

## cancelAllOrders

A refused sweep cancels nothing. The cancels a sweep expands into report as `cancelOrder` with the codes above; an order that fills before its cancel reports `order_not_found`.

| Error Code | Error Slug                      | Server Status Code | Meaning                                                                                                                                             |
| ---------- | ------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **10005**  | **receive\_window\_exceeded**   | `400`              | The request waited more than one second between queueing and engine pickup.                                                                         |
| **10006**  | **rate\_limited**               | `400`              | The [cancel-all budget](/latest/options/guides/rate-limits#account-level-rate-limit) is spent.                                                      |
| **10007**  | **too\_many\_inflight\_orders** | `400`              | The engine's [lane of in-flight sweeps](/latest/options/guides/rate-limits#in-flight-and-timing-limits) is full. Wait for earlier sweeps to finish. |
