> For the complete documentation index, see [llms.txt](https://docs.nexus.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexus.xyz/api-reference/account/fetch-order.md).

# GET /orders/{order\_id}

Get order by ID.

`operationId`: `fetchOrder` · CCXT method: `fetchOrder`

**Authentication:** `hmacAuth`.

Resolves any order the account placed: resting orders come from the matching engine's authoritative book state, and recently completed orders (filled, cancelled, rejected, expired) are served from the indexer's terminal-order mirror, so an order that fills instantly can still be fetched by the id its placement returned (ENG-10962). The mirror retains the most recent 500 terminal orders per account — the same window `GET /orders/history` lists — so anything listable is fetchable. Older terminal orders resolve only through `GET /orders/history`.

## Parameters

| Name        | In    | Type     | Required | Description                                       |
| ----------- | ----- | -------- | -------- | ------------------------------------------------- |
| `order_id`  | path  | `string` | Yes      | —                                                 |
| `market_id` | query | `string` | Yes      | Market the order rests on (required for routing). |

## Responses

| Status | Body                                              | Meaning                                                                                                                                                                                                                                                                                                                                           |
| ------ | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200`  | [`Order`](/api-reference/guides/schemas.md#order) | The requested order.                                                                                                                                                                                                                                                                                                                              |
| `401`  | — *(no schema declared)*                          | —                                                                                                                                                                                                                                                                                                                                                 |
| `404`  | — *(no schema declared)*                          | No such order for this account: the id was never placed by this account, or it refers to a terminal order older than the 500-per-account retention window. A 404 is deliberately identical for "never existed" and "not yours" (ownership masking). It no longer means "not currently resting" — recently terminal orders return 200 (ENG-10962). |

## Example

```bash
curl -X GET 'https://exchange.nexus.xyz/api/exchange/orders/{order_id}' \
  -H 'X-API-Key: nx_7f3a1b...' \
  -H 'X-Timestamp: 1776033911836' \
  -H 'X-Signature: <hmac-sha256>'
```

***

<sub>Generated from</sub> <sub></sub><sub>`eng/apps/exchange/api/openapi.json`</sub> <sub></sub><sub>(spec</sub> <sub></sub><sub>`0.9.27`</sub><sub>). Do not edit by hand — regenerate with</sub> <sub></sub><sub>`python3 product/docs/tools/api-reference/generate.py`</sub><sub>. Hand-authored context lives in the Guides pages.</sub>


---

# 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.nexus.xyz/api-reference/account/fetch-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.
