Skip to content

Order Book

When an order is placed, the status of the order can be viewed in the order book (Open, Executed, canceled, rejected)


POST: /apiV2/orderBook

https://connect.thefirstock.com/apiV2/orderBook

Request Details

Parameter Description
userId User Id of the login user
exchange NSE / NFO / BSE

Code

curl --X POST 'https://connect.thefirstock.com/apiV2/orderBook' \
--H 'Content-Type: application/json' \
--d '{
    "userId": "",
    "jKey": ""
}'
from thefirstock import thefirstock

orderBook = thefirstock.firstock_orderBook()
const Firstock = require('thefirstock');

const firstock = new Firstock();

firstock.orderBook((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.orderBook();
}
}

Success Response Details

Parameter Description
Status Success
data.userId User Id of the login user
data.orderNumber orderNumber
data.exchange Exchange Segment
data.tradingSymbol Trading symbol / contract on which order is placed.
data.quantity Order Quantity
data.transactionType B / S trantype B / S Transaction type of the order
data.priceType LMT / MKT
data.retention DAY / IOC / EOS Order validity
data.token Token of the given symbol
data.lotSize Lot size
data.tickSize Tick size
data.price Price of the order
data.product Display product alias name, using prarr returned in user details.
data.status SUCCESS/REJECTED/CANCELLED
data.orderTime Time of the order execution
data.exchordid Exchange Order Number
data.fillshares Total Traded Quantity of this order
data.averagePrice Average trade price of total traded quantity
data.remarks Any message Entered during order entry.
data.disclosedQuantity disclosed quantity
data.rejectReason Reason for the rejection of the order

Failure Response Details

Parameter Description
Status Failed
data Type of error

Sample Response

{
 "Status": "Success",
 "data": [
         {
            "userId": "",
            "orderNumber": "",
            "exchange": "NSE",
            "tradingSymbol": "ITC-EQ",
            "quantity": "1",
            "transactionType": "B",
            "priceType": "MKT",
            "retention": "DAY",
            "token": "1660",
            "lotSize": "1",
            "tickSize": "0.05",
            "price": "300.00",
            "product": "I",
            "status": "REJECTED",
            "orderTime": "11:28:18 11-10-2022",
            "fillShares": "",
            "averagePrice": "",
            "remarks": "Test",
            "rejectReason": ""
        },
        {
            "userId": "",
            "orderNumber": "",
            "exchange": "NSE",
            "tradingSymbol": "ITC-EQ",
            "quantity": "1",
            "transactionType": "B",
            "priceType": "MKT",
            "retention": "DAY",
            "token": "1660",
            "lotSize": "1",
            "tickSize": "0.05",
            "price": "300.00",
            "product": "I",
            "status": "COMPLETE",
            "orderTime": "11:24:16 11-10-2022",
            "fillShares": "",
            "averagePrice": "",
            "remarks": "Test",
        }
    ]
}
 {
  "Status": "Failed",
  "data": "Session Expired :  Invalid Session Key"
}