> For the complete documentation index, see [llms.txt](https://docs.sfox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sfox.com/rest-api/orders/get-single-order.md).

# Get Single Order

<mark style="color:green;">**`GET`**</mark> `https://api.sfox.com/v1/orders/:order_id`

Retrieve the details of a single order.

{% hint style="info" %}
sFOX recommends using the [**Orders WebSocket feed**](/websocket-api/orders-and-account-data/orders.md) instead, which streams order updates in real-time and does not count towards your request limit.
{% endhint %}

### **Path Parameters**

<table><thead><tr><th width="240">Parameter</th><th width="92">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>order_id</code></strong> <mark style="color:red;">required</mark></td><td>string</td><td><code>order_id</code> is either the order ID generated by sFOX upon order creation (<code>id</code>) or the client-assigned <code>client_order_id</code>.</td></tr></tbody></table>

### Order Statuses

<table><thead><tr><th width="151">Status</th><th width="128">Status Code</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>Started</code></strong></td><td><code>100</code></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><code>90</code></td><td><ul><li>The order is in the process of being canceled but cancelation has not been completed</li><li>The order may still receive fills</li></ul></td></tr><tr><td><strong><code>Canceled</code></strong></td><td><code>10</code></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><code>300</code></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>

### Responses

<details>

<summary><mark style="color:green;">200</mark></summary>

```json
{
    "id": 2010135,
    "side_id": 500,
    "action": "Buy",
    "algorithm_id": 201,
    "algorithm": "Limit",
    "type": "Limit",
    "pair": "btcusd",
    "quantity": 0.1,
    "price": 36431,
    "amount": 0,
    "net_market_amount": 0,
    "filled": 0,
    "vwap": 0,
    "filled_amount": 0,
    "fees": 0,
    "net_proceeds": 0,
    "status": "Started",
    "status_code": 100,
    "routing_option": "WeightedExchange",
    "routing_type": "NetPrice",
    "time_in_force": "GTC",
    "expires": null,
    "dateupdated": "2023-11-17T20:52:40.000Z",
    "date_added": "2023-11-17T20:52:40.000Z",
    "client_order_id": "ea5c8afc-419a-447d-8188-659dce1a782a",
    "user_tx_id": "ea5c8afc-419a-447d-8188-659dce1a782a",
    "o_action": "Buy",
    "algo_id": 201,
    "algorithm_options": null,
    "destination": ""
}
```

</details>

<details>

<summary><mark style="color:red;">401</mark>: Unauthorized</summary>

```json
//Invalid API key or insufficient user permissions
{
    "error": "user lookup failed"
}
```

</details>

<details>

<summary><mark style="color:red;">404</mark>: Not Found</summary>

```json
//The order_id specified in the request is invalid or does not exist
{
    "error": "the requested order was not found",
    "error_code": "ORDER_NOT_FOUND"
}
```

</details>

### Example Requests

{% tabs %}
{% tab title="Shell" %}

```bash
curl -H 'Authorization: Bearer <API_TOKEN>' \
  'https://api.sfox.com/v1/orders/<ORDER_ID>'
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const axios = require('axios');

axios({
  method: 'get',
  url: 'https://api.sfox.com/v1/orders/<ORDER_ID>',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

data = requests.get(
  "https://api.sfox.com/v1/orders/<ORDER_ID>",
  headers={
    "Authorization": "Bearer <API_KEY>",
  }
)
print(data)
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.sfox.com/rest-api/orders/get-single-order.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
