# Order Object

The full Order shape returned by `GET /v1/trade/orders`, `GET /v1/trade/orders/history`, and pushed (with shortened field names) on the WebSocket `order` channel.

| Field                 | Type              | Meaning                                                                                  |
| --------------------- | ----------------- | ---------------------------------------------------------------------------------------- |
| `order_id`            | string            | System-generated order ID.                                                               |
| `client_order_id`     | string \| null    | Client-supplied identifier (≤ 36 chars).                                                 |
| `address`             | string            | Order owner address (`0x`-prefixed).                                                     |
| `created_time`        | integer (ms)      | Creation time.                                                                           |
| `updated_time`        | integer (ms)      | Last update time.                                                                        |
| `symbol_id`           | integer           | Trading pair ID.                                                                         |
| `is_buy`              | boolean           | `true` = buy, `false` = sell.                                                            |
| `order_type`          | string            | `market` / `limit`.                                                                      |
| `algo_order_type`     | string \| null    | `conditional` / `tpsl` / `attached_tpsl`.                                                |
| `time_in_force`       | string \| null    | `gtc` / `ioc` / `fok`.                                                                   |
| `quantity`            | string            | Order quantity.                                                                          |
| `price`               | string \| null    | Limit price (null on pure market orders).                                                |
| `price_match`         | string \| null    | Price-matching strategy (`queue_1` / `queue_5` / `counter_party_1` / `counter_party_5`). |
| `position_side`       | string \| null    | `both` / `long` / `short`.                                                               |
| `margin_mode`         | string \| null    | `cross` / `isolated`.                                                                    |
| `market_order_type`   | string            | `base` / `quote`. Perp defaults to `base`; spot is required.                             |
| `stp_mode`            | string \| null    | STP mode.                                                                                |
| `flags`               | string\[] \| null | Order flags (`post_only`, `reduce_only`).                                                |
| `state`               | string            | See **State machine** below.                                                             |
| `cum_filled_quantity` | string            | Cumulative filled quantity.                                                              |
| `cum_filled_amount`   | string            | Cumulative filled notional.                                                              |
| `remaining_quantity`  | string            | Unfilled remainder.                                                                      |
| `original_quantity`   | string            | Initial order quantity.                                                                  |
| `cum_fee`             | string            | Cumulative fee.                                                                          |
| `order_source`        | string \| null    | Order source.                                                                            |
| `conditional`         | object \| null    | Conditional trigger details.                                                             |
| `tpsl`                | object \| null    | TPSL parameters.                                                                         |
| `parent_order_id`     | string \| null    | Parent ID (for conditional / TPSL child orders).                                         |
| `slippage`            | string \| null    | Slippage.                                                                                |
| `tx_hash`             | string            | Creation / last-update transaction hash.                                                 |

## State Machine

| State              | Terminal? | Applies to         | Detail                                           |
| ------------------ | :-------: | ------------------ | ------------------------------------------------ |
| `pending_new`      |     —     | Normal             | Received, awaiting validation.                   |
| `new`              |     —     | Normal             | Validated, sitting on the book.                  |
| `partially_filled` |     —     | Normal             | Partially executed.                              |
| `filled`           |     ✅     | Normal             | Fully filled.                                    |
| `pending_cancel`   |     —     | Normal             | Cancel submitted.                                |
| `canceled`         |     ✅     | All                | Cancelled.                                       |
| `rejected`         |     ✅     | All                | Rejected at validation.                          |
| `inactive`         |     —     | attached\_tpsl     | Parent not yet filled; attached TPSL is dormant. |
| `pending_trigger`  |     —     | conditional / tpsl | Waiting to trigger.                              |
| `triggered`        |     ✅     | conditional / tpsl | Triggered (child order created).                 |

> Status transitions are pushed on the [WebSocket `order` channel](file:///1548985/websocket/user-channels/order.md). The shortened field names there (`i`, `e`, `q`, etc.) map back to this schema — see that page for the lookup table.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lynxtrade.world/reference/order-object.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
