Skip to content

Modify Order

As long as an order is open or pending in the system, certain attributes of it may be modified.

POST: /api/modifyOrder

https://connect.thefirstock.com/api/modifyOrder

Request Details

Parameter Description
norenordno Noren order number, which needs to be cancelled
price Modified / New price
quantity Modified / New Quantity
triggerPrice New trigger price in case of SL-MKT or SL-LMT
userId User id of the logged in user.
jKey Key Obtained on login success.
exchange NSE / NFO / BSE
tradingSymbol Trading Symbol (use url encoding to avoid special char error for symbols like M&M) NSE NFO
priceType LMT / MKT / SL-LMT / SL-MKT

Code

from thefirstock import thefirstock

mO = thefirstock.firstock_ModifyOrder(
    norenordno='norenordno', #Replace with the norenordno
    quantity='',
    triggerPrice='',
    price='',
    exchange='',
    tradingSymbol='',
    priceType='',
    norenordno='norenordno', #Replace with the norenordno
) 
curl -X POST 'https://connect.thefirstock.com/api/modifyOrder' \
     -H 'Content-Type: application/json' \
     -d '{
          "userId": "",
          "jKey": "",
          "quantity": "",
          "price": "",
          "triggerPrice": "",
          "norenordno": "",
          "exchange": "",
          "tradingSymbol": "",
          "priceType": ""
          "norenordno": ""
        }'
const Firstock = require('thefirstock');

const firstock = new Firstock();

firstock.modifyOrder({
    norenordno: "",
    price: "",
    quantity: "",
    triggerPrice: "",
    tradingSymbol:"",
    exchange:"",
    priceType:""
}, (err, result) => {
    console.log("Error, ", err)
    console.log("Result: ", result)
})
using thefirstock;

class Program
{
public static void Main()
{
    Firstock firstock = new Firstock();
    var result = firstock.modifyOrder(
        norenordno: "22060400000811",
        price: "240",
        quantity: "1",
        triggerPrice: "265",
        tradingSymbol: "ITC-EQ",
        exchange: "",
        priceType: "LMT"
        );
}
}

Response Details

Parameter Description
stat Ok or Not_Ok Place order success or failure indication
result Noren Order number of the canceled order.
requestTime Response received time.
emsg This will be present only if Order cancelation fails

Sample Response

{
"request_time":"15:18:15 31-05-2022",
"stat":"Ok",
"result":"22053100006053"
}    
{
"request_time":"16:01:48 28-05-2020",
"stat":"Not_Ok",
"emsg":"Rejected : Rejected : ORA:Order not found"
}