Skip to Content

Order History

This API allows you to fetch your past orders for a date range, defaulting to the current financial year.

USE CASE

Look up past orders by symbol, segment, exchange or status, such as every rejected order in a quarter.

Details

  • Fetches all historical orders within the specified date range. If no range is specified, the system automatically defaults to the current financial year.
  • Send from_date and to_date as YYYY-MM-DD. Without them the report runs from the start of the current financial year to today.
  • Results are paged: page_size defaults to 100 and page_no to 1. Increase page_no to read further pages.
  • status filters only on Executed (1), Cancelled (2) or Rejected (3), with 0 for all. There is no filter for pending orders, so use Get Orders for open orders.
  • In this report segment_type is 0 all, 1 equity, 2 equity derivatives, 3 currency derivatives and 4 commodity derivatives. It has no mutual fund option, unlike the other reports.
  • Rate limits differ between the Standard and Prime plans. See Plans & rate limits.

Request Attributes - For each order

AttributeData TypeDescription
symbolstringEg: NSE:SBIN-EQ
page_sizestringThe number of records to be fetched in one page (default is 100)
page_nostringThe page number to fetch (default is 1)
from_datestringThe start date for fetching orders in “YYYY-MM-DD” format (default is the start of the current financial year)
to_datestringThe end date for fetching orders in “YYYY-MM-DD” format (default is the current date)
segment_typestring
  • 0 → Includes all Segments [default]
  • 1 → Includes only Equity
  • 2 → Includes only Equity Derivatives
  • 3 → Includes Currency Derivatives
  • 4 → Includes only Commodity Derivatives
exchange_typestring
  • 0 → Includes all Exchanges [default]
  • 1 → Includes only NSE
  • 2 → Includes only BSE
  • 3 → Includes only MCX
statusstring
  • 0 → All Status [default]
  • 1 → Executed
  • 2 → Cancelled
  • 3 → Rejected

Response Attributes - For each order

AttributeData TypeDescription
symbolstringEg: NSE:SBIN-EQ
clientIdstringThe client id of the fyers user
id_fyersstringFyers system-generated unique identifier for the order
exchOrdIdstringThe order number provided by the exchange
exchangeint
segmentint
instrumentint
descriptionstringThe description of the symbol
trade_date_timeintThe epoch time when the trade occurred
transaction_type stringThe type of transaction (BUY/SELL)
trade_datestringThe time when the trade occurred in “DD-MM-YYYY hh:mm:ss” format in IST
product_typestring
statusstringThe status of the trade (E.g., Executed, Rejected, etc.)
ordertypestringThe order type (E.g., Market, Limit, etc.)
qtyintThe quantity of the trade
tradedQtyintThe total traded qty
traded_pricefloatThe traded price
limit_pricefloatThe limit price set for the order
ord_sourcestringThe source from which the order was placed
rejection_reasonstringThe reason for rejection if the order was rejected
is_symbol_activebooleanIndicates if the symbol is currently active for trading
Last updated on