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: /apiV2/modifyOrder

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

Request Details

Parameter Description
orderNumber orderNumber, which needs to be modified
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

curl --X POST 'https://connect.thefirstock.com/apiV2/modifyOrder' \
    --H 'Content-Type: application/json' \
    --d '{
        "userId": "",
        "jKey": "",
        "quantity": "",
        "price": "",
        "triggerPrice": "",
        "orderNumber": "",
        "exchange": "",
        "tradingSymbol": "",
        "priceType": ""
    }'
from thefirstock import thefirstock

modifyOrder = thefirstock.firstock_ModifyOrder(
    orderNumber="",
    quantity="",
    price="",
    triggerPrice="",
    exchange="",
    tradingSymbol="",
    priceType=""
)
const Firstock = require('thefirstock');

const firstock = new Firstock();

firstock.modifyOrder({
    orderNumber: "",
    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(
        orderNumber: "22060400000811",
        price: "240",
        quantity: "1",
        triggerPrice: "265",
        tradingSymbol: "ITC-EQ",
        exchange: "",
        priceType: "LMT"
        );
}
}

Success Response Details

Parameter Description
Status Success
data.orderNumber orderNumber of the modified order.
data.requestTime Response received time.

Failure Response Details

Parameter Description
Status Failed
data Type of error
requestTime Response received time.

Sample Response

{
"Status": "Success",
"data": {
        "requestTime": "",
        "orderNumber": ""
        }
    ]
}  
   {
     "Status": "Failed",
     "data": "Rejected : ORA:Order not found",
     "requestTime": ""
    }