> ## Documentation Index
> Fetch the complete documentation index at: https://docs-polymarket-us.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Orders API Overview

> Create, cancel, and manage orders

# Orders API

The Orders API provides order entry and management capabilities for trading on markets.

## Endpoints

### Order Entry

| Method | Endpoint            | Description                     |
| ------ | ------------------- | ------------------------------- |
| `POST` | `/v1/orders`        | Create a new order              |
| `POST` | `/v1/order/preview` | Preview order before submission |

### Order Query

| Method | Endpoint              | Description                |
| ------ | --------------------- | -------------------------- |
| `GET`  | `/v1/orders/open`     | Get all open orders        |
| `GET`  | `/v1/order/{orderId}` | Get a specific order by ID |

### Order Cancellation

| Method | Endpoint                     | Description             |
| ------ | ---------------------------- | ----------------------- |
| `POST` | `/v1/order/{orderId}/cancel` | Cancel a specific order |
| `POST` | `/v1/orders/open/cancel`     | Cancel all open orders  |

## Order Types

| Value | Type   | Description                                   |
| ----- | ------ | --------------------------------------------- |
| 1     | LIMIT  | Limit order at specified price                |
| 2     | MARKET | Market order executed at best available price |

## Order Intent

Orders require an intent indicating position direction:

| Value | Intent    | Description                                  |
| ----- | --------- | -------------------------------------------- |
| 1     | BUY\_YES  | Buy Yes contracts (go long on Yes)           |
| 2     | SELL\_YES | Sell Yes contracts (close long Yes position) |
| 3     | BUY\_NO   | Buy No contracts (go long on No)             |
| 4     | SELL\_NO  | Sell No contracts (close long No position)   |

## Order States

Orders progress through these states:

```
PENDING_NEW → PARTIALLY_FILLED → FILLED
                    ↓
                CANCELED / REJECTED / EXPIRED
```

| Value | State             | Description                       |
| ----- | ----------------- | --------------------------------- |
| 7     | PENDING\_NEW      | Order received, not yet processed |
| 1     | PARTIALLY\_FILLED | Order partially executed          |
| 2     | FILLED            | Order fully executed              |
| 3     | CANCELED          | Order canceled by user            |
| 5     | REJECTED          | Order rejected by exchange        |
| 6     | EXPIRED           | Order expired (GTD orders)        |

## Time in Force

| Value | TIF | Description               |
| ----- | --- | ------------------------- |
| 1     | GTC | Good till canceled        |
| 2     | GTD | Good till specified date  |
| 3     | IOC | Immediate or cancel       |
| 4     | FOK | Fill completely or cancel |

<Tip>
  **Real-Time Order Updates**

  After submitting orders via REST, use the [WebSocket Private Stream](/api-reference/websocket/private) to receive real-time updates on order status, fills, and cancellations.
</Tip>

## Best Practices

1. **Use WebSocket for updates** - Subscribe to order updates instead of polling
2. **Preview before submit** - Use the preview endpoint for order validation
3. **Handle rejects** - Implement proper error handling for rejected orders
4. **Use synchronous execution** - Set `synchronous_execution: true` to wait for order acknowledgment
