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

# Open Orders

> Subscribe to real-time open order updates for the authenticated user

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

The `openOrders` channel streams the open orders belonging to the authenticated user. The initial snapshot provides a list of all open orders, followed by real-time updates. For status change updates, such as `closed`, the fields `orderid` and `status` will be present in the payload.

## Subscribe

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

    <ResponseField name="subscription" type="object">
      <Expandable title="properties" defaultOpen>
        <ResponseField name="name" type="string" required>
          Value: `openOrders`
        </ResponseField>

        <ResponseField name="token" type="string" required>
          Session token from the GetWebSocketsToken REST endpoint.
        </ResponseField>

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

          Includes rate-limit counter in updates.
        </ResponseField>

        <ResponseField name="rebased" type="boolean">
          <span className="field-attr">One of:</span> `true`, `false`<br />
          <span className="field-attr">Default:</span> `true`<br />
          <span className="field-attr">Condition:</span> Effective for viewing xstocks only

          If `true`, display in terms of underlying equity, otherwise display in terms of SPV tokens.
        </ResponseField>
      </Expandable>
    </ResponseField>

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

  <Tab title="Response">
    The subscription status is returned via the [subscriptionStatus](/exchange/api-reference/spot-websocket-v1/subscriptionstatus) message.
  </Tab>
</Tabs>

## Snapshot / Update

The snapshot and update responses share the same schema. The payload is a JSON array containing the order data, the channel name, and feed detail.

<ResponseField name="[0]" type="object[]">
  A list of order objects. Each object is keyed by the Kraken order identifier.

  <Expandable title="properties" defaultOpen>
    <ResponseField name="<order-id>" type="object">
      The key for each order is the Kraken order identifier.

      <Expandable title="properties">
        <ResponseField name="refid" type="string">
          Referral order transaction id that created this order.
        </ResponseField>

        <ResponseField name="userref" type="integer">
          An optional, numeric identifier associated with one or more orders.
        </ResponseField>

        <ResponseField name="cl_ord_id" type="string">
          An optional, alphanumeric client identifier associated with this order.
        </ResponseField>

        <ResponseField name="ext_ord_id" type="string">
          <span className="field-attr">Format:</span> UUID

          An optional, external partner order identifier.
        </ResponseField>

        <ResponseField name="status" type="string">
          Status of order.
        </ResponseField>

        <ResponseField name="opentm" type="string">
          Unix timestamp of when order was placed.
        </ResponseField>

        <ResponseField name="starttm" type="string">
          Unix timestamp of order start time (if set).
        </ResponseField>

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

          The reload quantity for iceberg order types.
        </ResponseField>

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

          The visible quantity remaining in the book.
        </ResponseField>

        <ResponseField name="expiretm" type="string">
          Unix timestamp of order end time (if set).
        </ResponseField>

        <ResponseField name="contingent" type="object">
          Parameters for the conditional close order (if attached).

          <Expandable title="properties">
            <ResponseField name="ordertype" type="string">
              Conditional close order type.
            </ResponseField>

            <ResponseField name="price" type="string">
              Primary price of the conditional close order.
            </ResponseField>

            <ResponseField name="price2" type="string">
              Secondary price of the conditional close order.
            </ResponseField>

            <ResponseField name="oflags" type="string">
              Comma delimited list of order flags for the conditional close order. `fcib` = prefer fee in base currency, `fciq` = prefer fee in quote currency, `nompp` = no market price protection, `post` = post only order (available when ordertype = limit).
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="descr" type="object">
          Order description info.

          <Expandable title="properties">
            <ResponseField name="pair" type="string">
              Asset pair.
            </ResponseField>

            <ResponseField name="position" type="string">
              Optional - position ID (if applicable).
            </ResponseField>

            <ResponseField name="type" type="string">
              Side of order (buy/sell).
            </ResponseField>

            <ResponseField name="ordertype" type="string">
              Order type.
            </ResponseField>

            <ResponseField name="price" type="string">
              The limit price or trigger price depending on the order type:

              * **limit** price for `limit` orders.
              * **trigger** price for all triggered orders.
            </ResponseField>

            <ResponseField name="price2" type="string">
              The **limit** price for `stop-loss-limit`, `take-profit-limit` and `trailing-stop-limit` orders.
            </ResponseField>

            <ResponseField name="leverage" type="string">
              Amount of margin leverage.
            </ResponseField>

            <ResponseField name="margin" type="boolean">
              Indicates if the order is funded on margin.
            </ResponseField>

            <ResponseField name="order" type="string">
              Text summary of order.
            </ResponseField>

            <ResponseField name="close" type="string">
              Text summary of conditional order (if conditional close attached).
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="lastupdated" type="string">
          Unix timestamp of last change (for updates).
        </ResponseField>

        <ResponseField name="vol" type="string">
          Volume of order (base currency unless viqc set in oflags).
        </ResponseField>

        <ResponseField name="vol_exec" type="string">
          Total volume executed so far (base currency unless viqc set in oflags).
        </ResponseField>

        <ResponseField name="cost" type="string">
          Total cost (quote currency unless viqc set in oflags).
        </ResponseField>

        <ResponseField name="fee" type="string">
          Total fee (quote currency).
        </ResponseField>

        <ResponseField name="avg_price" type="string">
          Average price (cumulative; quote currency unless viqc set in oflags).
        </ResponseField>

        <ResponseField name="stopprice" type="string">
          Stop price (for trailing stops).
        </ResponseField>

        <ResponseField name="limitprice" type="string">
          Triggered limit price (after limit based order types are triggered).
        </ResponseField>

        <ResponseField name="misc" type="string">
          A comma delimited list of miscellaneous info:

          * `stopped`: triggered by stop price
          * `touched`: triggered by touch price
          * `liquidation`: liquidation event
          * `partial`: partial fill
        </ResponseField>

        <ResponseField name="oflags" type="string">
          A comma delimited list of order flags:

          * `viqc`: volume in quote currency
          * `fcib`: prefer fee in base currency
          * `fciq`: prefer fee in quote currency
          * `nompp`: no market price protection
          * `post`: post only order
        </ResponseField>

        <ResponseField name="sender_sub_id" type="string">
          For institutional accounts, identifies underlying sub-account/trader for Self Trade Prevention (STP).
        </ResponseField>

        <ResponseField name="timeinforce" type="string">
          <span className="field-attr">One of:</span> `GTC`, `GTD`, `IOC`, `FOK`<br />
          <span className="field-attr">Default:</span> `GTC`

          Time-in-force specifies how long an order remains in effect before expiry.

          * `GTC`: Good Till Canceled - until user has cancelled.
          * `GTD`: Good Till Date - until `expiretm` parameter.
          * `IOC`: Immediate Or Cancel - immediately cancels back any quantity that cannot be filled on arrival.
          * `FOK`: Fill Or Kill - immediately fills the full order quantity or cancels it entirely.
        </ResponseField>

        <ResponseField name="cancel_reason" type="string">
          Cancel reason, present for all cancellation updates (status="canceled") and for some close updates (status="closed").
        </ResponseField>

        <ResponseField name="amend_reason" type="string">
          Amendment reason, present for all amend events.
        </ResponseField>

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

          Indicates if the order has been amended, the modification history can be extracted from the REST `OrderAmends` endpoint.
        </ResponseField>

        <ResponseField name="ratecount" type="string">
          Rate-limit counter, present if requested in subscription request. See Trading Rate Limits.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="[1]" type="string">
  Value: `openOrders`
</ResponseField>

<ResponseField name="[2]" type="object">
  <Expandable title="properties">
    <ResponseField name="sequence" type="integer">
      Sequence number for this subscription.
    </ResponseField>
  </Expandable>
</ResponseField>

<Panel>
  <CodeGroup>
    ```json Subscribe theme={null}
    {
        "event": "subscribe",
        "subscription": {
            "name": "openOrders",
            "ratecounter": "true",
            "token": "WW91ciBhdXRoZW50aWNhdGlvbiB0b2tlbiBnb2VzIGhlcmUu"
        }
    }
    ```

    ```json Snapshot / Update theme={null}
    [
        [
            {
                "OGTT3Y-C6I3P-XRI6HX": {
                    "avg_price": "34.50000",
                    "cost": "0.00000",
                    "descr": {
                        "close": "",
                        "leverage": "0:1",
                        "order": "sell 10.00345345 XBT/EUR @ limit 34.50000 with 0:1 leverage",
                        "ordertype": "limit",
                        "pair": "XBT/EUR",
                        "price": "34.50000",
                        "price2": "0.00000",
                        "type": "sell"
                    },
                    "expiretm": "0.000000",
                    "fee": "0.00000",
                    "limitprice": "34.50000",
                    "misc": "",
                    "oflags": "fcib",
                    "opentm": "0.000000",
                    "refid": "OKIVMP-5GVZN-Z2D2UA",
                    "starttm": "0.000000",
                    "status": "open",
                    "stopprice": "0.000000",
                    "userref": 0,
                    "vol": "10.00345345",
                    "vol_exec": "0.00000000"
                }
            }
        ],
        "openOrders",
        {
            "sequence": 234
        }
    ]
    ```

    ```json Status Update theme={null}
    [
        [
            {
                "OGTT3Y-C6I3P-XRI6HX": {
                    "status": "closed"
                }
            }
        ],
        "openOrders",
        {
            "sequence": 59342
        }
    ]
    ```
  </CodeGroup>
</Panel>
