# Edit order

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": {
    "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>required</td><td>Order amount</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
{
  "code": 200,
  "data": {
    "I": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "i": 645954,
    "s": "BTC"
  },
  "id": "660065de-8f32-46ad-ba1e-83c93d3e3966",
  "t": 1749223026150,
  "type": "edit_order"
}
```

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

**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 order is not subject to the taker speedbump.


---

# 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/edit-order.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.
