Cancel Order APIs (Regular, Bracket Order, Cover Order)

1. Introduction

Kotak Securities provides APIs for cancelling three types of open orders:

Only the endpoint differs for BO/CO cancellations. All headers, request format, and responses remain consistent.

Use these APIs to cancel pending orders before execution.

2. API Endpoints

Order Type Endpoint (after <Base URL>)
Regular Order /quick/order/cancel
Bracket Order (BO) /quick/order/bo/exit
Cover Order (CO) /quick/order/co/exit

Replace <Base URL> with the relevant Kotak environment base URL provided in response from /tradeApiValidate api.

3. Headers

Name Type Description
accept string Should always be application/json
Sid string session sid generated on login
Auth string session token generated on login
neo-fin-key string static value: neotradeapi
Content-Type string Always application/x-www-form-urlencoded

4. Request Body

The request body is a single URL-encoded field named jData, containing a JSON object.

Example Request

# Cancel
curl -X POST "<baseUrl>/quick/order/cancel" \\
  -H "Auth: <session_token>" \\
  -H "Sid: <session_sid>" \\
  -H "neo-fin-key: neotradeapi" \\
  -H "Content-Type: application/x-www-form-urlencoded" \\
  --data-urlencode 'jData={"on":"<orderNo>","am":"NO"}'

# Exit Cover
curl -X POST "<baseUrl>/quick/order/co/exit" \\
  -H "Auth: <session_token>" \\
  -H "Sid: <session_sid>" \\
  -H "neo-fin-key: neotradeapi" \\
  -H "Content-Type: application/x-www-form-urlencoded" \\
  --data-urlencode 'jData={"on":"<orderNo>","am":"NO"}'

# Exit Bracket
curl -X POST "<baseUrl>/quick/order/bo/exit" \\
  -H "Auth: <session_token>" \\
  -H "Sid: <session_sid>" \\
  -H "neo-fin-key: neotradeapi" \\
  -H "Content-Type: application/x-www-form-urlencoded" \\
  --data-urlencode 'jData={"on":"<orderNo>","am":"NO"}'

Example Request Body (jData)

{
  "am": "NO",
  "on": "********************",
  "ts": "******-**"
}