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

# userOrders: List All Active Open Orders for an Account

> Retrieve all active open orders for your account within a market deployer, with optional filtering by contract ID to narrow results.

The `userOrders` query returns all active orders for your account within a market deployer. You can filter the results to a specific contract by passing its `contractId`, or set it to `0` to retrieve orders across all contracts. Use the returned `id` field to reference orders in cancel or modify actions.

## Request

```json theme={"system"}
{
  "type": "userOrders",
  "accountId": "5",
  "marketDeployerId": 1,
  "contractId": 0
}
```

<ParamField body="type" type="string" required>
  Must be `"userOrders"`.
</ParamField>

<ParamField body="accountId" type="string" required>
  Your account ID, obtained from the `registerAccount` action.
</ParamField>

<ParamField body="marketDeployerId" type="integer" required>
  The market deployer to query orders within.
</ParamField>

<ParamField body="contractId" type="integer">
  Filter orders by contract. Use `0` or omit to return orders across all contracts. Pass a positive integer to restrict results to that specific contract.
</ParamField>

## Response

```json theme={"system"}
{
  "type": "userOrders",
  "accountId": "5",
  "marketDeployerId": 1,
  "contractIdFilter": 0,
  "orders": [
    {
      "id": "6",
      "clientOrderId": "0",
      "accountId": "5",
      "contractId": 1,
      "marginMode": "C",
      "positionSide": "OneWay",
      "orderSide": "B",
      "orderType": "L",
      "timeInForce": "Gtc",
      "price": "50",
      "size": "10",
      "leverage": "10",
      "status": "Open",
      "reduceOnly": false
    }
  ]
}
```

### Order Fields

<ResponseField name="id" type="string">
  Exchange-assigned order ID (int64 as a decimal string). Use this value in cancel and modify actions to reference the order.
</ResponseField>

<ResponseField name="clientOrderId" type="string">
  Your client-assigned order ID set at placement time (the `c` field). `"0"` means no client ID was assigned.
</ResponseField>

<ResponseField name="contractId" type="integer">
  The contract this order is placed on. Cross-reference with `configs` for the contract name and scales.
</ResponseField>

<ResponseField name="orderSide" type="string">
  `"B"` for a buy (bid) order; `"S"` for a sell (ask) order.
</ResponseField>

<ResponseField name="orderType" type="string">
  `"L"` for a limit order; `"M"` for a market order.
</ResponseField>

<ResponseField name="timeInForce" type="string">
  Order duration policy: `"Gtc"` (Good Till Cancel), `"Ioc"` (Immediate Or Cancel), or `"Alo"` (Add Liquidity Only / post-only).
</ResponseField>

<ResponseField name="price" type="string">
  Order price as a raw integer string. Divide by `10^priceScale` from `configs` to get the display value.
</ResponseField>

<ResponseField name="size" type="string">
  Order quantity as a raw integer string. Divide by `10^qtyScale` from `configs` to get the display value.
</ResponseField>

<ResponseField name="leverage" type="string">
  Leverage applied to this order at placement time.
</ResponseField>

<ResponseField name="status" type="string">
  Current order status: `"Open"` (resting), `"Filled"` (fully matched), or `"Canceled"` (removed from book).
</ResponseField>

<ResponseField name="marginMode" type="string">
  `"C"` for cross margin; `"I"` for isolated margin.
</ResponseField>

<ResponseField name="reduceOnly" type="boolean">
  `true` if this order can only reduce an existing position (it will be rejected or auto-canceled if it would open or increase a position).
</ResponseField>
