> ## 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` next to its human-readable text in `body`, 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 [Error Reference](/latest/error-reference/error-code) describes the shape per transport and the codes `0001`–`0014` shared by every route; HTTP responses use only those.

Options codes are five digits: `100xx` can answer any order command, `101xx` belongs to `createOrder`, `102xx` to `cancelOrder`, and `103xx` to `modifyOrder`. A condition shared by create and modify takes the same last two digits in both blocks. To send a refused request again, give it a new `clientRequestId`: the gateway answers a reused one with `409` for 60 seconds.

## Any Order Command

| 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 does not exist or is not tradable: expired, retired or disabled. Refresh your contract list. |
| **10003** | **ORDER\_REJECTED** | `400` | A rejection none of the other codes names. `body` carries the reason. |
| **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. Nothing was applied. |
| **10006** | **RATE\_LIMITED** | `400` | The operation's [budget](/latest/options/guides/rate-limits#account-level-rate-limit) is spent. The frame carries no retry hint; back off. |
| **10007** | **TOO\_MANY\_INFLIGHT\_ORDERS** | `400` | Too many requests are [waiting for the engine](/latest/options/guides/rate-limits#in-flight-and-timing-limits): your account's orders, the cancel lane, or the lane of cancel-all sweeps. Wait for their outcomes, then retry. |
| **10008** | **ENGINE\_OVERLOADED** | `400` | The engine is shedding load across all accounts. Back off and retry. |
| **10009** | **ENGINE\_TIMEOUT** | `400` | The request waited past its deadline for a busy contract. Nothing was applied. |
| **10010** | **COMMIT\_FAILED** | `400` | The change could not be saved and was rolled back. Nothing was applied. |
| **10011** | **INTERNAL\_ERROR** | `400` | An internal failure. Its effect is unknown: look the order up before resubmitting. |
| **10012** | **MARK\_PRICE\_UNAVAILABLE** | `400` | An open position has no mark price, so margin cannot be computed. Retry shortly. |

## createOrder

| Error Code | Error Slug | Server Status Code | Meaning |
| - | - | - | - |
| **10101** | **CREATE\_ORDER\_INSUFFICIENT\_BALANCE** | `400` | Available balance does not cover the order's initial margin and fee. |
| **10102** | **CREATE\_ORDER\_MARGIN\_RATIO\_EXCEEDED** | `400` | Your short exposure already uses too much of your collateral for this order to fit. Reduce shorts or add collateral. |
| **10103** | **CREATE\_ORDER\_MAX\_OPEN\_ORDERS** | `400` | The [per-contract open-orders cap](/latest/options/guides/rate-limits#maximum-open-orders-per-contract) is reached. |
| **10104** | **CREATE\_ORDER\_SELF\_TRADE** | `400` | The order would match one of your own resting orders. |
| **10105** | **CREATE\_ORDER\_WOULD\_MATCH** | `400` | A `postOnly` order would have taken liquidity. |
| **10106** | **CREATE\_ORDER\_REDUCE\_ONLY** | `400` | A `reduceOnly` order exceeds what your position can close, or there is no position. |
| **10107** | **CREATE\_ORDER\_MIN\_VALUE** | `400` | Price times quantity is below the \$10 minimum. Reduce-only orders are exempt. |
| **10108** | **CREATE\_ORDER\_DUPLICATE\_ORDER\_ID** | `400` | An order with the same `orderId` already exists. Only an `orderId` you choose on [Create Order](/latest/options/rest-api/create-order) can collide. |

## cancelOrder

| Error Code | Error Slug | Server Status Code | Meaning |
| - | - | - | - |
| **10201** | **CANCEL\_ORDER\_NOT\_OWNED** | `400` | The order belongs to another account. |

## modifyOrder

| Error Code | Error Slug | Server Status Code | Meaning |
| - | - | - | - |
| **10301** | **MODIFY\_ORDER\_INSUFFICIENT\_BALANCE** | `400` | Available balance does not cover the modified order's initial margin and fee. |
| **10302** | **MODIFY\_ORDER\_MARGIN\_RATIO\_EXCEEDED** | `400` | Your short exposure already uses too much of your collateral for the modified order to fit. |
| **10303** | **MODIFY\_ORDER\_MAX\_OPEN\_ORDERS** | `400` | The modified order would exceed the [per-contract open-orders cap](/latest/options/guides/rate-limits#maximum-open-orders-per-contract). |
| **10304** | **MODIFY\_ORDER\_SELF\_TRADE** | `400` | The modified order would match one of your own resting orders. |
| **10305** | **MODIFY\_ORDER\_WOULD\_MATCH** | `400` | The modified `postOnly` price would take liquidity. |
| **10306** | **MODIFY\_ORDER\_REDUCE\_ONLY** | `400` | The modified `reduceOnly` order exceeds what your position can close, or there is no position. |
| **10307** | **MODIFY\_ORDER\_MIN\_VALUE** | `400` | Price times quantity is below the \$10 minimum. Reduce-only orders are exempt. |
| **10308** | **MODIFY\_ORDER\_NOT\_OWNED** | `400` | The resting order belongs to another account. |
| **10309** | **MODIFY\_ORDER\_QUANTITY\_BELOW\_FILLED** | `400` | The new quantity is below what has already filled. |

A refused modify leaves the original order unchanged.

## cancelAllOrders

A sweep is refused only with `10005`, `10006` or `10007`, and 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 `10004`.

## Shared Codes

The order routes also answer with these codes from the [Error Reference](/latest/error-reference/error-code):

| Error Code | Error Slug | Server Status Code | Meaning on the Options order routes |
| - | - | - | - |
| **0006** | **BAD\_REQUEST** | `400` | A field is missing or invalid: no `market`, a quantity that is not a positive whole number, a price that is not positive or is finer than the tick size, `postOnly` on a market order, `maxSlippage` out of range or on a limit order, an unsupported time in force, or a request that does not parse. `body` names the problem. |
| **0014** | **TRADING\_DISABLED** | `400` | Your account is not in the `active` state. |

A snapshot request (`emit*`) that fails answers under its response `resultType` with `0006` for a `pageToken` it cannot read, or `0002` **SERVER\_ERROR** otherwise. A snapshot changes nothing, so sending it again is safe.


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