Trade book
When an order is actually executed on the exchange within the stipulated conditions, the actual execution status along with the trade number gets reflected in the Trade Book in your online account.
It furnishes a comprehensive rundown of the completed trades for the ongoing trading day
Method: POST
https://connect.thefirstock.com/api/V3/tradeBook
Request details
Parameter | Description | Data types | Example |
---|---|---|---|
userId | User Id of the login user | String | "AA1999" |
jKey | Key Obtained on login success. | String | "d9b4e1b1c79042476fd9611eed81003b2dc 34c3f13b0b60a4842fd5a24c9f3f2" |
- cURL
curl --location 'https://connect.thefirstock.com/api/V3/tradeBook' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38"
}'
from thefirstock import thefirstock
tradeBook = thefirstock.firstock_TradeBook()
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.tradeBook((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.tradeBook();
}
}
Response success details
Response data will be in json Array of objects with below fields in case of success.
Parameter | Description | Data types | Examples |
---|---|---|---|
Status | Success | String | "Success" |
data.userId | UserId of the login user | String | "AA0011" |
data.exchange | Exchange Segment | String | "NFO" |
data.priceType | LMT / MKT Price type | String | "MKT" |
data.retention | DAY / IOC / EOS | String | "DAY" |
data.product | Display product alias name, using prarr returned in user details. | String | "I" |
data.fillId | Fill ID | String | "607999000" |
data.fillTime | Fill Time | String | "17-02-2023 14:15:50" |
data.transactionType | B/S Transaction type of the order | String | "B" |
data.tradingSymbol | Trading symbol / contract on which order is placed. | String | "BANKNIFTY23FEB23P40000" |
data.quantity | Order Quantity | String | "25" |
data.token | Contract Token | String | "57828" |
data.fillshares | Total Traded Quantity of this order | String | "25" |
data.pricePrecision | Price precision | String | "2" |
data.lotSize | Lot size | String | "25" |
data.tickSize | Tick size | String | "0.05" |
data.fillPrice | Fill Price | String | "63.65" |
data.fillQuantity | Fill Quantity | String | "25" |
data.exchordid | Exchange Order Number | String | "189654321235" |
data.orderNumber | orderNumber | String | "1234567890111" |
data.priceFactor | priceFactor | String | "1.000000" |
data.orderTime | orderTime | String | "14:15:50 17-02-2023" |
data.fillPrice | fillPrice | String | "63.65" |
data.exchangeUpdateTime | Update time of exchange | String | "17-02-2023 14:15:50" |
Failure response details
Parameter | Description | Data Type | Example |
---|---|---|---|
status | Failed | String | "Failed" |
code | HTTP Code | String | "404" |
name | Type of error | String | "ORDERS_NOT_FOUND" |
error.field | Error field | String | "orderDetails" |
error.message | Error message | String | "No data on the orders was found" |
Sample response
- Success response
- Failure response
{
"status": "Success",
"data": [
{
"orderNumber": "1234567890111",
"userId": "AA0011",
"exchange": "NFO",
"tradingSymbol": "BANKNIFTY23FEB23P40000",
"quantity": "25",
"transactionType": "B",
"priceType": "MKT",
"retention": "DAY",
"token": "57828",
"priceFactor": "1.000000",
"pricePrecision": "2",
"lotSize": "25",
"tickSize": "0.05",
"product": "I",
"orderTime": "14:15:50 17-02-2023",
"fillId": "607999000",
"fillTime": "17-02-2023 14:15:50",
"fillshares": "25",
"fillQuantity": "25",
"fillPrice": "63.65",
"exchordid": "189654321235",
"exchangeUpdateTime": "17-02-2023 14:15:50"
},
]
}
{
"status": "Failed",
"code": "404",
"name": "ORDERS_NOT_FOUND",
"error": {
"field": "orderDetails",
"message": "No data on the orders was found"
}
}