Doc Fundamentals
Funds Management
Order Management
Portfolio Management
User Authentication
Modify Order
Daily API Calls
Success Rate
Avg. Response Time
This API provides a modification functionality to the users where they can modify any order which is not executed successfully yet. The users can change the price, quantity and stop loss price as well as the type of order from limit to market order and market to limit order.
Please note you just need to pass the filed to be modified along with exchangeOrderId, passing all other fields is not mandatory.
The API requires “ExchangeOrderID” for order identification which can be fetched from order book. This API requires authentication for successful execution, and it can be provided by passing the access token received through OAUTH or TOTP.
ExchangeOrderId
Please note modify API required ExchangeOrderId to modify an Order. There are 2 ways to fetch exchOrderId for an order, either through OrderBook with help of mapping brokerOrderId to exchOrderId or through Order Status API with help of remoteOrderID.
https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V1/ModifyOrderRequest
Headers
KEY | VALUE |
---|---|
Content-Type | application/json |
Authorization | bearer {Your Access Token} |
Request body
FIELD NAME | MANDATORY | DESCRIPTION | ||
---|---|---|---|---|
p_Data | head | UserKeySTRING | Yes | User Key of the client received along with API |
body | ExchangeOrderIDSTRING | Yes | It is the order ID generated by the exchange | |
PriceDOUBLE | No | It is the price at which order needs to be placed | ||
QtyINTEGER | No | Total quantity in the modified order | ||
StopLossPriceDOUBLE | No | It is the stop loss price for the order | ||
DisQtyINTEGER | No | It is the quantity disclosed to the market |
Note
- The 0 value of price indicates order to be of at-market type. It takes market price by default.
- Disclosed quantity passed in the field “DisQty” should always be less than or equal to the value of the field “Qty”.
{
"head": {
"key": "{{Your App Key}}"
},
"body": {
"Price":"0",
"StopLossPrice":"449",
"ExchOrderID": "1100000018012644"
}
}
Response body
FIELD NAME | VALUES | DESCRIPTION | |
---|---|---|---|
head | responseCodeSTRING | 5PModifyOrdReqV1 | This is the unique response code for the API. |
statusSTRING | -1: Server unable to process your request0: Success1: Invalid input parameters.2: Invalid head parameters. | This is the status code which depicts the status of API request to the server. | |
statusDescriptionSTRING | Server unable to process your requestSuccessInvalid input parameters.Invalid head parameters. | This is the description of the status received from the server for the API request. | |
body | BrokerOrderIDINTEGER | - | This is the order ID generated from the 5paisa end |
ClientCodeSTRING | - | This is the 5paisa demat account client code of the user | |
ExchSTRING | N: NSE | This is the exchange of the instrument | |
ExchOrderIDSTRING | - | This is the order ID generated by the exchange | |
ExchTypeSTRING | C: Cash | This is the exchange segment for the order | |
MessageSTRING | 0: Success | This is the status description of the order API request based on input parameters | |
RMSResponseCodeINTEGER | - | This is the status code of the order received from 5paisa Securities system | |
RemoteOrderIDSTRING | - | This is the unique order ID passed for the order while sending the request | |
ScripCodeINTEGER | - | This is the numeric code for the instrument in which order has been placed | |
StatusINTEGER | 0: Success | This is the status code of the API response | |
TimeDATETIME | - | This is the time at which order has been placed |
{
"body": {
"BrokerOrderID": 292699,
"ClientCode": "{clientcode}",
"Exch": "B",
"ExchOrderID": "116718512092173",
"ExchType": "D",
"LocalOrderID": 4,
"Message": "Exchange is closed. Cannot Modify your order.",
"RMSResponseCode": -15,
"RemoteOrderID": "1716729926",
"ScripCode": 86752,
"Status": 1,
"Time": "/Date(171674800000+0530)/"
},
"head": {
"responseCode": "5PModifyOrdReqV1",
"status": "0",
"statusDescription": "Success"
}
}
{
"body": null,
"head": {
"responseCode": "5PModifyOrdReqV1",
"status": "2",
"statusDescription": "Invalid head parameters."
}
}
Invalid Token
{
"body": {
"BrokerOrderID": 0,
"ClientCode": "client_code",
"Exch":"N",
"ExchOrderID": "0",
"ExchType":"C",
"LocalOrderID": 0,
"Message": "Order does not exist",
"RMSResponseCode": 0,
"RemoteOrderID": "",
"ScripCode": 0,
"Status": 1,
"Time": "/Date(1716811251790+0530)/"
},
"head": {
"responseCode": "5PModifyOrdReqV1",
"status": "0",
"statusDescription": "Success"
}
}