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

KEYVALUE

Content-Type

application/json

Authorization

bearer {Your Access Token}

Request body

FIELD NAMEMANDATORYDESCRIPTION

head

Key

STRING

Yes

AppKey of User or Partner 

body

ExchangeOrderID

STRING

Yes

It is the order ID generated by the exchange

 
SAMPLE REQUEST BODY  :

{
    "head": {
        "key": "{Your App Key}"
    },
    "body": {
        "ExchOrderID":"1000000000000970"
    }
}

Response body

FIELD NAMEVALUESDESCRIPTION

head

responseCode

STRING

5PCancelOrdReqV1

This is the unique response code for the API.

status

STRING

-1: Server unable to process your request

0: Success

1: Invalid input parameters.

2: Invalid head parameters.

This is the status code which depicts the status of API request to the server.

statusDescription

STRING

Server unable to process your request

Success

Invalid input parameters.

Invalid head parameters.

This is the description of the status received from the server for the API request.

body

BrokerOrderID

INTEGER

-

This is the order ID generated from the 5paisa's end

ClientCode

STRING

-

This is the 5paisa demat account client code of the user

Exch

STRING

N: NSE
B: BSE
M: MCX
 

This is the exchange of the instrument

ExchOrderID

STRING

-

This is the order ID generated by the exchange

ExchType

STRING

C: Cash
D: Derivatives (FnO of NSE, BSE & MCX)
U: Currency 

This is the exchange segment for the order

LocalOrderID

INTEGER

-

This is the numeric local order ID generated by the user

Message

STRING

0: Success
1: 5paisa System (RMS) Response
2: Invalid Input Parameters.
9: Authentication Fails
 

This is the status description of the order API request based on input parameters

RMSResponseCode

INTEGER

-

This is the status code of the order received from 5paisa system

RemoteOrderID

STRING

-

This is the unique order ID passed for the order while sending the request

ScripCode

INTEGER

-

This is the numeric code for the instrument in which order has been placed

Status

INTEGER

0: Success
1: 5paisa System (RMS) Response
2: Invalid Input Parameters.
9: Authentication Fails

This is the status code of the API response

Time

DATETIME

-
 

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

Knowledge base

Bracket/cover order API is the next thing to checkout
Place BO/CO API
How to use this API that suits your work flow best
Start using our APIs

Contribute and get rewarded

Help make these Dev Docs great, contribute to the APIs and get rewarded for your contribution

Need Help

Ask Developer Community

Contact Support

 

Changelog

Changes made to our APIs - Changelog

AVENUES