Multi place order
This API allows us to place multiple orders up to 10, the order number of each order will be printed out as a list.
Method : POST
https://connect.thefirstock.com/api/V3/strategies/multiPlaceOrders
Request details
Parameter | Description | Data types | Example |
---|---|---|---|
userId | User Id of the login user | String | "AA1999" |
data | list of place orders | List | list of place orders |
jKey | Key Obtained on login success. | String | "28fa3983bd7a6334848b eeb7358ab57fccf19d46a b16c7dac81bf154e65061ce" |
Request details for data
Parameter | Description | Data types | Example |
---|---|---|---|
data.exchange | NSE / NFO / BSE | String | "NSE" |
data.tradingSymbol | Trading Symbol (use url encoding to avoid special char error for symbols like M&M) NSE NFO | String | "ITC-EQ" |
data.quantity | Order Quantity | String | "1" |
data.price | Order Price | String | "0" |
data.triggerPrice | Only to be sent in case of SL / SL-M order | String | "SL" |
data.product | C / M / I C -> Cash and Carry, M -> F&O Normal, I -> Intraday. | String | "I" |
data.priceType | LMT / MKT / SL-LMT / SL-MKT | String | "MKT" |
data.retention | DAY / EOS / IOC | String | "DAY" |
data.transactionType | B / S B -> BUY, S -> SELL | String | "S" |
data.remarks | User can send remarks for the order | String | "Test1" |
- cURL
curl --location 'https://connect.thefirstock.com/api/V3/strategies/multiPlaceOrders' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38",
"data": [
{
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"quantity": "1",
"price": "0",
"product": "I",
"transactionType": "S",
"priceType": "MKT",
"retention": "DAY",
"triggerPrice": "800",
"remarks": "Test1"
},
{
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"quantity": "1",
"price": "0",
"product": "I",
"transactionType": "S",
"priceType": "MKT",
"retention": "DAY",
"triggerPrice": "800",
"remarks": "Test1"
}
]
}'
from thefirstock import thefirstock
MPL = thefirstock.firstock_MultiPlaceOrder(
dataList=[
{
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"quantity": "1",
"price": "0",
"product": "I",
"transactionType": "S",
"priceType": "MKT",
"retention": "DAY",
"triggerPrice": "800",
"remarks": "Test1"
},
{
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"quantity": "1",
"price": "0",
"product": "I",
"transactionType": "S",
"priceType": "MKT",
"retention": "DAY",
"triggerPrice": "800",
"remarks": "Test2"
},
{
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"quantity": "1",
"price": "0",
"product": "I",
"transactionType": "S",
"priceType": "MKT",
"retention": "DAY",
"triggerPrice": "800",
"remarks": "Test3"
},
{
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"quantity": "1",
"price": "0",
"product": "I",
"transactionType": "S",
"priceType": "MKT",
"retention": "DAY",
"triggerPrice": "800",
"remarks": "Test1"
}
]
)
constFirstock = require("thefirstock");
constfirstock = newFirstock();
firstock.multiPlaceOrder(
{
data: [
{
exchange: "NSE",
tradingSymbol: "ITC-EQ",
quantity: "1",
price: "0",
product: "I",
transactionType: "S",
priceType: "MKT",
retention: "DAY",
triggerPrice: "800",
remarks: "Test1",
},
],
},
(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.multiPlaceOrder(data: new List<multiPlaceOrderObject>(){
new multiPlaceOrderObject{
exchange="NSE",
tradingSymbol="ITC-EQ",
quantity="1",
price="1200",
product="I",
transactionType="S",
priceType="MKT",
retention="DAY",
triggerPrice="800",
remarks="test"
}
}
);
}
}
Success response details
Parameter | Description | Data types | Example |
---|---|---|---|
status | Success | String | "Success" |
data.requestTime | Response received time. | String | "18:53:14 15-02-2023" |
data.orderNumber | It will be present only on successful Order placement to OMS. | String | "1234567890111" |
Failure response details
Parameter | Description | Data Type | Example |
---|---|---|---|
status | Failed | String | "Failed" |
code | HTTP Code | String | "200" |
data | Data | String | "Invalid Session Key" |
Sample response
- Success response
- Failure response
[
{
status: "Success",
data: {
requestTime: "18:53:14 15-02-2023",
orderNumber: "1234567890111",
},
},
{
status: "Success",
data: {
requestTime: "18:53:14 15-02-2023",
orderNumber: "1234567890111",
},
},
];
[
{
status: "Failed",
data: "Session Expired : Invalid Session Key",
},
{
status: "Failed",
data: "Session Expired : Invalid Session Key",
},
];