CANCEL ALL MULTILEG ORDERS API
This API enables cancellation of Multileg Orders for authorized end users through a middleware-based integration.
Bulk cancellation can be performed by passing one or more Multileg/Spread Orders in the request payload.
🔍 Query Parameters
| Parameter | Type | Required | Description | Example |
|---|
| userId | string | Yes | User ID (UCC) | "{{user_id}}" |
| Header | Type | Description | Example |
|---|
| Content-Type | string | Request payload format | application/json |
| Authorization | string | Access token for authenticated requests | {{access_token}} |
| x-api-key | string | API key used to authorize request | {{x-api-key}} |
📑 Request Body Parameters
| Field | Type | Required | Description | Example |
|---|
| flag | boolean | Yes | If set to true, all specified Multileg orders will be cancelled | true |
| orders | array | Yes | List of Multileg/Spread Orders to be cancelled | Refer Order Object Fields |
| status | string | No | Current status of the Multileg Order | "OPEN" |
📦 Order Object Fields
| Field | Type | Required | Description | Example |
|---|
| type | string | Yes | Type of Multileg Order | "SPREAD" |
| validity | string | No | Order validity | "IOC" |
| prot_perc | string | No | Protection percentage | "5" |
| order_time | integer | No | Order timestamp | 1688123456 |
| gateway_order_no | string | Yes | Gateway Order Number | "AAAEE00005" |
| leg_details | array | Yes | Individual order leg details | Refer Leg Detail Fields |
📦 Leg Detail Fields
| Field | Type | Required | Description |
|---|
| leg_no | integer | Yes | Leg number |
| others | object | No | Additional scrip attributes |
| price | string | No | Order leg price |
| quantity | number | No | Order leg quantity |
| scrip_info | array | Yes | Scrip details for the leg |
| transaction_type | string | No | Buy or Sell transaction type |
📦 Other Attributes (others)
| Field | Type | Description | Example |
|---|
| market_lot | integer | Lot size of the scrip | 50 |
| price_tick | number | Tick size of the scrip | 0.05 |
| decimal_loc | number | Decimal Locator | 2 |
| Field | Type | Description | Example |
|---|
| exchange | string | Exchange segment | "NSE_FO" |
| scrip_token | integer | Exchange token number of the instrument | 56838 |
| symbol | string | Trading symbol | "NIFTY" |
| series | string | Series applicable for equities | "EQ" |
| expiry_date | string (date) | Expiry date in yyyy-mm-dd format | "2026-07-30" |
| strike_price | number | Strike price for options | 2500000 |
| option_type | string | Option type | "CE" |
| instrument_name | string | Instrument name | "OPTIDX" |
🟢 Success Response - 200 OK
Content-Type: application/json
| Field | Type | Description | Example |
|---|
| status | string | Status of API call | "success" |
| code | string | Response code | "s-101" |
| message | string | Success message | "Orders cancelled successfully" |
| data | array | Order-wise cancellation status | Refer Data Object Fields |
📦 Data Object Fields
| Field | Type | Description | Example |
|---|
| orderId | string | System-generated order identifier | "25070100012345" |
| gateway_order_no | string | Gateway Order Number | "AAAEE00005" |
| status | string | Cancellation status of the order | "CANCELLED" |
| message | string | Order-specific response message | "Order cancelled successfully" |
📝 Notes
- Used to cancel multiple Multileg or Spread Orders in a single request.
- Supports:
- Spread Orders (
SPREAD)
- Two-Leg Orders (
2L)
- Three-Leg Orders (
3L)
flag should be set to true to initiate bulk cancellation.
- Each order is processed independently and returns its own status and message.