# Cancel all orders

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

### Request

```json
{
  "id": "4e9b4edb-b123-4759-9250-d19db61fabcb",
  "params": {
    "cancel_all_orders": {
      "account": "AwX6f3...",
      "signature": "2XP8fz...",
      "timestamp": 1749221927343,
      "expiry_window": 5000,
      "all_symbols": true,
      "exclude_reduce_only": false
    }
  }
}
```

<table><thead><tr><th width="184">Field</th><th width="98">Type</th><th width="123">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>1bb2b72f-f545-4938-8a38-c5cda8823675</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>"cancel_all_orders"</code></td></tr><tr><td><code>"cancel_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>"all_symbols"</code></td><td>boolean</td><td>required</td><td>Whether to cancel orders for all symbols</td><td><code>true</code></td></tr><tr><td><code>"exclude_reduce_only"</code></td><td>boolean</td><td>required</td><td>Whether to exclude reduce-only orders</td><td><code>false</code></td></tr><tr><td><code>"symbol"</code></td><td>string</td><td>required<br>(if <code>"all_symbols"</code> is false)</td><td>Trading pair symbol</td><td><code>BTC</code></td></tr></tbody></table>

```json
{
  "code": 200,
  "data": {
    "cancelled_count": 10
  },
  "id": "b86b4f45-49da-4191-84e2-93e141acdeab",
  "t": 1749221787291,
  "type": "cancel_all_orders"
}
```

| Field               | Type    | Description                             |
| ------------------- | ------- | --------------------------------------- |
| `'code'`            | integer | Status code                             |
| `'data'`            | object  | Contains information about placed order |
| `'cancelled_count'` | string  | Number of orders successfully cancelled |
| `'id'`              | string  | Same as above request ID                |
| `'t'`               | integer | Timestamp in milliseconds               |
| `'type'`            | string  | Specifies action type                   |


---

# Agent Instructions: 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:

```
GET https://pacifica.gitbook.io/docs/api-documentation/api/websocket/trading-operations/cancel-all-orders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
