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

# Edit Order

> This request type allows users to modify existing orders (price and/or size) through websocket API in one request.

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 theme={null}
{
  "id": "660065de-8f32-46ad-ba1e-83c93d3e3966",
  "params": {
    "edit_order": {
      "account": "AwX6321...",
      "signature": "5vnYpt...",
      "timestamp": 1749223025396,
      "expiry_window": 5000,
      "symbol": "BTC",
      "price": "99500",
      "amount": "0.002",
      "order_id": 645953
    }
  }
}
```

<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>"edit\_order"</code></td></tr><tr><td><code>"edit\_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>99500</code></td></tr><tr><td><code>"amount"</code></td><td>string</td><td>optional</td><td>Order amount (if omitted, only the price is changed)</td><td><code>0.002</code></td></tr><tr><td><code>"order\_id"</code></td><td>integer</td><td>optional</td><td>System-defined order ID (needed if no CLOID provided)</td><td><code>645953</code></td></tr><tr><td><code>"client\_order\_id"</code></td><td>Full UUID string</td><td>optional</td><td>Client-defined order ID (needed if no OID provided)</td><td><code>f47ac10b-58cc-4372-a567-0e02b2c3d479</code></td></tr></tbody></table>

### Response

```json theme={null}
{
  "code": 200,
  "data": {
    "I": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "i": 645954,
    "s": "BTC"
  },
  "id": "660065de-8f32-46ad-ba1e-83c93d3e3966",
  "t": 1749223026150,
  "type": "edit_order",
  "rl": {
    "r": 9990,
    "q": 10000,
    "t": 1000
  }
}
```

| Field    | Type           | Description                                                                                |
| -------- | -------------- | ------------------------------------------------------------------------------------------ |
| `'code'` | integer        | Status code                                                                                |
| `'data'` | object         | Contains information about placed order                                                    |
| `'I'`    | string         | CLOID (if original order contained one)                                                    |
| `'i'`    | integer        | New order ID                                                                               |
| `'s'`    | string         | Symbol                                                                                     |
| `'id'`   | string         | Client-defined 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.

**Notes:** Editing an order cancels the original and creates a new one. The new order maintains the same side, reduce-only status, and client\_order\_id (if provided), is created with TIF = ALO (Post Only), and receives a new system-assigned order\_id.\
\
Edit orders are subject to the taker speedbump: when the speedbump is enabled, they are delayed by a randomized \~190-210ms regardless of whether the resulting order is a taker (accounts on the exemption whitelist are not delayed).
