Skip to main content

Order & Report

Place Order

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/V4/placeOrder

Request details

Order Placement API Parameters
Parameter Description Example
userId
String
Identifier for the user upon login, unique
to each user in the system.
AA0013
exchange
String
Exchange on which the order is placed
(e.g., NSE, BSE, NFO, BFO)
NFO
tradingSymbol
String
Encoded trading symbol of the security ITC-EQ
quantity
String
Number of shares or contracts to be traded 10
price
String
Price at which the order is to be executed 260
triggerPrice
String
Trigger price for stop-loss orders 0
product
String
Product code indicating the type of trade
C -> Cash and Carry,
M -> F&O Normal,
I -> Intraday
C
transactionType
String
Transaction type, either Buy (B) or Sell (S) B
priceType
String
Type of order pricing
(e.g., LMT / MKT / SL-LMT / SL-MKT)
LMT
retention
String
Order validity terms
(e.g., DAY / EOS / IOC)
DAY
remarks
String
Remarks or notes associated with the order place order
jKey
String
Authentication key obtained after
successful login
d9b4e1b1c79042476fd9611eed

Libraries and SDKs

Tabbed Interface
from thefirstock import thefirstock

placeOrder = thefirstock.firstock_placeOrder(
    userId="{{userId}}",
    exchange="NSE",
    tradingSymbol="ITC-EQ",
    quantity="1",
    price="300",
    product="I",
    transactionType="B",
    priceType="LMT",
    retention="DAY",
    triggerPrice="0",
    remarks="Python Package Order"
)
curl --location --request POST 'https://connect.thefirstock.com/api/V4/placeOrder' \
--header 'Content-Type: application/json' \
--data-raw '{
    "userId": "{{userId}}",
    "exchange": "NSE", 
    "tradingSymbol": "ITC-EQ",
    "quantity": "250",
    "price": "413",
    "product": "C",
    "transactionType": "B",
    "priceType": "LMT",
    "retention": "DAY",
    "triggerPrice": "0",
    "remarks": "Place Order",
    "jKey": "{{jKey}}"
}'
const Firstock = require("thefirstock");

const firstock = new Firstock();

firstock.placeOrder(
  {
    userId: {{userId}},
    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(
          userId: {{userId}},
          exchange: "NSE",
          tradingSymbol: "ITC-EQ",
          quantity: "1",
          price: "240",
          product: "C",
          transactionType: "B",
          priceType: "LMT",
          retention: "DAY",
          triggerPrice: "0",
          remarks: "Strategy1");
    }
}

Success response details

API Parameters
Parameter Description Example
status
String
Indicates the outcome of the API request success
data.requestTime
String
Timestamp indicating when the response
was received
14:10:13 15-02-2023
data.orderNumber
String
Unique identifier for the order,
provided upon successful placement
1234567890111
{  
  "status": "success",
  "data": {
  	"requestTime": "14:10:13 15-02-2023", 
  	"orderNumber": "1234567890111" 
  }
}

Failure response details

Error Parameters
Parameter Description Example
status
String
Indicates the result status of the operation failed
code
String
HTTP status code associated with the error 400
name
String
Describes the type of error encountered BAD_REQUEST
error.field
String
Field in the request that triggered the error transactionType
error.message
String
Detailed message describing the
nature of the error
transactionType cannot be
undefined or NULL
{ 
  "status": "failed",
  "code": "400",
  "name": "BAD_REQUEST", 
  "error": {  
    "field": "transactionType", 
    "message": "transactionType cannot be undefined or NULL"  
  }
}