Skip to main content

Single order history

An order book electronically records all open (buy and sell) orders for a specific stock, bond, currency pair and futures.

It's important to note that just because an order has been placed successfully through the API, it doesn't guarantee its successful execution. To accurately determine the status of your order, it is recommended to retrieve the current status of the order using the unique order_id.

Method: POST

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

Request Details

ParameterDescriptionData typesExample
userIdLogged in User IdString"AA1999"
jKeyKey obtained on login success.String"d9b4e1b1c79042476fd96
11eed81003b2dc34c3f13b
0b60a4842fd5a24c9f3f2"
orderNumberorderNumber of the order placedString"1234567890111"
curl --location 'https://connect.thefirstock.com/api/V3/singleOrderHistory' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38",
"orderNumber": "11030800009600"
}'

Response details

ParameterDescriptionData typesExamples
data.exchangeExchange SegmentString"NSE"
data.orderNumberorderNumber of the order placedString"1234567890111"
data.userIduserId provided by the firstockString"AA0011"
data.tradingSymbolTrading symbol / contract on which order is placed.String"ITC-EQ"
data.priceOrder PriceString"0.00"
data.quantityOrder QuantityString"1"
data.productDisplay product alias name, using prarr returned in user details.String"M"
data.statusOrder statusString"REJECTED"
data.transactionTypeB/S Transaction type of the orderString"B"
data.orderTimeorderTime of the order placedString"14:45:11 15-02-2023"
data.fillSharesTotal Traded Quantity of this orderString"0"
data.averagePriceaveragePriceString"0"
data.priceTypeLMT / MKTPrice typeString"LMT"
data.rejectReasonIf order is rejected, reason in text formString"ORA:Product Regular not enabled on exchange NSE"
data.remarksAny message Entered during order entryString"singleOrderHistory"
data.disclosedQuantityOrder disclosed quantity.String"0"
data.retentionDAY / IOC / EOSString"DAY"
data.pricePrecisionPrice precisionString"2"
data.tickSizeTick sizeString"0.05"
data.lotSizeLot sizeString"1"
data.tokenContract TokenString"1660"

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": "AA0011",
"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:45:11 15-02-2023",
"fillShares": "",
"averagePrice": "",
"remarks": "singleOrderHistory",
"rejectReason": "ORA:Product Regular not enabled on exchange NSE"
}
]
}