Skip to Main Content
POST/NorenWClientAPI/OrderBook

Order Book

Fetch every order placed today for the account, across all products, exchanges, and states.

Overview

Order Book returns the full list of orders for the logged-in account for the current trading day — Open, Trigger Pending, Complete, Rejected, and Cancelled orders all come back in the same array, differentiated by status. There's no separate "list open orders" call — filter client-side.

This is the endpoint to reconcile against after every Place Order, Modify, or Cancel call whose HTTP response was ambiguous (timeout, network error) — never assume an order's fate from a failed request alone.

Parameters

FieldTypeRequiredDescription
uidstringRequiredLogged-in user ID. Handled by the SDK if you're using it.

Request example

import requests, json
 
payload = {"uid": "AB1234"}
data = f"jData={json.dumps(payload)}&jKey={accessToken}"
 
resp = requests.post("https://api.shoonya.com/NorenWClientAPI/OrderBook", data=data)
orders = resp.json()
 
open_orders = [o for o in orders if o.get("status") in ("OPEN", "TRIGGER_PENDING")]
print(f"{len(open_orders)} open/trigger-pending orders")
const payload = { uid: "AB1234" };
const data = `jData=${JSON.stringify(payload)}&jKey=${accessToken}`;
 
const res = await fetch("https://api.shoonya.com/NorenWClientAPI/OrderBook", {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: data,
});
const orders = await res.json();
const openOrders = orders.filter(o => ["OPEN", "TRIGGER_PENDING"].includes(o.status));
console.log(`${openOrders.length} open/trigger-pending orders`);
curl -X POST https://api.shoonya.com/NorenWClientAPI/OrderBook \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode 'jData={"uid":"AB1234"}' \
  --data-urlencode "jKey=$ACCESS_TOKEN"

Response

json
[
  {
    "stat": "Ok",
    "exch": "NSE",
    "tsym": "ACC-EQ",
    "norenordno": "24121500001223",
    "prc": "1272.30",
    "qty": "100",
    "prd": "C",
    "status": "OPEN",
    "trantype": "B",
    "prctyp": "LMT",
    "fillshares": "0",
    "avgprc": "0",
    "exchordid": "250620000000343421",
    "ret": "DAY",
    "remarks": "my_order_001"
  },
  {
    "stat": "Ok",
    "exch": "NSE",
    "tsym": "ABB-EQ",
    "norenordno": "24121500002543",
    "prc": "1278.30",
    "qty": "50",
    "prd": "C",
    "status": "REJECTED",
    "trantype": "B",
    "prctyp": "LMT",
    "fillshares": "0",
    "avgprc": "0",
    "rejreason": "Insufficient funds"
  }
]
FieldDescription
norenordnoNoren order number — the key to pass to Modify/Cancel/Exit.
statusSee Order Status valuesOPEN, TRIGGER_PENDING, COMPLETE, REJECTED, CANCELED, PENDING.
fillshares / avgprcCumulative filled quantity and average fill price so far — non-zero even for a partial fill on an otherwise OPEN order.
rejreasonPresent only when status is REJECTED.
exchordidExchange-side order ID, distinct from norenordno.
Every row carries its own statOrder Book returns an array where each element repeats "stat": "Ok" — this reflects each individual record having rendered correctly, not per-order success. A failed order shows up as a normal array element with status: "REJECTED", not as an error.

Error handling

json
{
  "stat": "Not_Ok",
  "emsg": "Session Expired : Invalid Session Key"
}

Best practices

  • Poll sparingly — Order Book is a REST snapshot, not a stream. For real-time state, drive your strategy off the Order Update Feed and use this endpoint only for startup reconciliation and periodic sanity checks.
  • Match on remarks + tsym + qty when reconciling after a timeout, since Shoonya has no client-order-ID field — tag every order with a unique remarks value at send time (see Place Order best practices).
  • Don't assume array order is chronological or stable — sort by norentm/ordenttm client-side if you need order sequencing.

Notes

Field names shown follow standard NorenOMS conventions used across this documentation — confirm exact casing against your onboarding packet before going to production.