Skip to Content

General Socket - Order Events

This WebSocket allows you to receive live updates on the status of your orders, including partial fills and rejections.

USE CASE

Receive an update the moment one of your orders is placed, modified, traded or rejected.

Details

  • The WebSocket API for receiving order, position, trade, price alerts, and EDIS updates is a real-time communication protocol designed to provide seamless access to various critical elements of a trading and EDIS system. This API allows traders and developers to establish a persistent, bidirectional connection with the server, enabling them to receive real-time updates on their orders, current positions, executed trades, price alerts, and EDIS status.
  • Subscribe with the orders action on the raw socket, or OnOrders in the Python SDK (callback on_orders). Nothing is delivered until you subscribe.
  • Match each update to your order with id. exchOrdId is the exchange order id and id_fyers is the FYERS-generated unique identifier.
  • Read status to track the order: 1 canceled, 2 traded, 4 transit, 5 rejected, 6 pending, 7 expired (3 is not used). message carries error text.
  • filledQty and remainingQuantity show how much has traded and what is left after partial trades. tradedPrice is the average traded price.
  • offlineOrder is true for an AMO order and false when the market is open. parentId is sent only for orders where it applies.
  • orderDateTime is in IST as DD-MMM-YYYY hh:mm:ss, for example 04-Aug-2023 10:12:58.
  • The raw socket message uses different key names. The SDK renames them, for example org_ord_status to status and qty_remaining to remainingQuantity. See the key mappers on General WebSocket - Subscribe.

Response Attributes - For order updates

AttributeData TypeDescription
idstringThe unique order id assigned for each order
exchOrdIdstringThe order id provided by the exchange
symbolstringThe symbol for which order is placed
qtyintThe original order qty
remainingQuantityintThe remaining qty
filledQtyintThe filled qty after partial trades
statusint
  • 1 => Canceled
  • 2 => Traded / Filled
  • 3 => (Not used currently)
  • 4 => Transit
  • 5 => Rejected
  • 6 => Pending
  • 7 => Expired
  • View Details
    messagestringThe error messages are shown here
    segmentint
    • 10 => E (Equity)
    • 11 => D (F&O)
    • 12 => C (Currency)
    • 20 => M (Commodity)
    • View Details
    limitPricefloatThe limit price for the order
    stopPricefloatThe limit price for the order
    productTypestringThe product type
    typeint
    • 1 => Limit Order
    • 2 => Market Order
    • 3 => Stop Order (SL-M)
    • 4 => Stoplimit Order (SL-L)
    sideint
    orderValiditystring
    • DAY
    • IOC
    orderDateTimestringThe order time as per DD-MMM-YYYY hh:mm:ss in IST
    parentIdstringThe parent order id will be provided only for applicable orders.
    tradedPricefloatThe average traded price for the order
    sourcestring
    fytokenstring
    • Fytoken is a unique identifier for every symbol.
    • View Details
    offlineOrderboolean
    • False => When market is open
    • True => When placing AMO order
    panstringPAN of the client
    clientIdstringThe client id of the fyers user
    exchangeint
    instrumentint
    id_fyersstringFyers system-generated unique identifier for the order.
    Last updated on