Skip to Main Content
POST/NorenWClientAPI/ModifyOrder

Modify Order

Modify the price, quantity, order type, or trigger price of an existing open or trigger-pending order. The exchange, trading symbol, and transaction type of the original order cannot be changed.

API Endpoint

MethodPOST
URLhttps://api.shoonya.com/NorenWClientAPI/ModifyOrder
Content-Typeapplication/x-www-form-urlencoded
PayloadjData=<JSON payload>&jKey=<AccessToken> — requires a valid AccessToken from Login.

Overview

Modify Order changes an order that is still resting on the exchange — Open or Trigger Pending state — without cancelling and re-placing it. Use it to reprice a stale limit order, resize a partially-adjusted position, or move a stop-loss trigger as the market moves. Always confirm current order state via Order Book before modifying — an order that has already completed, been cancelled, or been rejected cannot be modified.

Identity fields are fixedexch and tsym identify the original order and cannot be changed by a modify request. To trade a different symbol or exchange, cancel the order and place a new one.
MKT is still not supportedShoonya's Place Order only accepts LMT and SL-LMT, and that restriction carries through to Modify Order — you cannot convert an order to MKT via modification, even though some generic Noren API references elsewhere show a newprice_type='MKT' example.

Rate Limits

Shares the same 10 orders/second (OPS) per-client throttle as Place Order, enforced at the OMS layer per SEBI's algo-trading OPS threshold framework — modify and cancel calls count against the same bucket as new order placements.

Need more than 10 OPS?Submit your strategy to the exchange for approval and obtain an Algo ID. Once empanelled, higher OPS thresholds apply under the exchange's Algo ID framework.

Parameters

Field Type Required Description Allowed Values
uid string Required User ID of the authenticated account. Account-specific
norenordno string Required Noren order number of the order to modify, as returned by Place Order or Order Book. Existing open / trigger-pending order
exch string Required Exchange segment of the original order. Cannot differ from the order being modified. NSE, BSE, NFO, BFO, CDS, MCX
tsym string Required Trading symbol of the original order. Cannot differ from the order being modified (use URL encoding for symbols like M&M). Must match original order
qty integer Required New order quantity. For derivatives, must be a multiple of the exchange lot size. > 0, lot-size multiple for derivatives
prc number Required New order price. > 0, within exchange circuit band
prctyp string Required New order type. MKT is not supported — see warning above. LMT, SL-LMT
trgprc number Conditional New trigger price. Mandatory when prctyp is SL-LMT, or when converting an existing order to/from SL-LMT. > 0; omit when prctyp = LMT
ret string Required Order validity. DAY, IOC
dscqty integer Optional Disclosed quantity visible to the market. 0 to qty
ordersource string Required Order source identifier. API

Request Examples

import requests
import json

payload = {
    "uid": "AB1234",
    "norenordno": orderNumber,   # from PlaceOrder response
    "exch": "NSE",
    "tsym": "RELIANCE-EQ",
    "qty": "2",
    "prc": "182.50",
    "prctyp": "LMT",             # LMT or SL-LMT only — MKT is rejected
    "ret": "DAY",
    "ordersource": "API",
}
data = f"jData={json.dumps(payload)}&jKey={accessToken}"

response = requests.post(
    "https://api.shoonya.com/NorenWClientAPI/ModifyOrder",
    data=data,
)
result = response.json()

if result.get("stat") == "Ok":
    print("Order modified:", result["result"])   # note: field is "result", not "norenordno"
else:
    print("Modification rejected:", result.get("emsg"))
const payload = {
  uid: "AB1234",
  norenordno: orderNumber,   // from PlaceOrder response
  exch: "NSE",
  tsym: "RELIANCE-EQ",
  qty: "2",
  prc: "182.50",
  prctyp: "LMT",              // LMT or SL-LMT only — MKT is rejected
  ret: "DAY",
  ordersource: "API",
};

const data = `jData=${JSON.stringify(payload)}&jKey=${accessToken}`;

try {
  const res = await fetch("https://api.shoonya.com/NorenWClientAPI/ModifyOrder", {
    method: "POST",
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    body: data,
  });
  const result = await res.json();

  if (result.stat === "Ok") {
    console.log("Order modified:", result.result); // note: field is "result", not "norenordno"
  } else {
    console.error("Modification rejected:", result.emsg);
  }
} catch (err) {
  console.error("Network/timeout error modifying order:", err);
}
curl -X POST https://api.shoonya.com/NorenWClientAPI/ModifyOrder \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode 'jData={"uid":"AB1234","norenordno":"24121500001234","exch":"NSE","tsym":"RELIANCE-EQ","qty":"2","prc":"182.50","prctyp":"LMT","ret":"DAY","ordersource":"API"}' \
  --data-urlencode "jKey=$ACCESS_TOKEN"

Response

json
// Success — HTTP 200
{ "stat": "Ok", "result": "24121500001234", "request_time": "14:48:28 24-05-2024" }

// Rejection — HTTP 200
{ "stat": "Not_Ok", "emsg": "Rejected : ORA:Order not found" }
Field name differs from Place OrderOn success, the modified order number is returned in result, not norenordno — a common source of silent bugs when reusing Place Order's response-parsing code. As with Place Order, HTTP 200 is returned for both success and failure; always check stat.
FieldDescription
statOk or Not_Ok.
resultNoren order number of the modified order, present only on success.
request_timeTimestamp the response was generated, present only on success.
emsgRejection reason, present only on failure — see below.

Common Error Responses

ErrorReasonFix
Order not foundnorenordno doesn't exist, belongs to another user, or has already completed/been cancelled.Re-check current state via Order Book before modifying.
Invalid QuantityNew qty is zero, negative, or not a lot-size multiple.Round to nearest valid lot multiple.
Price Outside Circuit LimitNew prc outside the exchange circuit band.Fetch current circuit band before repricing.
Symbol/Exchange Mismatchexch or tsym doesn't match the original order.These fields identify, not modify, the order — copy them unchanged from the original.
Session ExpiredjKey/AccessToken invalid or expired.Re-authenticate via Token Renewal.
Exchange RejectionOrder already partially/fully filled at the exchange before the modify reached it (a fill/modify race).Inspect emsg; reconcile actual state via Order Book rather than assuming the modify applied.

Best Practices

  • Fetch the order's current state from Order Book immediately before modifying — a fill can race your modify request, and the OMS will reject a modify against an already-completed order.
  • Always send the full parameter set (qty, prc, prctyp, ret, etc.), not just the field you're changing — Modify Order replaces the order's terms rather than patching a single field.
  • Parse the success order number from result, not norenordno — reusing Place Order's response-parsing logic unmodified is a common bug.
  • Since MKT isn't supported here either, reprice LMT modifications with a small buffer beyond current LTP for reliable fills.
  • Respect the shared 10 OPS rate limit — modify and cancel calls draw from the same per-client bucket as Place Order.
  • Track the outcome via the Order Update Feed rather than assuming a stat: "Ok" response means the new terms are live at the exchange.