Place order
A Buyer or Seller is matched with your order, and the trade is executed.
The Place Order API provides a seamless and efficient way for you to submit your orders directly into our system.
You will receive an immediate confirmation of your order with a unique order number.
Method: POST
https://connect.thefirstock.com/api/V3/placeOrder
Request details
Parameter | Description | Data types | Example |
---|---|---|---|
userId | User Id of the login user | String | "AA1999" |
exchange | NSE / NFO / BSE / BFO | String | "NFO" |
tradingSymbol | Trading Symbol (use url encoding to avoid special char error for symbols like M&M) NSE NFO | String | "ITC-EQ" |
quantity | Order Quantity | String | "10" |
price | Order Price | String | "260" |
triggerPrice | Only to be sent in case of SL / SL-M order | String | "0" |
product | C / M / I C -> Cash and Carry, M -> F&O Normal, I -> Intraday | String | "C" |
transactionType | B / S B -> BUY, S -> SELL | String | "B" |
priceType | LMT / MKT / SL-LMT / SL-MKT | String | "LMT" |
retention | DAY / EOS / IOC | String | "DAY" |
remarks | User can send remarks for the order | String | "place order" |
jKey | Key Obtained on login success. | String | "d9b4e1b1c79042476fd96 11eed81003b2dc34c3f13b 0b60a4842fd5a24c9f3f2" |
- cURL
curl --location 'https://connect.thefirstock.com/api/V3/placeOrder' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"quantity": "1",
"price": "300",
"product": "I",
"transactionType": "B",
"priceType": "LMT",
"retention": "DAY",
"triggerPrice": "0",
"remarks": "curl Package Order",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38"
}'
from thefirstock import thefirstock
placeOrder = thefirstock.firstock_placeOrder(
exchange="NSE",
tradingSymbol="ITC-EQ",
quantity="1",
price="300",
product="I",
transactionType="B",
priceType="LMT",
retention="DAY",
triggerPrice="0",
remarks="Python Package Order"
)
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.placeOrder(
{
exchange: "NSE",
tradingSymbol: "ITC-EQ",
quantity: "1",
price: "300",
product: "I",
transactionType: "B",
priceType: "LMT",
retention: "DAY",
triggerPrice: "0",
remarks: "place order",
},
(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: "0",
remarks: "Strategy1");
}
}
Success response details
Parameter | Description | Data types | Examples |
---|---|---|---|
status | Success | String | "Success" |
data.requestTime | Response received time. | String | "14:10:13 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 | "400" |
name | Type of error | String | "BAD_REQUEST" |
error.field | Error field | String | "transactionTypes" |
error.message | Error message | String | "transactionType cannot be undefined or NULL" |
Sample response
- Success response
- Failure response
{
"status": "Success",
"data": {
"requestTime": "14:10:13 15-02-2023",
"orderNumber": "1234567890111"
}
}
{
"status": "Failed",
"code": "400",
"name": "BAD_REQUEST",
"error": {
"field": "transactionType",
"message": "transactionType cannot be undefined or NULL"
}
}