Skip to main content

Modify order

When working at the market, one often needs to modify or delete the placed pending order.

While an order remains open or pending in the system, certain elements of it can be adjusted.

Method: POST

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

Request details

ParameterDescriptionData typesExample
orderNumberorderNumber, which needs to be modifiedString"1234567890111"
priceModified / New priceString"240"
quantityModified / New QuantityString"1"
triggerPriceNew trigger price in case of SL-MKT or SL-LMTString"N"
userIdUser id of the logged in user.String"AA1999"
jKeyKey Obtained on login success.String"d9b4e1b1c79042476fd96
11eed81003b2d34c3f13b0
b60a4842fd5a24c9f3f2"
exchangeNSE / NFO / BSE / BFOString"NSE"
tradingSymbolTrading Symbol (use url encoding to avoid special char error for symbols like M&M) NSE NFOString"NFO"
priceTypeLMT / MKT / SL-LMT / SL-MKTString"LMT"
curl --location 'https://connect.thefirstock.com/api/V3/modifyOrder' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38",
"quantity": "1",
"price": "301",
"triggerPrice": "301",
"orderNumber": "11030800009600",
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"priceType": "LMT"
}'

Success response details

ParameterDescriptionData typesExamples
StatusSuccessString"Success"
data.orderNumberorderNumber of the modified order.String"1234567890111"
data.requestTimeResponse received time.String"14:51:30 15-02-2023"

Failure response details

ParameterDescriptionData TypeExample
statusFailedString"Failed"
codeHTTP CodeString"400"
nameType of errorString"BAD_REQUEST"
error.fieldError fieldString"priceType"
error.messageError messageString"priceType cannot be undefined or NULL"

Sample response

{
"status": "Success",
"data": {
"requestTime": "14:51:30 15-02-2023",
"orderNumber": "1234567890111"
}
}