Doc Fundamentals
Funds Management
Order Management
Portfolio Management
User Authentication
Order Book
Daily API Calls
Success Rate
Avg. Response Time
With the variety of orders available, tracking of the order is crucial after placing an order. This API helps partners and clients to track the order placed for the day. It fetches order book of the user which will contain cash, derivatives, currency and commodity orders.
API provides order book detail list which includes various parameters such as average Price , trigger rate, quantity traded and pending etc. The method responds with status of execution of API along with the remote order ID, broker order ID and exchange order ID to map the orders.
Common Usage
API can be used to map order ID, broker order ID and exchange order, which further can be used for modifying the order.
To check order status it is recommended to use Websocket or OrderStatusAPI.
https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V3/OrderBook
Request headers
KEY | VALUE |
---|---|
Content-Type | application/json |
Authorization | bearer {Your Access Token} |
Request body
FIELD NAME | MANDATORY | DESCRIPTION | |
---|---|---|---|
head | keySTRING | Yes | AppKey of User or Partner |
body | ClientCodeSTRING | Yes | 5paisa demat account client code of the user in plain text. |
{
"head": {
"key": "{{YOur APp Key}}"
},
"body": {
"ClientCode": "{{clientcode}}"
}
}
Response body
FIELD NAME | VALUES | DESCRIPTION | |
---|---|---|---|
head | responseCodeSTRING | 5POrdBkV3 | This is the unique response code for the API. |
statusSTRING | 0: Success2: Invalid head parameters.
| This is the status code which depicts the status of API request to the server. | |
statusDescriptionSTRING | SuccessInvalid head parameters. | This is the description of the status received from the server for the API request. | |
body | OrderBookDetailARRAY | It provides the list of all the order details for the day. | |
StatusINTEGER | 0: Success1: No orders found for this Client.9: Invalid Session | This is the numeric code | |
MessageSTRING | SuccessNo orders found for this Client.Invalid Session | This is the description of the status of API request. |
OrderBookDetail
FIELD NAME | VALUES | DESCRIPTION |
---|---|---|
AveragePriceSTRING | - | This specifies Average Price at which all trades are processed. For Partially filled order this will reflect price for filled trades. |
AHProcessSTRING | Y: After-market order | This specifies if the order is after market order or not. |
AfterHoursSTRING | Y | This specifies if the order is placed after closing of the market. |
AtMarketSTRING | Y: Market order | This specifies if the order is placed at the market rate or not. |
BrokerOrderIdINTEGER | - | It provides the ID generated by 5paisa for the order. |
BrokerOrderTimeDATETIME | - | Timestamp in epoch format when the order is placed on 5paisa system. |
BuySellSTRING | B: Buy | This specifies whether the order is of buy type or sell type. |
DelvIntraSTRING | D: Delivery | This specifies the type of the order. |
DisClosedQtyINTEGER | - | This is quantity of the order which is disclosed to the market while placing the order. |
ExchSTRING | N: NSE | This is the exchange in which order is placed. |
ExchOrderIDSTRING | - | This is the order ID generated by the exchange. |
ExchOrderTimeDATETIME | - | Timestamp at which order is placed in the exchange. |
ExchTypeSTRING | C: Cash | This is exchange type in which the order is placed. |
OldorderQtyINTEGER | - | This is the original order quantity in case any modification is done to the order. |
OrderRequesterCodeSTRING | - | This is 5paisa Securities client code of the user for which order is placed. |
OrderStatusSTRING | Mentioned in the table below | This is current status of the order. |
OrderValidUptoDATE | - | This is the date upto which the order is valid. |
OrderValidityINTEGER | 0: Day | This is order type based on the order validity. |
PendingQtyINTEGER | - | This is the quantity pending to be executed. |
QtyINTEGER | - | This is the total quantity of the order. |
RateDOUBLE | - | This is the price rate at which order is placed. |
ReasonSTRING | - | This is the rejection reason for the order. |
RemoteOrderIDSTRING | - | This is the remote order ID passed by the user while placing the order. |
RequestTypeSTRING | P: Place | This is the type of request for the order. |
SLTriggerRateDOUBLE | - | This is the trigger rate in case of stop loss order. |
SLTriggeredSTRING | Y: Stop loss triggered | This specifies if the stop loss has been triggered or not. |
SMOProfitRateDOUBLE | - | This is profit order rate in case of bracket order. |
SMOSLLimitRateDOUBLE | - | This is the limit rate of stop loss leg for bracket/cover order. It's value is 0 since this leg is always placed at market rate. |
SMOSLTriggerRateDOUBLE | - | This is price rate for the stop loss leg of the bracket/cover order. |
SMOTrailingSLDOUBLE | - | This is the trailing stop Ioss for the bracket/cover order. |
ScripCodeINTEGER | - | This is the unique code for instrument in which order is placed. |
ScripNameSTRING | - | This is the name of the instrument for which order is placed. |
TerminalIdINTEGER | - | This is the terminal ID through which order is placed. |
TradedQtyINTEGER | - | This is the quantity which has been executed. |
WithSLSTRING | Y: Stop loss order | This specifies if the order is a stop loss order or not. |
Order Status
STATUS | DESCRIPTION |
---|---|
Fully Executed | Order has been fully exceuted. |
Modified | Order has been modified from its original execution state. |
Xmitted | Order has been prepared by 5paisa system, but exchange rejected it or hasn't reached exchange. |
Rejected By 5P | 5paisa Securities system rejected the order. |
AH Cancelled | After market hours order is cancelled. |
AH Modified | After market hours order is modified from its previous state. |
Rejected by Exch | Order has been rejected by exchange. |
AH Placed | After market hours order has been placed. |
Cancelled | Order has been cancelled. |
Pending | Order has been placed and is pending. |
{
"body": {
"Message": "Success",
"OrderBookDetail": [
{
"AHProcess": "N",
"AfterHours": "N",
"AtMarket": "N",
"AveragePrice": 5.2,
"BrokerOrderId": 182747604,
"BrokerOrderTime": "/Date(1707279047230+0530)/",
"BuySell": "S",
"DelvIntra": "D",
"DisClosedQty": 0,
"Exch": "N",
"ExchOrderID": "1500000035029169",
"ExchOrderTime": "/Date(1707279047000+0530)/",
"ExchType": "D",
"MarketLot": 165,
"OldorderQty": 0,
"OrderRequesterCode": "client_code",
"OrderStatus": "Fully Executed",
"OrderValidUpto": "07 Feb 2024",
"OrderValidity": 0,
"PendingQty": 0,
"Qty": 165,
"Rate": 4.55,
"Reason": "",
"RemoteOrderID": "MAE",
"RequestType": "P",
"SLTriggerRate": 0,
"SLTriggered": "N",
"SMOProfitRate": 0,
"SMOSLLimitRate": 0,
"SMOSLTriggerRate": 0,
"SMOTrailingSL": 0,
"ScripCode": 43899,
"ScripName": "BANKNIFTY 07 Feb 2024 CE 47000.00",
"TerminalId": 46188,
"TradedQty": 165,
"WithSL": "N"
}
],
"Status": 0
},
"head": {
"responseCode": "5POrdBkV3",
"status": "0",
"statusDescription": "Success"
}
}
{
"body": {
"Message": "Invalid Session",
"OrderBookDetail": [],
"Status": 9
},
"head": {
"responseCode": "IIFLMarRQOrdBkV3",
"status": "0",
"statusDescription": "Success"
}
}
{
"head": {
"responseCode": "5POrdBkV3",
"status": "0",
"statusDescription": "Success"
},
"body": {
"Message": "No Order found for this Client.",
"OrderBookDetail": [],
"Status": 1
}
}