Place Order
The place order APIs allow you to place your orders in our system.
You will get the order confirmation instantly with order_id.
POST: /api/placeOrder
https://connect.thefirstock.com/api/placeOrder
Request Details**
Parameter | Description |
---|---|
userId | User Id of the login user |
actid | Login users account ID |
exchange | NSE / NFO / BSE |
tradingSymbol | Trading Symbol (use url encoding to avoid special char error for symbols like M&M) NSE NFO |
quantity | Order Quantity |
price | Order Price |
triggerPrice | Only to be sent in case of SL / SL-M order |
product | C / M / I C -> Cash and Carry, M -> F&O Normal, I -> Intraday |
transactionType | B / S B -> BUY, S -> SELL |
priceType | LMT / MKT / SL-LMT / SL-MKT |
retention | DAY / EOS / IOC |
jKey | Key Obtained on login success. |
Code
from thefirstock import thefirstock
placeOrder = thefirstock.firstock_placeOrder(
exchange='NSE',
tradingSymbol='ITC-EQ',
quantity='10',
price='240',
product='C',
transactionType='B',
priceType='LMT',
retention='DAY',
triggerPrice='',
remarks='Strategy1',
)
curl -X POST 'https://connect.thefirstock.com/api/placeOrder' \
-H 'Content-Type: application/json' \
-d '{
"userId": "",
"actid": "",
"exchange": "",
"tradingSymbol": "",
"quantity": "",
"price": "",
"product": "",
"transactionType": "",
"priceType": "",
"retention": "",
"triggerPrice": "",
"remarks": "",
"jKey": ""
}'
const Firstock = require('thefirstock');
const firstock = new Firstock();
firstock.placeOrder({
"exchange": "",
"tradingSymbol": "",
"quantity": "",
"price": "",
"product": "",
"transactionType": "",
"priceType": "",
"retention": "",
"triggerPrice": "",
"remarks": ""
}, (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.placeOrder(
exchange: "NSE",
tradingSymbol: "ITC-EQ",
quantity: "1",
price: "240",
product: "C",
transactionType: "B",
priceType: "LMT",
retention: "DAY",
triggerPrice: "",
remarks: "Strategy1");
}
}
Response Details
Parameter | Description |
---|---|
stat | Ok or Not_Ok Place order success or failure indication. |
requestTime | Response received time. |
emsg | This will be present only if Order placement fails |
norenordno | It will be present only on successful Order placement to OMS. |
Sample Response
{
"request_time": "23:45:04 29-05-2022",
"stat": "Ok",
"norenordno": "22052800000038"
}
{
"stat": "Not_Ok",
"request_time": "20:40:01 19-05-2020",
"emsg": "Error Occurred : 2 \"invalid input\""
}