Get Order History
API to retrieve the details of a specific order. Orders placed by the user remain available for one trading day and are automatically removed at the end of the trading session. Provides details regarding the progression of an order through its various execution stages. For a comprehensive list of all possible order statuses, please refer to the appendix on order status.
Order history can be retrieved by utilizing either the order_id or a tag.
- When both options are provided, the response will include the history of the order that perfectly matches both the order_id and tag.
- If only the tag is provided, the response will include the history of all associated orders that match the given tag.
Header Parameters
Name | Required | Type | Description |
---|---|---|---|
Authorization | true | string | Requires the format Bearer access_token where access_token is obtained from the Token API. |
Accept | true | string | Defines the content format the client expects, which should be set to application/json . |
Query Parameters
Name | Required | Type | Description |
---|---|---|---|
order_id | false | string | The order reference ID for which the order history is required. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
tag | false | string | The unique tag of the order for which the order history is being requested |
- 200
- 4XX
Response Body
{
"status": "success",
"data": [
{
"exchange": "NSE",
"price": 571.35,
"product": "D",
"quantity": 1,
"status": "put order req received",
"tag": null,
"validity": "DAY",
"average_price": 0.0,
"disclosed_quantity": 0,
"exchange_order_id": null,
"exchange_timestamp": null,
"instrument_token": "NSE_EQ|INE062A01020",
"is_amo": false,
"status_message": null,
"order_id": "231019025564798",
"order_request_id": "1",
"order_type": "LIMIT",
"parent_order_id": "NA",
"trading_symbol": "SBIN",
"tradingsymbol": "SBIN",
"order_timestamp": "2023-10-19 13:25:56",
"filled_quantity": 0,
"transaction_type": "SELL",
"trigger_price": 0.0,
"placed_by": "******",
"variety": "SIMPLE"
},
{
"exchange": "NSE",
"price": 571.35,
"product": "D",
"quantity": 1,
"status": "validation pending",
"tag": null,
"validity": "DAY",
"average_price": 0.0,
"disclosed_quantity": 0,
"exchange_order_id": null,
"exchange_timestamp": null,
"instrument_token": "NSE_EQ|INE062A01020",
"is_amo": false,
"status_message": null,
"order_id": "231019025564798",
"order_request_id": "1",
"order_type": "LIMIT",
"parent_order_id": "NA",
"trading_symbol": "SBIN",
"tradingsymbol": "SBIN",
"order_timestamp": "2023-10-19 13:25:56",
"filled_quantity": 0,
"transaction_type": "SELL",
"trigger_price": 0.0,
"placed_by": "******",
"variety": "SIMPLE"
},
{
"exchange": "NSE",
"price": 571.35,
"product": "D",
"quantity": 1,
"status": "open pending",
"tag": null,
"validity": "DAY",
"average_price": 0.0,
"disclosed_quantity": 0,
"exchange_order_id": null,
"exchange_timestamp": null,
"instrument_token": "NSE_EQ|INE062A01020",
"is_amo": false,
"status_message": null,
"order_id": "231019025564798",
"order_request_id": "1",
"order_type": "LIMIT",
"parent_order_id": "NA",
"trading_symbol": "SBIN",
"tradingsymbol": "SBIN",
"order_timestamp": "2023-10-19 13:25:56",
"filled_quantity": 0,
"transaction_type": "SELL",
"trigger_price": 0.0,
"placed_by": "******",
"variety": "SIMPLE"
},
{
"exchange": "NSE",
"price": 571.35,
"product": "D",
"quantity": 1,
"status": "open",
"tag": null,
"validity": "DAY",
"average_price": 0.0,
"disclosed_quantity": 0,
"exchange_order_id": "1300000025727177",
"exchange_timestamp": "2023-10-19 13:25:56",
"instrument_token": "NSE_EQ|INE062A01020",
"is_amo": false,
"status_message": null,
"order_id": "231019025564798",
"order_request_id": "1",
"order_type": "LIMIT",
"parent_order_id": "NA",
"trading_symbol": "SBIN",
"tradingsymbol": "SBIN",
"order_timestamp": "2023-10-19 13:25:56",
"filled_quantity": 0,
"transaction_type": "SELL",
"trigger_price": 0.0,
"placed_by": "******",
"variety": "SIMPLE"
},
{
"exchange": "NSE",
"price": 571.35,
"product": "D",
"quantity": 1,
"status": "open",
"tag": null,
"validity": "DAY",
"average_price": 0.0,
"disclosed_quantity": 0,
"exchange_order_id": "1300000025727177",
"exchange_timestamp": "2023-10-19 13:25:56",
"instrument_token": "NSE_EQ|INE062A01020",
"is_amo": false,
"status_message": null,
"order_id": "231019025564798",
"order_request_id": "1",
"order_type": "LIMIT",
"parent_order_id": "NA",
"trading_symbol": "SBIN",
"tradingsymbol": "SBIN",
"order_timestamp": "2023-10-19 13:25:56",
"filled_quantity": 1,
"transaction_type": "SELL",
"trigger_price": 0.0,
"placed_by": "******",
"variety": "SIMPLE"
},
{
"exchange": "NSE",
"price": 571.35,
"product": "D",
"quantity": 1,
"status": "complete",
"tag": null,
"validity": "DAY",
"average_price": 571.4,
"disclosed_quantity": 0,
"exchange_order_id": "1300000025727177",
"exchange_timestamp": "2023-10-19 13:25:56",
"instrument_token": "NSE_EQ|INE062A01020",
"is_amo": false,
"status_message": null,
"order_id": "231019025564798",
"order_request_id": "1",
"order_type": "LIMIT",
"parent_order_id": "NA",
"trading_symbol": "SBIN",
"tradingsymbol": "SBIN",
"order_timestamp": "2023-10-19 13:25:56",
"filled_quantity": 1,
"transaction_type": "SELL",
"trigger_price": 0.0,
"placed_by": "******",
"variety": "SIMPLE"
}
]
}
Name | Type | Description |
---|---|---|
status | string | A string indicating the outcome of the request. Typically success for successful operations. |
data | object | Response data for order details |
data[].exchange | string | Exchange to which the order is associated. Valid exchanges can be found in the Exchange Appendix |
data[].price | float | Price at which the order was placed |
data[].product | string | Signifies if the order was either Intraday, Delivery or CO. Possible values: I , D , CO , MTF . |
data[].quantity | int32 | Quantity with which the order was placed |
data[].status | string | Indicates the current status of the order. Valid order statuses can be found in the Order Status Appendix |
data[].tag | string | Tag to uniquely identify an order |
data[].validity | string | It can be one of the following - DAY(default), IOC. Possible values: DAY , IOC . |
data[].average_price | float | Average price at which the qty got traded |
data[].disclosed_quantity | int32 | The quantity that should be disclosed in the market depth |
data[].exchange_order_id | string | Unique order ID assigned by the exchange for the order placed |
data[].exchange_timestamp | string | User readable time at which the order was placed or updated |
data[].instrument_token | string | Key of the instrument. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
data[].is_amo | boolean | Signifies if the order is an After Market Order |
data[].status_message | string | Indicates the reason when any order is rejected, not modified or cancelled |
data[].order_id | string | Unique order ID assigned internally for the order placed |
data[].order_request_id | string | Apart from 1st order it shows the count of how many requests were sent |
data[].order_type | string | Type of order. It can be one of the following MARKET refers to market order LIMIT refers to Limit Order SL refers to Stop Loss Limit SL-M refers to Stop Loss Market. Possible values: MARKET , LIMIT , SL , SL-M . |
data[].parent_order_id | string | In case the order is part of the second of a CO, the parent order ID is indicated here |
data[].trading_symbol | string | Shows the trading symbol of the instrument |
data[].order_timestamp | string | User readable timestamp at which the order was placed |
data[].filled_quantity | int32 | The total quantity traded from this particular order |
data[].transaction_type | string | Indicates whether its a buy or sell order. Possible values: BUY , SELL . |
data[].trigger_price | float | If the order was a stop loss order then the trigger price set is mentioned here |
data[].placed_by | string | Uniquely identifies the user (commonly referred as UCC) |
data[].variety | string | Order complexity |
The lowercase field (tradingsymbol
) is deprecated and will be removed in future versions. Use the snake_case versions for consistency.
Error codes
Error code | Description |
---|---|
UDAPI1010 | Order id accepts only alphanumeric characters and '-'. - The order id you've provided isn't accepted. |
UDAPI100059 | At least one of 'order_id' or 'tag' is required to fetch order details. - When attempting to retrieve order details, you must provide either the 'order_id' or the 'tag'. Without at least one of these identifiers, the system cannot locate and present the specific order information you're seeking. |
UDAPI100010 | Order not found - The system couldn't locate the order you're referring to. |
Examples
A comprehensive set of examples is provided to illustrate various use cases and implementation scenarios for this API. To view detailed examples and access sample code, please refer to: API Examples.