Skip to Main Content
POST/NorenWClientAPI/ExitSNOOrder

Exit Order

Exit a Cover Order (CO) or Bracket Order (BO) leg — the dedicated exit path for these product types, distinct from a plain cancel.

Overview

Cover and Bracket orders carry attached stop-loss (and, for BO, profit-target) legs managed server-side. Exit Order is the correct way to close out of one of these — it unwinds the parent order and its child legs together. A plain Cancel Order call is not equivalent for these product types.

ScopeThis endpoint applies only to prd values H (Cover Order) and B (Bracket Order). Note that elsewhere in this documentation — see Place Order — CO and BO are called out as not accepted as prd values on new order placement. If your account has legacy CO/BO positions or your onboarding enables them, this is the corresponding exit endpoint; if you can't place CO/BO orders in the first place, you won't have a use for this page.

Parameters

FieldTypeRequiredDescription
uidstringRequiredLogged-in user ID.
norenordnostringRequiredNoren order number of the parent CO/BO order to exit.
prdstringRequiredProduct type — only H or B are accepted.

Request example

import requests, json
 
payload = {"uid": "AB1234", "norenordno": orderNumber, "prd": "B"}
data = f"jData={json.dumps(payload)}&jKey={accessToken}"
 
resp = requests.post("https://api.shoonya.com/NorenWClientAPI/ExitSNOOrder", data=data)
result = resp.json()
if result.get("stat") == "Ok":
    print("Exited:", result.get("dmsg"))
else:
    print("Exit failed:", result.get("emsg"))
const payload = { uid: "AB1234", norenordno: orderNumber, prd: "B" };
const data = `jData=${JSON.stringify(payload)}&jKey=${accessToken}`;
 
const res = await fetch("https://api.shoonya.com/NorenWClientAPI/ExitSNOOrder", {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: data,
});
console.log(await res.json());
curl -X POST https://api.shoonya.com/NorenWClientAPI/ExitSNOOrder \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode 'jData={"uid":"AB1234","norenordno":"24121500001234","prd":"B"}' \
  --data-urlencode "jKey=$ACCESS_TOKEN"

Response

json
// Success
{ "stat": "Ok", "dmsg": "Order Exited Successfully", "request_time": "11:02:44 15-12-2024" }
 
// Failure
{ "stat": "Not_Ok", "emsg": "Rejected : ORA:Order not found" }
FieldDescription
dmsgDisplay message confirming the exit — present only on success.
emsgPresent only on failure.

Best practices

  • Confirm the parent order's current state via Order Book before calling Exit — an already-completed or already-exited CO/BO will reject.
  • Track the outcome via the Order Update Feed rather than the HTTP response alone, consistent with every other order-management endpoint on this API.

Notes

See Product Type Codes for how H and B map to Cover and Bracket orders.