Skip to main content

Order book

An order book is a list of transactions, whether they are to buy or sell stocks, futures or options.

Order status can be monitored and updated in the order book, which displays the current status of each order as Open, Executed, Canceled, or Rejected.

Method: POST

https://connect.thefirstock.com/api/V3/orderBook

Request details

ParameterDescriptionData typesExample
userIdUser Id of the login userString"AA1999"
exchangeNSE / NFO / BSE / BFOString"NSE"
curl --location 'https://connect.thefirstock.com/api/V3/orderBook' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38"
}'

Success response details

ParameterDescriptionData typesExamples
StatusSuccessString"Success"
data.userIdUser Id of the login userString"AA199"
data.orderNumberorder numberString"1234567890111"
data.exchangeExchange SegmentString"NSE"
data.tradingSymbolTrading symbol / contract on which order is placed.String"ITC-EQ"
data.transactionTypeB / S trantype B / S Transaction type of the orderString"1"
data.priceTypeLMT / MKTString"LMT"
data.retentionDAY / IOC / EOS Order validityString"DAY"
data.tokenToken of the given symbolString"1660"
data.lotSizeLot sizeString"1"
data.tickSizeTick sizeString"0.05"
data.pricePrice of the orderString"0.00"
data.productDisplay product alias name,
using prarr returned in user details.
String"M"
data.statusSUCCESS/REJECTED/CANCELLEDString"REJECTED"
data.orderTimeTime of the order executionString"14:10:13 15-02-2023"
data.fillsharesTotal Traded quantity of this orderString"0"
data.averagePriceAverage trade price of total
traded quantity
String"0"
data.remarksAny message Entered during order entry.String"orderbook"
data.quantitydisclosed quantityString"0"
data.rejectReasonReason for the rejection of the orderString"ORA:Product Regular not enabled on exchange NSE"

Failure response details

ParameterDescriptionData TypeExample
statusFailedString"Failed"
codeHTTP CodeString"401"
nameType of errorString"INVALID_JKEY"
error.fieldError fieldString"jKey"
error.messageError messageString"jKey parameter is invalid"

Sample response

{
"status": "Success",
"data": [
{
"userId": "AA199",
"orderNumber": "1234567890111",
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"quantity": "1",
"transactionType": "B",
"priceType": "LMT",
"retention": "DAY",
"token": "1660",
"lotSize": "1",
"tickSize": "0.05",
"price": "0.00",
"product": "M",
"status": "REJECTED",
"orderTime": "14:19:03 15-02-2023",
"fillShares": "",
"averagePrice": "",
"remarks": "orderbook",
"rejectReason": "ORA:Product Regular not enabled on exchange NSE"
},
{
"userId": "AA199",
"orderNumber": "1234567890111",
"exchange": "NSE",
"tradingSymbol": "ITC-EQ",
"quantity": "1",
"transactionType": "B",
"priceType": "LMT",
"retention": "DAY",
"token": "1660",
"lotSize": "1",
"tickSize": "0.05",
"price": "0.00",
"product": "M",
"status": "REJECTED",
"orderTime": "14:10:13 15-02-2023",
"fillShares": "",
"averagePrice": "",
"remarks": "orderbook",
"rejectReason": "ORA:Product Regular not enabled on exchange NSE"
}
]
}