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

<div className="api-banner">
  <span className="api-protocol ws">WSS</span>
  <span className="api-detail">ws-auth.kraken.com/v2</span>
  <span className="api-tag">edit\_order</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 a new `order_id` will be returned in the response.

<Note>
  The new [amend\_order](/exchange/api-reference/spot-websocket-v2/amend_order) endpoint resolves the caveats listed below and has additional performance gains.

  There are a number of caveats for `edit_order`:

  * triggered stop loss or profit take profit orders are not supported.
  * orders with conditional close terms attached are not supported.
  * orders where the executed volume is greater than the newly supplied volume will be rejected.
  * `cl_ord_id` is not supported.
  * existing executions will are associated with the original order and not copied to the amended order.
  * queue position will not be maintained.
</Note>

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

    <ResponseField name="params" type="object">
      <Expandable title="properties" defaultOpen>
        <ResponseField name="deadline" type="string">
          <span className="field-attr">Format:</span> RFC3339<br />
          <span className="field-attr">Example:</span> `2022-12-25T09:30:59.123Z`

          Range of valid offsets (from current time) is 500 milliseconds to 60 seconds, default is 5 seconds. The precision of this parameter is to the millisecond. The engine will prevent this order from matching after this time, it provides protection against latency on time sensitive orders.
        </ResponseField>

        <ResponseField name="display_qty" type="float">
          <span className="field-attr">Condition:</span> Iceberg orders only

          Defines the quantity to show in the book while the rest of order quantity remains hidden. Minimum value is 1 / 15 of `order_qty`.
        </ResponseField>

        <ResponseField name="fee_preference" type="string">
          <span className="field-attr">One of:</span> `base`, `quote`

          Fee preference base or quote currency. `quote` is the default for buy orders, `base` is the default for sell orders.
        </ResponseField>

        <ResponseField name="limit_price" type="float">
          Limit price for order types that support limit price restriction.
        </ResponseField>

        <ResponseField name="no_mpp" type="boolean" deprecated>
          <span className="field-attr">One of:</span> `true`, `false`<br />
          <span className="field-attr">Default:</span> `false`<br />
          <span className="field-attr">Condition:</span> Market orders only<br />
          <span className="field-attr">Deprecated:</span> If supplied, the flag is accepted but ignored

          Disables Market Price Protection (MPP) if set to `true`. MPP is a feature that protects market orders from filling at a bad price due to price slippage in an illiquid or volatile market. See [MPP support article](https://support.kraken.com/hc/en-us/articles/201648183-Market-Price-Protection).
        </ResponseField>

        <ResponseField name="order_id" type="string" required>
          <span className="field-attr">Example:</span> `OFGKYQ-FHPCQ-HUQFEK`

          The Kraken identifier for the order to be amended.
        </ResponseField>

        <ResponseField name="order_qty" type="float">
          Order quantity in terms of the base asset.
        </ResponseField>

        <ResponseField name="order_userref" type="integer">
          User defined reference to be placed on the amended order. It does not identify the order to be amended, use `order_id`.
        </ResponseField>

        <ResponseField name="post_only" type="boolean">
          <span className="field-attr">One of:</span> `true`, `false`<br />
          <span className="field-attr">Default:</span> `false`<br />
          <span className="field-attr">Condition:</span> Orders with limit price only

          Cancels the order if it will take liquidity on arrival. Post only orders will always be posted passively in the book.
        </ResponseField>

        <ResponseField name="reduce_only" type="boolean">
          <span className="field-attr">One of:</span> `true`, `false`<br />
          <span className="field-attr">Default:</span> `false`

          Reduces an existing margin position without opening an opposite long or short position worth more than the current value of your leveraged assets.
        </ResponseField>

        <ResponseField name="symbol" type="string" required>
          <span className="field-attr">Example:</span> `"BTC/USD"`

          The original symbol identifier for the pair. Note, the `symbol` cannot be amended.
        </ResponseField>

        <ResponseField name="triggers" type="object">
          <span className="field-attr">Condition:</span> Required for triggered order types only

          The parameters for setting the trigger price conditions.

          <Expandable title="properties" defaultOpen>
            <ResponseField name="reference" type="string">
              <span className="field-attr">One of:</span> `index`, `last`<br />
              <span className="field-attr">Default:</span> `last`

              The reference price to track for triggering orders.

              * `index`: the index price in the broader market (for this pair). Note, to keep triggers serviceable during connectivity issues with external index feeds, the last price will be used as the reference price.
              * `last`: the last traded price in the Kraken order book (for this pair).
            </ResponseField>

            <ResponseField name="price" type="float">
              Specifies the amount for the trigger price - it supports both static market prices and relative prices. This field is used in combination with the `price_type` field below to determine the effective trigger price.

              **Examples:**

              * To trigger at 29000.5 BTC/USD, use price=29000.5, price\_type=static.
              * To trigger when price rises by 5%, use price=5, price\_type=pct.
              * To trigger when price drops by 150 USD, use price=-150, price\_type=quote.

              Note, for `trailing-stop` and `trailing-stop-limit` order types, the price represents the reversion from the peak. It is always a positive offset value.
            </ResponseField>

            <ResponseField name="price_type" type="string">
              <span className="field-attr">One of:</span> `static`, `pct`, `quote`<br />
              <span className="field-attr">Default:</span> `static`

              The units for the trigger price.

              * `static`: a static market price for the asset, i.e. 30000 for BTC/USD.
              * `pct`: a percentage offset from the reference price, i.e. -10% from index price.
              * `quote`: a notional offset from the reference price in the quote currency, i.e, 150 BTC/USD from last price.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="validate" type="boolean">
          <span className="field-attr">One of:</span> `true`, `false`<br />
          <span className="field-attr">Default:</span> `false`

          If set to `true` the order will be validated only, it will not trade in the matching engine.
        </ResponseField>

        <ResponseField name="price" type="float" deprecated>
          <span className="field-attr">Deprecated:</span> Use `limit_price` parameter
        </ResponseField>

        <ResponseField name="trigger" type="string" deprecated>
          <span className="field-attr">Deprecated:</span> Use `triggers.reference` parameter
        </ResponseField>

        <ResponseField name="stop_price" type="float" deprecated>
          <span className="field-attr">Deprecated:</span> Use `triggers.price` parameter
        </ResponseField>

        <ResponseField name="token" type="string" required>
          Authentication token. See [authentication guide](/exchange/guides/websockets/authentication) for details.
        </ResponseField>
      </Expandable>
    </ResponseField>

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

  <Tab title="Response">
    <ResponseField name="method" type="string">
      Value: `edit_order`
    </ResponseField>

    <ResponseField name="result" type="object">
      <span className="field-attr">Condition:</span> if `success` is `true`

      <Expandable title="properties" defaultOpen>
        <ResponseField name="order_id" type="string">
          Unique ID of the order
        </ResponseField>

        <ResponseField name="original_order_id" type="string">
          ID of the order that have been edited
        </ResponseField>

        <ResponseField name="warnings" type="array of string">
          Non-fatal warnings about the edit, if any.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="error" type="string">
      Error message. Condition: if `success` is `false`.
    </ResponseField>

    <ResponseField name="success" type="boolean">
      Indicates if the request was successfully processed by the engine. One of: `true`, `false`
    </ResponseField>

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

    <ResponseField name="time_in" type="string">
      The timestamp when the request was received on the wire, just prior to parsing data. Format: RFC3339. Example: `2022-12-25T09:30:59.123456Z`
    </ResponseField>

    <ResponseField name="time_out" type="string">
      The timestamp when the response was sent on the wire, just prior to transmitting data. Format: RFC3339. Example: `2022-12-25T09:30:59.123456Z`
    </ResponseField>
  </Tab>
</Tabs>

<Panel>
  <CodeGroup>
    ```json Request theme={null}
    {
      "method": "edit_order",
      "params": {
        "order_id": "ORDERX-IDXXX-XXXXX1",
        "order_qty": 0.2123456789,
        "symbol": "BTC/USD",
        "token": "TxxxxxxxxxOxxxxxxxxxxKxxxxxxxExxxxxxxxN"
      },
      "req_id": 1234567890
    }
    ```

    ```json Response theme={null}
    {
      "method": "edit_order",
      "req_id": 1234567890,
      "result": {
        "order_id": "ORDERX-IDXXX-XXXXX2",
        "original_order_id": "ORDERX-IDXXX-XXXXX1"
      },
      "success": true,
      "time_in": "2022-07-15T12:56:09.876488Z",
      "time_out": "2022-07-15T12:56:09.923422Z"
    }
    ```
  </CodeGroup>
</Panel>
