Skip to content

Trade Book

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

POST: /api/tradeBook

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

Request Details

Parameter Description
userId User Id of the login user
actid Account Id of logged in user
jKey Key Obtained on login success.

Code

from thefirstock import thefirstock

TD = thefirstock.firstock_TradeBook()
curl -X POST 'https://connect.thefirstock.com/api/tradeBook' \
-H 'Content-Type: application/json' \
-d '{
    "userId": "",
    "jKey": "",
    "actid": ""
}'
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 Details

Response data will be in json Array of objects with below fields in case of success.

Parameter Description
stat Ok or Not_Ok Place order success or failure indication
exch Exchange Segment
norenordno Noren Order Number
tsym Trading symbol / contract on which order is placed.
prc Order Price
qty Order Quantity
prd Display product alias name, using prarr returned in user details.
status Order status
trantype B/S Transaction type of the order
prctyp LMT / MKTPrice type
fillshares Total Traded Quantity of this order
avgprc Average trade price of total traded quantity
rejreason If order is rejected, reason in text form
exchordid Exchange Order Number
cancelqty Canceled quantity for order which is in status cancelled.
remarksAny message Entered during order entry
dscqty Order disclosed quantity.
trgprc Order trigger price
ret DAY / IOC / EOS
uid
actid
amo Yes / No
pp Price precision
ti Tick size
ls Lot size
token Contract Token
orddttm
ordenttm
exch_tm
flid Fill ID
fltm Fill Time
flprc Fill Price

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

Parameter Description
stat Ok or Not_Ok Place order success or failure indication
requestTime Response received time.
emsg Error message

Sample Response

[{
   "stat":"Ok",
   "norenordno":"20121300065715",
   "uid":"GURURAJ",
   "actid":"GURURAJ",
   "exch":"NSE",
   "prctyp":"LMT",
   "ret":"DAY",
   "prd":"M",
   "flid":"102",
   "fltm":"01-01-1980 00:00:00",
   "trantype":"S",
   "tsym":"ACCELYA-EQ",
   "qty":"180",
   "token":"7053",
   "fillshares":"180",
   "flqty":"180",
   "pp":"2",
   "ls":"1",
   "ti":"0.05",
   "prc":"800.00",
   "flprc":"800.00",
   "norentm":"19:59:32 13-12-2020",
   "exch_tm":"00:00:00 01-01-1980",
   "remarks":"WC TEST Order",
   "exchordid":"6857"
},
{
   "stat":"Ok",
   "norenordno":"20121300065716",
   "uid":"GURURAJ",
   "actid":"GURURAJ",
   "exch":"NSE",
   "prctyp":"LMT",
   "ret":"DAY",
   "prd":"M",
   "flid":"101",
   "fltm":"01-01-1980 00:00:00",
   "trantype":"B",
   "tsym":"ACCELYA-EQ",
   "qty":"180",
   "token":"7053",
   "fillshares":"180",
   "flqty":"180",
   "pp":"2",
   "ls":"1",
   "ti":"0.05",
   "prc":"800.00",
   "flprc":"800.00",
   "norentm":"19:59:32 13-12-2020",
   "exch_tm":"00:00:00 01-01-1980",
   "remarks":"WC TEST Order",
   "exchordid":"6858"
}
]