> 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/trading/create-order.md).

# POST /orders

Submit an order.

`operationId`: `createOrder` · CCXT method: `createOrder` · Rate-limit class: `trading`

**Authentication:** `hmacAuth`.

## Request body

**Required.** [`OrderRequest`](/api-reference/guides/schemas.md#orderrequest) — `application/json`.

## Responses

| Status | Body                                                              | Meaning                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200`  | [`OrderResponse`](/api-reference/guides/schemas.md#orderresponse) | Idempotent replay: this `client_id` was already accepted, and the body is the order that first request created. Nothing was placed by this request, so branch on the status rather than assuming `201`. `fills` is empty here even if the original order has since traded; read its current state from `GET /orders/{order_id}`. **Reachable only while the original order is still resting.** The replay answers from the live book, so a fully-filled, cancelled or expired original, and any market/IOC/FOK order that never rested, is answered `409` instead. The duplicate is prevented either way; what differs is whether the original can be handed back inline.                                                                                                                                                                                                                                                                   |
| `201`  | [`OrderResponse`](/api-reference/guides/schemas.md#orderresponse) | Order accepted                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `400`  | — *(no schema declared)*                                          | Validation error (insufficient margin, invalid tick size, etc.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `401`  | — *(no schema declared)*                                          | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `403`  | — *(no schema declared)*                                          | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `409`  | — *(no schema declared)*                                          | This `client_id` is already claimed, and the order it created is not currently resting, so it cannot be returned inline (`code: DuplicateClientId`). **This is the expected answer whenever the original is no longer on the book**, not a rare edge: a filled, cancelled or expired order, and anything that never rested, all land here. The message names the order's id; find it in `GET /orders/history`, which retains terminal orders. Do not retry with the same key, since the outcome will not change, and do not re-submit under a new key without first establishing what the original order did. A `409` also covers the market-lifecycle admission gate, distinguished from the case above by `code`: `MarketHalted` when the market is halted, `MarketReduceOnly` when the market is in reduce-only and the order is neither `reduce_only` nor a liquidation, and `MarketSuspended` when the market is settling or delisted. |
| `429`  | — *(no schema declared)*                                          | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

## Example

```bash
curl -X POST 'https://exchange.nexus.xyz/api/exchange/orders' \
  -H 'X-API-Key: nx_7f3a1b...' \
  -H 'X-Timestamp: 1776033911836' \
  -H 'X-Signature: <hmac-sha256>' \
  -H 'Content-Type: application/json'
```

***

<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/trading/create-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.
