> ## 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.

# Cancel Order

> This request type allows users to cancel orders through Pacifica's websocket API.

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

### Request

```json theme={null}
{
  "id": "1bb2b72f-f545-4938-8a38-c5cda8823675",
  "params": {
    "cancel_order": {
      "account": "AwX6321...",
      "signature": "4RqbgB...",
      "timestamp": 1749223343149,
      "expiry_window": 5000,
      "symbol": "BTC",
      "client_order_id": "79f948fd-7556-4066-a128-083f3ea49322"
    }
  }
}
```

<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>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\_order"</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>"symbol"</code></td><td>string</td><td>required</td><td>Trading pair symbol</td><td><code>BTC</code></td></tr><tr><td><code>"order\_id"</code></td><td>integer</td><td>required (if no CLOID)</td><td>Exchange-assigned order ID</td><td><code>123</code></td></tr><tr><td><code>"client\_order\_id"</code></td><td>Full UUID string</td><td>required (if no OID)</td><td>Client-defined order ID</td><td><code>f47ac10b-58cc-4372-a567-0e02b2c3d479</code></td></tr></tbody></table>

### Response

```json theme={null}
{
  "code": 200,
  "data": {
    "I": "79f948fd-7556-4066-a128-083f3ea49322",
    "i": null,
    "s": "BTC"
  },
  "id": "1bb2b72f-f545-4938-8a38-c5cda8823675",
  "t": 1749223343610,
  "type": "cancel_order",
  "rl": {
    "r": 9995,
    "q": 10000,
    "t": 1000
  }
}
```

| 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         | Same as above request ID                                                                   |
| `'t'`    | integer        | Timestamp in milliseconds                                                                  |
| `'type'` | string         | Specifies action type                                                                      |
| `'rl'`   | object or null | Rate-limit info, always present: `r` = credits remaining, `q` = quota, `t` = reset-in (ms) |

On error, the frame omits `data` and instead carries an `err` (string) field describing the failure, alongside the same `id`, `type`, `code`, `t`, and `rl` fields.

Cancels are not subject to any speedbump.
