ORDERS HISTORY
This API retrieves the complete history of an order for authorized end users through a middleware-based integration.
It provides the lifecycle of an order, including all state changes, modifications, executions, rejections, and bracket order details associated with the specified Order ID.
🔗 Path Parameters
| Fields | Type | Required | Description | Example |
|---|---|---|---|---|
| order_id | string | Yes | System-generated Order ID. Must be URL encoded if it contains special characters. | NXVZO00086K1 |
🔑 Header Parameters
| Fields | Type | Required | Description | Example |
|---|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication | access_token |
| x-api-key | string | Yes | API key provided | x-api-key |
🔍 Query Parameters
| Fields | Type | Required | Description | Example |
|---|---|---|---|---|
| userId | string | Yes | User ID (UCC) | {{user_id}} |
🟢 Success Response - 200 OK
| Fields | Type | Description | Example |
|---|---|---|---|
| status | string | Status of API call | "success" |
| code | string | Response code | "s-101" |
| message | string | Success message | "Order history fetched successfully" |
| data | array(object) | Order history records | See below table |
📘 Order History Object Fields
| Fields | Type | Description | Example |
|---|---|---|---|
| order_id | string | System-generated unique order number | "NXVZO00086K1" |
| exchange | string | Exchange segment | "NSE_EQ" |
| scrip_token | integer | Exchange token number of the scrip | 1594 |
| exchange_order_no | string | Exchange order number | "120000000123456" |
| status | string | Current order status | "OPEN" |
| error_reason | string | Error message if order is rejected, cancelled or modification fails | "Insufficient Margin" |
| transaction_type | string | Buy or Sell transaction | "BUY" |
| product_type | string | Product type | "D" |
| order_type | string | Order type | "RL" |
| total_quantity | integer | Original order quantity | 100 |
| pending_quantity | integer | Pending quantity | 50 |
| traded_quantity | integer | Executed quantity | 50 |
| disclosed_quantity | integer | Quantity disclosed to the market | 25 |
| order_price | number | Order price | 2500.50 |
| trigger_price | number | Trigger price | 2495.00 |
| validity | string | Order validity | "DAY" |
| validity_days | integer | Number of days for GTD validity | 30 |
| symbol | string | Trading symbol | "INFY" |
| series | string | Series | "EQ" |
| instrument | number | Instrument type/name | 1 |
| expiry_date | string | Contract expiry date | "2026-07-30" |
| strike_price | string | Strike price | "2500000" |
| option_type | string | Option type | "CE" |
| order_timestamp | string | Timestamp when order was registered in OMS | "2026-07-02 10:15:30" |
| exchange_timestamp | string | Timestamp when order was registered at exchange | "2026-07-02 10:15:31" |
| initiated_by | string | Application identifier from which order was placed | "MOBAPP" |
| modified_by | string | Application identifier from which order was modified | "WEBAPP" |
| is_amo_order | string | Indicates whether order is an AMO | "N" |
| gateway_order_id | string | Internal gateway order identifier | "GW12345678" |
| order_identifier | string | User-defined order reference | "ORD001" |
| sequence_number | string | Sequence number representing a specific state transition | "15" |
| bracket_details | object | Bracket Order related details | See below table |
📘 Bracket Details Object Fields
| Fields | Type | Description | Example |
|---|---|---|---|
| parent_order_id | string | Order ID of the main leg | "NXVZO00086K0" |
| leg_indicator | string | Indicates the bracket leg type | "STOPLOSS" |
| stoploss_price | number | Stop Loss leg price | 2450.00 |
| stoploss_trigger_price | number | Stop Loss trigger price | 2460.00 |
| profit_price | number | Profit target price | 2600.00 |
| stoploss_jump_price | number | Incremental value by which Stop Loss moves when market moves in favor | 1.00 |
| ltp_jump_price | number | Incremental value by which LTP moves before trailing is applied | 2.00 |
| bo_order_id | string | Bracket Order ID | "BO123456" |
| bo_order_status | string | Bracket Order status | "COMPLETED" |
| bo_modify_flag | number | Indicates which legs can be modified | 7 |
📘 Metadata Object Fields
| Fields | Type | Description | Example |
|---|---|---|---|
| total_records | number | Total records returned | 25 |
| all_records | number | Total history records available | 25 |
| completed_records | number | Completed records count | 10 |
| open_records | number | Open records count | 15 |
📝 Notes
- Retrieves the complete lifecycle of a specific order.
- Returns all order state transitions using the
sequence_numberfield. - Bracket Order details are included when applicable.
order_idshould be URL encoded before sending if it contains special characters.- Requires a valid authenticated session.