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
Parameter | Description | Data types | Example |
---|---|---|---|
orderNumber | orderNumber, which needs to be modified | String | "1234567890111" |
price | Modified / New price | String | "240" |
quantity | Modified / New Quantity | String | "1" |
triggerPrice | New trigger price in case of SL-MKT or SL-LMT | String | "N" |
userId | User id of the logged in user. | String | "AA1999" |
jKey | Key Obtained on login success. | String | "d9b4e1b1c79042476fd96 11eed81003b2d34c3f13b0 b60a4842fd5a24c9f3f2" |
exchange | NSE / NFO / BSE / BFO | String | "NSE" |
tradingSymbol | Trading Symbol (use url encoding to avoid special char error for symbols like M&M) NSE NFO | String | "NFO" |
priceType | LMT / MKT / SL-LMT / SL-MKT | String | "LMT" |
- cURL
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"
}'
from thefirstock import thefirstock
modifyOrder = thefirstock.firstock_ModifyOrder(
orderNumber="11030800009600",
quantity="1",
price="301",
triggerPrice="301",
exchange="NSE",
tradingSymbol="ITC-EQ",
priceType="LMT"
)
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.modifyOrder(
{
orderNumber: "11030800009600",
price: "301",
quantity: "1",
triggerPrice: "301",
tradingSymbol: "ITC-EQ",
exchange: "NSE",
priceType: "LMT",
},
(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: "11030800009600",
price: "240",
quantity: "1",
triggerPrice: "265",
tradingSymbol: "ITC-EQ",
exchange: "NSE",
priceType: "LMT"
);
}
}
Success response details
Parameter | Description | Data types | Examples |
---|---|---|---|
Status | Success | String | "Success" |
data.orderNumber | orderNumber of the modified order. | String | "1234567890111" |
data.requestTime | Response received time. | String | "14:51:30 15-02-2023" |
Failure response details
Parameter | Description | Data Type | Example |
---|---|---|---|
status | Failed | String | "Failed" |
code | HTTP Code | String | "400" |
name | Type of error | String | "BAD_REQUEST" |
error.field | Error field | String | "priceType" |
error.message | Error message | String | "priceType cannot be undefined or NULL" |
Sample response
- Success response
- Failure response
{
"status": "Success",
"data": {
"requestTime": "14:51:30 15-02-2023",
"orderNumber": "1234567890111"
}
}
{
"status": "Failed",
"code": "400",
"name": "BAD_REQUEST",
"error": {
"field": "priceType",
"message": "priceType cannot be undefined or NULL"
}
}