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

# Create Stop Order

> This endpoint allows users to create stop order.

```http theme={null}
POST /api/v1/orders/stop/create
```

#### Operation Type (for Signing)

| Header Field | Type | Content |
| - | - | - |
| `"type"` | string | `"create_stop_order"` |

#### Request Body

<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>`"account"`</td><td>string</td><td>required</td><td>User's wallet address</td><td>`42trU9A5...`</td></tr><tr><td>`"signature"`</td><td>string</td><td>required</td><td>Cryptographic signature</td><td>`5j1Vy9Uq...`</td></tr><tr><td>`"timestamp"`</td><td>integer</td><td>required</td><td>Current timestamp in milliseconds</td><td>`1716200000000`</td></tr><tr><td>`"symbol"`</td><td>string</td><td>required</td><td>Trading pair symbol</td><td>`BTC`</td></tr><tr><td>`"side"`</td><td>string</td><td>required</td><td>Order side (bid/ask)</td><td>`bid`</td></tr><tr><td>`"reduce_only"`</td><td>boolean</td><td>required</td><td>Whether the order is reduce-only</td><td>`false`</td></tr><tr><td>`"stop_order"`</td><td>object</td><td>required</td><td>Stop order configuration</td><td>See next five rows</td></tr><tr><td>`"stop_price"`</td><td>string</td><td>required</td><td>Stop trigger price</td><td>`48000`</td></tr><tr><td>`"limit_price"`</td><td>string</td><td>optional</td><td>Limit price for the triggered order</td><td>`47950`</td></tr><tr><td>`"client_order_id"`</td><td>Full UUID string</td><td>optional</td><td>Client-defined order ID for the stop order</td><td>`d25ac10b-58cc-4372-a567-0e02b2c3d479`</td></tr><tr><td>`"trigger_price_type"`</td><td>string</td><td>optional</td><td>Price type used to trigger the stop order. Defaults to `last_trade_price`. Options: `mark_price`, `last_trade_price`, `mid_price`</td><td>`mark_price`</td></tr><tr><td>`"amount"`</td><td>string</td><td>optional</td><td>Order amount (inside `stop_order`). If omitted, the full position size is used</td><td>`0.1`</td></tr><tr><td>`"agent_wallet"`</td><td>string</td><td>optional</td><td>Agent wallet address</td><td>`69trU9A5...`</td></tr><tr><td>`"expiry_window"`</td><td>integer</td><td>optional</td><td>Signature expiry in milliseconds</td><td>`30000`</td></tr><tr><td>`"builder_code"`</td><td>string</td><td>optional</td><td>Builder program code (3-16 alphanumeric characters)</td><td>`MYCODE`</td></tr></tbody></table>

```json theme={null}
{
  "account": "42trU9A5...",
  "signature": "5j1Vy9Uq...",
  "timestamp": 1716200000000,
  "symbol": "BTC",
  "side": "bid",
  "reduce_only": true,
  "stop_order": {
    "stop_price": "48000",
    "limit_price": "47950",
    "client_order_id": "d25ac10b-58cc-4372-a567-0e02b2c3d479",
    "trigger_price_type": "mark_price",
    "amount": "0.1"
  },
  "agent_wallet": "69trU9A5...",
  "expiry_window": 30000,
  "builder_code": "MYCODE"
}
```

#### Response

* Status 200: Stop order created successfully

```json theme={null}
  {
    "order_id": 12345
  }
```

* Status 400: Bad request

```json theme={null}
  {
    "error": "Invalid stop order parameters",
    "code": 400
  }
```

* Status 500: Internal server error

#### Code Example (Python)

```python theme={null}
import requests

payload = {
    "account": "42trU9A5...",
    "signature": "5j1Vy9Uq...",
    "timestamp": 1716200000000,
    "symbol": "BTC",
    "side": "bid",
    "reduce_only": True,
    "stop_order": {
        "stop_price": "48000",
        "limit_price": "47950",
        "amount": "0.1"
    }
}

response = requests.post(
    "/api/v1/orders/stop/create",
    json=payload,
    headers={"Content-Type": "application/json"}
)

data = response.json()
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.