> ## 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.

# Order Lifecycle

> Order types, flags, and the lifecycle of an order

Orders are placed over the
[Order Creation Stream](/latest/options/websocket-api/order-creation-stream/overview).

## Order Types

| Trade type | Behavior                                                              |
| ---------- | --------------------------------------------------------------------- |
| `limit`    | Executes only at the specified price or better; may rest on the book. |
| `market`   | Executes immediately against the best available prices.               |

<Note>
  Only limit and market orders are supported — there are no trigger (stop-loss /
  take-profit) orders, and leverage and margin-mode updates do not apply. Attempting these is
  rejected.
</Note>

## Order Flags

| Flag          | Type    | Description                                                                                             |
| ------------- | ------- | ------------------------------------------------------------------------------------------------------- |
| `postOnly`    | boolean | Maker-only. The order is rejected if it would match immediately. Limit orders only.                     |
| `reduceOnly`  | boolean | The order may only reduce or close an existing position, never open or increase one. Used when closing. |
| `maxSlippage` | string  | Market orders only — caps how far the fill price may deviate from the expected price.                   |

## Lifecycle

A successful order moves through the following states. You can correlate every message
for one order using its `clientRequestId`.

<Steps>
  <Step title="Create">
    Submit a [Create Order](/latest/options/websocket-api/order-creation-stream/create-order)
    request. You receive an **acknowledgment** that the request was received and validated.
  </Step>

  <Step title="Accept">
    The matching engine accepts the order and it becomes active on the book (for a limit
    order) — confirmed by a follow-up response.
  </Step>

  <Step title="Fill">
    As the order matches, you receive
    [Order Filled Notifications](/latest/options/websocket-api/order-creation-stream/order-filled-notifications)
    (partial and complete), and your
    [positions](/latest/options/websocket-api/positions-stream) and
    [account summary](/latest/options/websocket-api/account-summary-stream) update.
  </Step>

  <Step title="Modify or cancel">
    Adjust an open order with
    [Modify Order](/latest/options/websocket-api/order-creation-stream/modify-order) or
    remove it with
    [Cancel Order](/latest/options/websocket-api/order-creation-stream/cancel-order-by-id).
  </Step>
</Steps>

## Order Statuses

| Status      | Meaning                                                       |
| ----------- | ------------------------------------------------------------- |
| `pending`   | Request received, awaiting acceptance by the matching engine. |
| `open`      | Live on the order book (limit orders).                        |
| `completed` | Fully filled, or a market order finished executing.           |
| `cancelled` | Cancelled — by you, an admin, or the system.                  |
| `rejected`  | Rejected — see the accompanying error.                        |

## Tracking Orders

Track open orders on the [Open Orders Stream](/latest/options/websocket-api/open-orders-stream)
and order history on the [Recent Orders Stream](/latest/options/websocket-api/recent-orders-stream)
(or via [Get Orders](/latest/options/rest-api/get-account-orders)).

If a request times out or you miss an acknowledgment, verify the outcome before retrying.
See [FAQs](/latest/options/guides/faqs) for safe-retry guidance and
[Rate Limits](/latest/options/guides/rate-limits) for how to back off when throttled.
