# Orders

{% hint style="info" %}
sFOX recommends using our [WebSocket API](/websocket-api/orders-and-account-data.md) to receive order and/or trade updates where you can stream real-time order and/or trade updates and will avoid rate limits.
{% endhint %}

### Order Types & Algorithms

sFOX offers a wide range of order types and execution algorithms to optimize your order execution. Short descriptions are available in the page linked below. Further details can be found in the [sFOX Support Center](https://support.sfox.com/product-guides/trading/order-types). Or contact support to speak with an expert.&#x20;

{% content-ref url="/pages/-MksB3OWKUp0-RnwDoxN" %}
[Order Types](/rest-api/orders/algorithms-and-routing-types.md)
{% endcontent-ref %}

### Order Statuses

Orders may have any of the following statuses.

<table><thead><tr><th width="154">Status</th><th width="127" align="center">Status Code</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>Started</code></strong></td><td align="center"><strong><code>100</code></strong></td><td><ul><li>The order is open and active</li><li>Filled quantity may be >= 0</li><li>Filled quantity is &#x3C; the order quantity</li></ul></td></tr><tr><td><strong><code>Cancel Pending</code></strong></td><td align="center"><strong><code>90</code></strong></td><td><ul><li>The order is in the process of being canceled but cancelation has not been confirmed</li><li>The order may still receive fills</li></ul></td></tr><tr><td><strong><code>Canceled</code></strong></td><td align="center"><strong><code>10</code></strong></td><td><ul><li>The order was successfully canceled</li><li><strong>Order may have been partially filled prior to cancelation</strong></li></ul></td></tr><tr><td><strong><code>Done</code></strong></td><td align="center"><strong><code>300</code></strong></td><td><ul><li>The order was completed and is no longer active</li><li>Filled quantity = order quantity</li><li>The order will not receive new fills</li></ul></td></tr></tbody></table>

### Order Object

Order updates received or retrieved via the sFOX APIs will include the following object per order:

<table data-full-width="false"><thead><tr><th width="224">Field</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>id</code></strong></td><td>int</td><td>sFOX-generated order ID, assigned on order creation.</td></tr><tr><td><strong><code>side_id</code></strong></td><td>int</td><td>ID for the order side/action. Possible values: <code>500</code> (buy order), <code>600</code> (sell order).</td></tr><tr><td><strong><code>action</code></strong></td><td>string</td><td>Order side. Possible values: <code>buy</code> (buy order), <code>sell</code> (sell order)</td></tr><tr><td><strong><code>algorithm_id</code></strong></td><td>int</td><td>Order type / algorithm ID. Possible values: <a href="/pages/-MksB3OWKUp0-RnwDoxN">Order Types &#x26; Algorithms</a>.</td></tr><tr><td><strong><code>algorithm</code></strong></td><td>string</td><td>Order type / algorithm name. Possible values: <a href="/pages/-MksB3OWKUp0-RnwDoxN">Order Types &#x26; Algorithms</a>.</td></tr><tr><td><strong><code>type</code></strong></td><td>string</td><td>Order type / algorithm name. Possible values: <a href="/pages/-MksB3OWKUp0-RnwDoxN">Order Types &#x26; Algorithms</a>.</td></tr><tr><td><strong><code>pair</code></strong></td><td>string</td><td>Pair or product in the format <code>basequote</code> . e.g. <code>btcusd</code>, <code>ethbtc</code>, <code>ethusdc</code></td></tr><tr><td><strong><code>quantity</code></strong></td><td>number</td><td>Order size in base currency quantity.</td></tr><tr><td><strong><code>price</code></strong></td><td>number</td><td>Order limit price.</td></tr><tr><td><strong><code>amount</code></strong></td><td>number</td><td>Amount (quote currency) to spend when buying.</td></tr><tr><td><strong><code>net_market_amount</code></strong></td><td>number</td><td><code>amount</code> net fees for Market (<code>100</code>) orders.</td></tr><tr><td><strong><code>filled</code></strong></td><td>number</td><td>Unsigned, cumulative base currency quantity filled.</td></tr><tr><td><strong><code>vwap</code></strong></td><td>number</td><td>Cumulative volume-weighted average fill price of the order.</td></tr><tr><td><strong><code>filled_amount</code></strong></td><td>number</td><td>Unsigned, cumulative quote currency amount filled.</td></tr><tr><td><strong><code>fees</code></strong></td><td>number</td><td>Unsigned, cumulative quote currency fee amount accrued to this order.</td></tr><tr><td><strong><code>net_proceeds</code></strong></td><td>number</td><td>Signed, cumulative quote currency proceeds amount net fees.</td></tr><tr><td><strong><code>status</code></strong></td><td>string</td><td>Status name. Possible values: <a href="#order-statuses">Order Statuses</a>.</td></tr><tr><td><strong><code>status_code</code></strong></td><td>int</td><td>Status ID. Possible values: <a href="#order-statuses">Order Statuses</a>.</td></tr><tr><td><strong><code>routing_option</code></strong></td><td>string</td><td>Special order routing instructions. </td></tr><tr><td><strong><code>routing_type</code></strong></td><td>string</td><td>Order routing type.</td></tr><tr><td><strong><code>time_in_force</code></strong></td><td>string</td><td>Order time in force specified at order creation.</td></tr><tr><td><strong><code>expires</code></strong></td><td>datetime</td><td>Expiration date of the order (for <code>time_in_force</code> = <code>GTD</code> orders)</td></tr><tr><td><strong><code>dateupdated</code></strong></td><td>datetime</td><td>Date of the most recent update to this order.</td></tr><tr><td><strong><code>date_added</code></strong></td><td>datetime</td><td>Date the order was created.</td></tr><tr><td><strong><code>client_order_id</code></strong></td><td>string</td><td>User-specified ID for this order.</td></tr><tr><td><strong><code>user_tx_id</code></strong></td><td>string</td><td>Same as above.</td></tr><tr><td><strong><code>o_action</code></strong></td><td>string</td><td>Order side. Possible values: <code>Buy</code> (buy order), <code>Sell</code> (sell order)</td></tr><tr><td><strong><code>algo_id</code></strong></td><td>int</td><td>Order type / algorithm ID. Possible values: <a href="/pages/-MksB3OWKUp0-RnwDoxN">Order Types &#x26; Algorithms</a>.</td></tr><tr><td><strong><code>algorithm_options</code></strong></td><td>string[]</td><td>Additional object specifying special order parameters.</td></tr><tr><td><strong><code>destination</code></strong></td><td>string</td><td>Order destination.</td></tr></tbody></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.sfox.com/rest-api/orders.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.
