CANCEL ALL MULTILEG ORDERS API
This API allows you to cancel existing multileg / spread orders from the order book.
- If
flag = true → Cancels all multileg orders
- Otherwise → Cancels only the orders provided in the
orders array
| Header | Type | Description | Example |
|---|
| Content-Type | string | Specifies the media type of the request | application/json |
| Authorization | string | Access token for authenticated requests | {{access_token}} |
| x-api-key | string | API key used to authorize the request | {{x-api-key}} |
📑 Request Body Parameters
| Field | Type | Required | Description | Example |
|---|
| client_id | string | No | Client ID for order cancellation | "CL12345" |
| flag | boolean | Yes | If true, cancels all multileg orders | true |
| orders | array | No | List of orders to cancel (required if flag = false) | Refer below |
📦 Orders Array Fields
| Field | Type | Description | Example |
|---|
| type | string | Multileg order type (SPREAD, 2L, 3L) | "SPREAD" |
| validity | string | Order validity | "IOC" |
| prot_perc | string | Protection percentage | "5" |
| order_time | integer | Order time | 1234567890 |
| gateway_order_no | string | Gateway order number | "AAAEE00005" |
| status | string | Current order status | "OPEN" |
| leg_details | array | Individual leg details | Refer respective schema |
🟢 Success Response - 200 OK
Content-Type: application/json
| Field | Type | Description | Example |
|---|
| status | string | Status of API call | "success" |
| code | string | Response code to user request | "s-101" |
| message | string | Success message | "Orders cancelled successfully" |
| data | array | List of order cancellation results | Refer to Data Object Fields |
📦 Data Object Fields
| Field | Type | Description | Example |
|---|
| orderId | string | System-generated order identifier | "ORD12345" |
| gateway_order_no | string | Gateway order reference number | "AAAEE00005" |
| status | string | Status of cancellation | "success" |
| message | string | Result message | "Order cancelled successfully" |