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

# Edit Order

> Edit the parameters of a live order by cancelling and recreating it

<div className="api-banner">
  <span className="api-protocol ws">WSS</span>
  <span className="api-detail">ws-auth.kraken.com</span>
  <span className="api-tag">editOrder</span>
</div>

Sends a request to edit the order parameters of a live order. When an order has been successfully modified, the original order will be cancelled and a new order will be created with the adjusted parameters and a new `txid` will be returned in the response.

<Warning>
  The newer [amendOrder](/exchange/api-reference/spot-websocket-v1/amendorder) endpoint resolves the caveats listed below and has additional performance gains.

  There are a number of caveats for `editOrder`:

  * `editOrder` cannot be used on partially filled orders.
  * `editOrder` is a cancel and replace, so queue priority is not maintained.
  * `editOrder` generates a new `txid` for the order.
</Warning>

<Tabs>
  <Tab title="Request">
    <ResponseField name="event" type="string" required>
      Value: `editOrder`
    </ResponseField>

    <ResponseField name="orderid" type="string">
      Original Order ID or userref.
    </ResponseField>

    <ResponseField name="pair" type="string" required>
      Currency pair.
    </ResponseField>

    <ResponseField name="price" type="string">
      Dependent on order type - order price.
    </ResponseField>

    <ResponseField name="price2" type="string">
      Dependent on order type - order secondary price.
    </ResponseField>

    <ResponseField name="volume" type="string" required>
      Order volume in base currency.
    </ResponseField>

    <ResponseField name="oflags" type="string">
      Comma delimited list of order flags. `post` = post only order (available when ordertype = limit).
    </ResponseField>

    <ResponseField name="newuserref" type="string">
      User reference ID for new order (should be an integer in quotes).
    </ResponseField>

    <ResponseField name="validate" type="boolean">
      Validate inputs only; do not submit order.
    </ResponseField>

    <ResponseField name="reqid" type="integer">
      Optional client originated request identifier sent as acknowledgment in the response.
    </ResponseField>

    <ResponseField name="token" type="string" required>
      Session token from the [GetWebSocketsToken](/api-reference/trading/get-websockets-token) REST endpoint.
    </ResponseField>
  </Tab>

  <Tab title="Response">
    <ResponseField name="event" type="string">
      Value: `editOrderStatus`
    </ResponseField>

    <ResponseField name="txid" type="string">
      A new Kraken order identifier for the amended order.
    </ResponseField>

    <ResponseField name="originaltxid" type="string">
      The Kraken order identifier for the original order.
    </ResponseField>

    <ResponseField name="descr" type="string">
      A descriptive summary for the amended order.
    </ResponseField>

    <ResponseField name="status" type="string">
      <span className="field-attr">One of:</span> `ok`, `error`
    </ResponseField>

    <ResponseField name="reqid" type="integer">
      Client originated identifier for the request that initiated this response.
    </ResponseField>

    <ResponseField name="errorMessage" type="string">
      Error message for unsuccessful requests.
    </ResponseField>
  </Tab>
</Tabs>

<Panel>
  <CodeGroup>
    ```json Request theme={null}
    {
        "event": "editOrder",
        "newuserref": "666",
        "oflags": "",
        "orderid": "O26VH7-COEPR-YFYXLK",
        "pair": "XBT/USD",
        "price": "9000",
        "reqid": 3,
        "token": "0000000000000000000000000000000000000000"
    }
    ```

    ```json Response theme={null}
    {
        "descr": "order edited price = 9000.00000000",
        "event": "editOrderStatus",
        "originaltxid": "O65KZW-J4AW3-VFS74A",
        "reqid": 3,
        "status": "ok",
        "txid": "OTI672-HJFAO-XOIPPK"
    }
    ```
  </CodeGroup>
</Panel>
