> For the complete documentation index, see [llms.txt](https://pacifica.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/create-limit-order.md).

# Create limit order

This request type allows users to place limit orders through Pacifica's websocket API.

The [Pacifica Python SDK](https://github.com/pacifica-fi/python-sdk/blob/f2385d42e9ae5276ba2ba85505d51db2eefd2715/ws/create_order.py) provides a comprehensive example on using this endpoint.

### Request

```json
{
  "id": "660065de-8f32-46ad-ba1e-83c93d3e3966",
  "params": {
    "create_order": {
      "account": "AwX6321...",
      "signature": "5vnYpt...",
      "timestamp": 1749223025396,
      "expiry_window": 5000,
      "symbol": "BTC",
      "price": "100000.00",
      "reduce_only": false,
      "amount": "0.001",
      "side": "bid",
      "tif": "GTC",
      "client_order_id": "79f948fd-7556-4066-a128-083f3ea49322",
      "builder_code": "MYCODE"
    }
  }
}
```

<table><thead><tr><th width="188">Field</th><th width="98">Type</th><th width="95">Need</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>"id"</code></td><td>Full UUID string</td><td>required</td><td>Client-defined request ID</td><td><code>660065de-8f32-46ad-ba1e-83c93d3e3966</code></td></tr><tr><td><code>"params"</code></td><td>object</td><td>required</td><td>Contains action type and action parameters</td><td><code>"create_order"</code></td></tr><tr><td><code>"create_order"</code></td><td>object</td><td>required</td><td>Specifies action type and contains parameters</td><td>See examples.</td></tr><tr><td><code>"account"</code></td><td>string</td><td>required</td><td>User's wallet address</td><td><code>42trU9A5...</code></td></tr><tr><td><code>"agent_wallet"</code></td><td>string</td><td>optional</td><td>Agent wallet address</td><td><code>69trU9A5...</code></td></tr><tr><td><code>"signature"</code></td><td>string</td><td>required</td><td>Cryptographic signature</td><td><code>5j1Vy9Uq...</code></td></tr><tr><td><code>"timestamp"</code></td><td>integer</td><td>required</td><td>Current timestamp in milliseconds</td><td><code>1716200000000</code></td></tr><tr><td><code>"expiry_window"</code></td><td>integer</td><td>optional</td><td>Signature expiry in milliseconds</td><td><code>30000</code></td></tr><tr><td><code>"symbol"</code></td><td>string</td><td>required</td><td>Trading pair symbol</td><td><code>BTC</code></td></tr><tr><td><code>"price"</code></td><td>string</td><td>required</td><td>Order price</td><td><code>50000</code></td></tr><tr><td><code>"reduce_only"</code></td><td>boolean</td><td>required</td><td>Whether the order is reduce-only</td><td><code>false</code></td></tr><tr><td><code>"amount"</code></td><td>string</td><td>required</td><td>Order amount</td><td><code>0.1</code></td></tr><tr><td><code>"side"</code></td><td>string</td><td>required</td><td>Order side (bid/ask)</td><td><code>bid</code></td></tr><tr><td><code>"tif"</code></td><td>string</td><td>required</td><td>Time in force (<code>GTC</code>, <code>IOC</code>, <code>ALO</code>, <code>TOB</code>)</td><td><code>GTC</code></td></tr><tr><td><code>"client_order_id"</code></td><td>Full UUID string</td><td>optional</td><td>Client-defined order ID</td><td><code>f47ac10b-58cc-4372-a567-0e02b2c3d479</code></td></tr><tr><td><code>"builder_code"</code></td><td>string</td><td>optional</td><td>Builder program code (3-16 alphanumeric)</td><td><code>MYCODE</code></td></tr><tr><td><code>"take_profit"</code></td><td>object</td><td>optional</td><td>Take profit stop order configuration</td><td>See next three rows</td></tr><tr><td><code>"stop_price"</code></td><td>string</td><td>required (if <code>"take_profit"</code> exists)</td><td>Stop trigger price</td><td><code>55000</code></td></tr><tr><td><code>"limit_price"</code></td><td>string</td><td>optional</td><td>Limit price for the triggered order</td><td><code>54950</code></td></tr><tr><td><code>"client_order_id"</code></td><td>string</td><td>Full UUID string</td><td>Client-defined order ID for the stop order</td><td><code>e36ac10b-58cc-4372-a567-0e02b2c3d479</code></td></tr><tr><td><code>"trigger_price_type"</code></td><td>string</td><td>optional</td><td>Price type to trigger stop. Options: <code>mark_price</code> (default), <code>last_trade_price</code>, <code>mid_price</code></td><td><code>mark_price</code></td></tr><tr><td><code>"stop_loss"</code></td><td>object</td><td>optional</td><td>Stop loss order configuration</td><td>See next three rows</td></tr><tr><td><code>"stop_price"</code></td><td>string</td><td>required (if <code>"stop_loss"</code> exists)</td><td>Stop trigger price</td><td><code>48000</code></td></tr><tr><td><code>"limit_price"</code></td><td>string</td><td>optional</td><td>Limit price for the triggered order</td><td><code>47950</code></td></tr><tr><td><code>"client_order_id"</code></td><td>string</td><td>Full UUID string</td><td>Client-defined order ID for the stop order</td><td><code>d25ac10b-58cc-4372-a567-0e02b2c3d479</code></td></tr><tr><td><code>"trigger_price_type"</code></td><td>string</td><td>optional</td><td>Price type to trigger stop. Options: <code>mark_price</code> (default), <code>last_trade_price</code>, <code>mid_price</code></td><td><code>mark_price</code></td></tr></tbody></table>

### Response

```json
{
  "code": 200,
  "data": {
    "I": "79f948fd-7556-4066-a128-083f3ea49322",
    "i": 645953,
    "s": "BTC"
  },
  "id": "660065de-8f32-46ad-ba1e-83c93d3e3966",
  "t": 1749223025962,
  "type": "create_order"
}
```

| Field    | Type    | Description                             |
| -------- | ------- | --------------------------------------- |
| `'code'` | integer | Status code                             |
| `'data'` | object  | Contains information about placed order |
| `'I'`    | string  | CLOID (if provided)                     |
| `'i'`    | integer | Order ID                                |
| `'s'`    | string  | Symbol                                  |
| `'id'`   | string  | Client-defined request ID               |
| `'t'`    | integer | Timestamp in milliseconds               |
| `'type'` | string  | Specifies action type                   |

Note: In order to protect liquidity providers from adverse selection, all TIF GTC, and TIF IOC orders are subject to a \~200ms delay.
