Doc Fundamentals
Funds Management
Order Management
Portfolio Management
User Authentication
Web Socket Trade Confirmation
Daily API Calls
Success Rate
Avg. Response Time
We provide real-time Order Status Updates (Place, Modify, Cancel, Trigger) updates over websocket. For this you don't need to subscribe with any message, the updates will be pushed directly.
Websocket connection for Order Updates -
We have 3 websocket connection URL's ,Please follow below method to connect to relevant weboscket for order updates.
1. Decode the access token
Sample Payload:{
"unique_name": "53814671",
"role": "9165",
"State": "",
"RedirectServer": "C",
"nbf": 1656068442,
"exp": 1656095399,
"iat": 1656068442
}
2. After decoding JWT token As per RedirectServer value User have to connect Websocket:
for "RedirectServer": "C" ->wss://openfeed.5paisa.com/feeds
for "RedirectServer": "A" ->wss://aopenfeed.5paisa.com/feeds
for "RedirectServer": "B" ->wss://bopenfeed.5paisa.com/feeds
Note
If you connect to incorrect websocket URL the order updates will not be pushed. Also this connection mechanism is needed only for order updates for other features like Market Feed etc you can connect to any URL.
wss://openfeed.5paisa.com/feeds/api/chat?Value1={{access_token}}|{{clientcode}}
URL Query Parametrs
PARAMETER NAME | MANDATORY | DESCRIPTION |
---|---|---|
access_tokenSTRING | Yes | Access token received in the response of login API |
clientcodeSTRING | Yes | Demat account client code of the client in plain text |
https://openfeed.5paisa.com/feeds/api/chat?Value1=eyJhbGciOiJIUzI1NiIsInR5cCI6IkXVCJ9.eyJ1bmlxdWVfbmFtZSI6IjwMDUyNzcwIiwicm9sSI6IjEwMzQ1IiwiU3RhdGiOiIiLCJSZWRpcmVjdFNlcnZlciI6IkEiLCJuYmYiOjE3MDY5Og2NTUsImV4cCI6MTcwNzA3MTM5OSwiaWF0IjoxNz2OTk4NjU1fQ.TNCMKL4Vd09D3Z0X77zc6PTe7RRBWDD367v_ZHco0|50011110
NOTE
The details of exchange, exchange type and scrip code for any instrument can be found from the Scrip master.
Method
{"Method":"OrderTradeConfirmations","Operation":"Subscribe","ClientCode":"CLIENT_CODE"}
{"Method":"OrderTradeConfirmations","Operation":"Unsubscribe","ClientCode":" CLIENT_CODE "}
Response body
PARAMETER NAME | LIST OF VALUES | DESCRIPTION |
---|---|---|
ClientCode STRING | - | IIFL Securities demat account client code of the client in plain text |
Exch STRING | N:NSE B:NSE | This is the exchange of the instrument |
ExchType STRING | C:Cash D:Derivatives | This is the exchange segment of the instrument |
BrokerOrderID INTEGER | - | This is the order ID generated by 5paisa. |
ExchangeOrderID STRING | - | This is the order ID generated by the exchange |
ScripCode INTEGER | - | This is the unique scrip code for the instrument |
Price DOUBLE | - | This is the price at which order is placed |
Qty INTEGER | - | This is the quantity for which order is placed |
BuySell STRING | B: Buy S: Sell | This specifies if the order is of buy or sell type. |
ReqType STRING | P: Place M: Modify C: Cancel T: Trade S: Stop Loss Trigeer | This specifies if the request is for placing, cancelling or modifying the order |
ReqStatus INTEGER | 0: Success 1: Failure | This is the status code for the order |
{"ReqType":"P","ClientCode":"CLIENT_CODE","Exch":"N","ExchType":"C","ScripCode":1660,"Symbol":"ITC","Series":"EQ","BrokerOrderID":132038757,"ExchOrderID":"1200010221327930","ExchOrderTime":"2024-05-09 11:28:22","BuySell":"B","Qty":1,"Price":425,"ReqStatus":0,"Status":"Placed","OrderRequestorCode":"CLIENT_CODE","AtMarket":"N","Product":"D","WithSL":"N","SLTriggerRate":0,"DisclosedQty":0,"PendingQty":1,"TradedQty":0,"RemoteOrderId":"202405091128221","Remark":""}
{"ReqType":"M","ClientCode":"CLIENT_CODE","Exch":"N","ExchType":"C","ScripCode":1660,"Symbol":"ITC","Series":"EQ","BrokerOrderID":132029886,"ExchOrderID":"1100030061127930","ExchOrderTime":"2024-05-09 11:32:34","BuySell":"B","Qty":1,"Price":0,"ReqStatus":0,"Status":"Modified","OrderRequestorCode":"CLIENT_CODE","AtMarket":"Y","Product":"D","WithSL":"N","SLTriggerRate":0,"DisclosedQty":0,"PendingQty":1,"TradedQty":0,"RemoteOrderId":"2324057911323","Remark":""}
{"ReqType":"C","ClientCode":"CLIENT_CODE","Exch":"N","ExchType":"C","ScripCode":1660,"Symbol":"ITC","Series":"EQ","BrokerOrderID":222072376,"ExchOrderID":"11000028100","ExchOrderTime":"2024-05-09 11:45:18","BuySell":"B","Qty":1,"Price":430,"ReqStatus":0,"Status":"Cancelled","OrderRequestorCode":"CLIENT_CODE","AtMarket":"N","Product":"D","WithSL":"N","SLTriggerRate":0,"DisclosedQty":0,"PendingQty":1,"TradedQty":0,"RemoteOrderId":"1235319136","Remark":""}
{"ReqType":"T","ClientCode":"CLIENT_CODE","Exch":"N","ExchType":"C","ScripCode":1660,"Symbol":"ITC","Series":"EQ","ExchOrderID":"120210200213230","ExchTradeId":"234495","ExchTradeTime":"2024-05-09 11:32:34","BuySell":"B","Qty":1,"Price":434.2,"PendingQty":0,"TotalTradedQty":1,"OrderQty":1,"OrderPrice":434.15,"RemoteOrderId":"204059112343","Product":"D","ReqStatus":0,"Status":"Fully Executed","Remark":""}
{"ReqType":"S","ClientCode":"CLIENT_CODE","Exch":"N","ExchType":"C","ScripCode":1660,"Symbol":"ITC","Series":"EQ","ExchOrderID":"1100000043224370","BuySell":"B","Qty":1,"OrderPrice":433.9,"AtMarket":"N","Product":"D","RemoteOrderId":"17152356907","ReqStatus":0,"SLTriggerRate":433.85,"SLTriggerTime":"2024-05-09 11:50:46","Status":"SL Triggered","Remark":""}