Skip to content

Trade Book

It provides the executed trades details for the current trading day.


POST: /apiV2/tradeBook

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

Request Details

Parameter Description
userId User Id of the login user
jKey Key Obtained on login success.

Code

curl --X POST 'https://connect.thefirstock.com/apiV2/tradeBook' \
--H 'Content-Type: application/json' \
--d '{
    "userId": "",
    "jKey": ""
}'
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.requestTime Response received time.
Status Success
data.userId UserId of the login user
data.exchange Exchange Segment
data.priceType LMT / MKT Price type
data.retention DAY / IOC / EOS
data.product Display product alias name, using prarr returned in user details.
data.fillId Fill ID
data.fillTime Fill Time
data.transactionType B/S Transaction type of the order
data.tradingSymbol Trading symbol / contract on which order is placed.
data.quantity Order Quantity
data.token Contract Token
data.fillshares Total Traded Quantity of this order
data.pricePrecision Price precision
data.lotSize Lot size
data.tickSize Tick size
data.price Order Price
data.fillPrice Fill Price
data.fillQuantity Fill Quantity
data.remarks Message entered during order entry
data.exchordid Exchange Order Number
data.orderNumber orderNumber
data.exchangeUpdateTime Update time of exchange

Response Failure Details

Response data will be in json format with below fields in case of failure:

Parameter Description
Status Failed
requestTime Response received time.
emsg Error message

Sample Response

{
"Status": "Success",
"data": {
            "orderNumber": "",
            "userId": "",
            "exchange": "NSE",
            "tradingSymbol": "ITC-EQ",
            "quantity": "1",
            "transactionType": "S",
            "priceType": "MKT",
            "retention": "DAY",
            "token": "1660",
            "priceFactor": "1.000000",
            "pricePrecision": "2",
            "lotSize": "1",
            "tickSize": "0.05",
            "product": "I",
            "orderTime": "13:42:29 11-10-2022",
            "fillId": "28424654",
            "fillTime": "11-10-2022 13:42:29",
            "fillshares": "1",
            "fillQuantity": "1",
            "fillPrice": "328.40",
            "exchordid": "",
            "exchangeUpdateTime": "11-10-2022 13:42:29"
        }
    ]
}
{
 "Status": "Failed",
 "data": ",
 "requestTime": ""
}