Back to home
Doc Fundamentals
API Reference
Funds Management
Order Management
Portfolio Management
User Authentication
Cancel Order
POSTJSONRest API
0
Daily API Calls
100%
Success Rate
150ms
Avg. Response Time
The API allows the user to cancel the order which has not been executed successfully yet.
The API can cancel the order by passing just exchange order ID. These details for any order can be fetched from the Order Status, Order book or Order Webscoket.
REQUEST URL
https://Openapi.5paisa.com/VendorsAPI/Service1.svc/V1/CancelOrderRequest
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 | ExchangeOrderIDSTRING | Yes | It is the order ID generated by the exchange |
SAMPLE REQUEST BODY :
{
"head": {
"key": "{Your App Key}"
},
"body": {
"ExchOrderID":"1000000000000970"
}
}
Response body
FIELD NAME | VALUES | DESCRIPTION | |
---|---|---|---|
head | responseCodeSTRING | 5PCancelOrdReqV1 | 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's 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 | |
LocalOrderIDINTEGER | - | This is the numeric local order ID generated by the user | |
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 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 cancelled |
SAMPLE SUCCESS RESPONSE
{
"body": {
"BrokerOrderID": 555919893,
"ClientCode": "5paisa_CLIENT",
"Exch": "N",
"ExchOrderID": "0",
"ExchType": "C",
"LocalOrderID": 0,
"Message": "Success",
"RMSResponseCode": 0,
"ScripCode": 2885,
"Status": 0,
"Time": "/Date(1637433000000+0530)/"
},
"head": {
"responseCode": "5PCancelOrdReqV1",
"status": "0",
"statusDescription": "Success"
}
}
SAMPLE FAILURE RESPONSE Failure due to invalid user key being passed in the request
{
"body": null,
"head": {
"responseCode": "5PCancelOrdReqV1",
"status": "2",
"statusDescription": "Invalid Head Parameters"
}
}
Failure due to missing mandatory parameters in the request
{
"body": {
"BrokerOrderID": 0,
"ClientCode": "5paisa_Client",
"Exch":"?”,
"ExchOrderID": "0",
"ExchType":"?”,
"LocalOrderID": 0,
"Message": "Invalid Input Parameters.",
"RMSResponseCode": 0,
"ScripCode": 0,
"Status": 2,
"Time": "/Date(1637494757568+0530)/"
},
"head": {
"responseCode": "5PCancelOrdReqV1",
"status": "0",
"statusDescription": "Success"
}
}
On this Page