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
Parameter | Description | Data types | Example |
---|---|---|---|
userId | User Id of the login user | String | "AA1999" |
exchange | NSE / NFO / BSE / BFO | String | "NSE" |
- cURL
curl --location 'https://connect.thefirstock.com/api/V3/orderBook' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38"
}'
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 | Data types | Examples |
---|---|---|---|
Status | Success | String | "Success" |
data.userId | User Id of the login user | String | "AA199" |
data.orderNumber | order number | String | "1234567890111" |
data.exchange | Exchange Segment | String | "NSE" |
data.tradingSymbol | Trading symbol / contract on which order is placed. | String | "ITC-EQ" |
data.transactionType | B / S trantype B / S Transaction type of the order | String | "1" |
data.priceType | LMT / MKT | String | "LMT" |
data.retention | DAY / IOC / EOS Order validity | String | "DAY" |
data.token | Token of the given symbol | String | "1660" |
data.lotSize | Lot size | String | "1" |
data.tickSize | Tick size | String | "0.05" |
data.price | Price of the order | String | "0.00" |
data.product | Display product alias name, using prarr returned in user details. | String | "M" |
data.status | SUCCESS/REJECTED/CANCELLED | String | "REJECTED" |
data.orderTime | Time of the order execution | String | "14:10:13 15-02-2023" |
data.fillshares | Total Traded quantity of this order | String | "0" |
data.averagePrice | Average trade price of total traded quantity | String | "0" |
data.remarks | Any message Entered during order entry. | String | "orderbook" |
data.quantity | disclosed quantity | String | "0" |
data.rejectReason | Reason for the rejection of the order | String | "ORA:Product Regular not enabled on exchange NSE" |
Failure response details
Parameter | Description | Data Type | Example |
---|---|---|---|
status | Failed | String | "Failed" |
code | HTTP Code | String | "401" |
name | Type of error | String | "INVALID_JKEY" |
error.field | Error field | String | "jKey" |
error.message | Error message | String | "jKey parameter is invalid" |
Sample response
- Success response
- Failure 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"
}
]
}
{
"status": "Failed",
"code": "401",
"name": "INVALID_JKEY",
"error": {
"field": "jKey",
"message": "jKey parameter is invalid"
}
}