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
Parameter | Description | Data types | Example |
---|---|---|---|
userId | Logged in User Id | String | "AA1999" |
jKey | Key obtained on login success. | String | "d9b4e1b1c79042476fd96 11eed81003b2dc34c3f13b 0b60a4842fd5a24c9f3f2" |
orderNumber | orderNumber of the order placed | String | "1234567890111" |
- cURL
curl --location 'https://connect.thefirstock.com/api/V3/singleOrderHistory' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38",
"orderNumber": "11030800009600"
}'
from thefirstock import thefirstock
singleOrderHistory = thefirstock.firstock_SingleOrderHistory(
orderNumber="11030800009600"
)
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.singleOrderHistory(
{ orderNumber: "11030800009600" },
(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.singleOrderHistory(orderNumber: "11030800009600");
}
}
Response details
Parameter | Description | Data types | Examples |
---|---|---|---|
data.exchange | Exchange Segment | String | "NSE" |
data.orderNumber | orderNumber of the order placed | String | "1234567890111" |
data.userId | userId provided by the firstock | String | "AA0011" |
data.tradingSymbol | Trading symbol / contract on which order is placed. | String | "ITC-EQ" |
data.price | Order Price | String | "0.00" |
data.quantity | Order Quantity | String | "1" |
data.product | Display product alias name, using prarr returned in user details. | String | "M" |
data.status | Order status | String | "REJECTED" |
data.transactionType | B/S Transaction type of the order | String | "B" |
data.orderTime | orderTime of the order placed | String | "14:45:11 15-02-2023" |
data.fillShares | Total Traded Quantity of this order | String | "0" |
data.averagePrice | averagePrice | String | "0" |
data.priceType | LMT / MKTPrice type | String | "LMT" |
data.rejectReason | If order is rejected, reason in text form | String | "ORA:Product Regular not enabled on exchange NSE" |
data.remarks | Any message Entered during order entry | String | "singleOrderHistory" |
data.disclosedQuantity | Order disclosed quantity. | String | "0" |
data.retention | DAY / IOC / EOS | String | "DAY" |
data.pricePrecision | Price precision | String | "2" |
data.tickSize | Tick size | String | "0.05" |
data.lotSize | Lot size | String | "1" |
data.token | Contract Token | String | "1660" |
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": "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"
}
]
}
{
"status": "Failed",
"code": "401",
"name": "INVALID_JKEY",
"error": {
"field": "jKey",
"message": "jKey parameter is invalid"
}
}