Skip to content

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.


POST: /apiV2/strategies/multiPlaceOrders

https://connect.thefirstock.com/apiV2/strategies/multiPlaceOrders

Request Details

Parameter Description
userId User Id of the login user
data list of place orders
jKey Key Obtained on login success.

Request Details for data

Parameter Description
data.exchange NSE / NFO / BSE
data.tradingSymbol Trading Symbol (use url encoding to avoid special char error for symbols like M&M) NSE NFO
data.quantity Order Quantity
data.price Order Price
data.triggerPrice Only to be sent in case of SL / SL-M order
data.product C / M / I C -> Cash and Carry, M -> F&O Normal, I -> Intraday.
data.priceType LMT / MKT / SL-LMT / SL-MKT
data.retention DAY / EOS / IOC
data.transactionType B / S B -> BUY, S -> SELL
data.remarks User can send remarks for the order

Code

curl --X POST 'https://connect.thefirstock.com/apiV2/strategies/multiPlaceOrders' \
--H 'Content-Type: application/json' \
--d '{
    "userId": "",
    "jKey": "",
    "data": [
            {
                "exchange": "",
                "tradingSymbol": "",
                "quantity": "",
                "price": "",
                "product": "",
                "transactionType": "",
                "priceType": "",
                "retention": "",
                "triggerPrice": "",
                "remarks": ""
            },
            {
                "exchange": "",
                "tradingSymbol": "",
                "quantity": "",
                "price": "",
                "product": "",
                "transactionType": "",
                "priceType": "",
                "retention": "",
                "triggerPrice": "",
                "remarks": ""
            }
        ]
    }'
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": "",
            "remarks": ""
        },
        {
            "exchange": "NSE",
            "tradingSymbol": "ITC-EQ",
            "quantity": "1",
            "price": "0",
            "product": "I",
            "transactionType": "S",
            "priceType": "MKT",
            "retention": "DAY",
            "triggerPrice": "",
            "remarks": "Test2"
        },
        {
            "exchange": "NSE",
            "tradingSymbol": "ITC-EQ",
            "quantity": "1",
            "price": "0",
            "product": "I",
            "transactionType": "S",
            "priceType": "MKT",
            "retention": "DAY",
            "triggerPrice": "",
            "remarks": "Test3"
        },
        {
            "exchange": "NSE",
            "tradingSymbol": "ITC-EQ",
            "quantity": "1",
            "price": "0",
            "product": "I",
            "transactionType": "S",
            "priceType": "MKT",
            "retention": "DAY",
            "triggerPrice": "",
            "remarks": "Test1"
        }
    ]
)
const Firstock = require('thefirstock');

const firstock = new Firstock();
firstock.multiPlaceOrder(
 {
data: [
  {
    exchange: "NSE",
    tradingSymbol: "ITC-EQ",
    quantity: "1",
    price: "0",
    product: "I",
    transactionType: "S",
    priceType: "MKT",
    retention: "DAY",
    triggerPrice: "",
    remarks: "Test1",
  },
],
},
(err, result) => {
console.log("Error, ", err);
console.log("Result: ", result);
 }
);
          var result = firstock.multiPlaceOrder(exchange: "BSE",
                                         tradingSymbol: "SAIL01DEC22P99",
                                         quantity: "1",
                                         transactionType: "S",
                                         price: "350",
                                         product: "C",
                                         priceType: "lmt",
                                         data: new List<multiPlaceOrderObject>()
                                         {
                                     new multiPlaceOrderObject(
                                         exchange: "BSE",
                                         tradingSymbol:"SAIL01DEC22P99",
                                         quantity:"1",
                                         transactionType:"S",
                                         price:"350",
                                         priceType:"lmt",
                                         product:"C"
                                          )
                                         }
                     );

Success Response Details

Parameter Description
data.requestTime Response received time.
data.orderNumber It will be present only on successful Order placement to OMS.

Failure Response Details

Parameter Description
Status Failed
data Type of error

Sample Response

[
{
    "Status": "Success",
    "data": {
        "requestTime": "14:49:28 07-11-2022",
        "orderNumber": ""
    }
},
{
    "Status": "Success",
    "data": {
        "requestTime": "14:49:28 07-11-2022",
        "orderNumber": ""
    }
},
{
    "Status": "Success",
    "data": {
        "requestTime": "14:49:29 07-11-2022",
        "orderNumber": ""
    }
},
{
    "Status": "Success",
    "data": {
        "requestTime": "14:49:29 07-11-2022",
        "orderNumber": ""
    }
},
{
    "Status": "Success",
    "data": {
        "requestTime": "14:49:29 07-11-2022",
        "orderNumber": ""
    }
},
{
    "Status": "Success",
    "data": {
        "requestTime": "14:49:29 07-11-2022",
        "orderNumber": ""
    }
}
]
[
{
  "Status": "Failed",
  "data": "Invalid Input :   Invalid Trading Symbol"
},
{
  "Status": "Failed",
  "data": "Invalid Input :   Invalid Trading Symbol"
},
{
  "Status": "Failed",
  "data": "Invalid Input :   Invalid Trading Symbol"
},
{
  "Status": "Failed",
  "data": "Invalid Input :   Invalid Trading Symbol"
}
]