Cancel Multi Order Beta
Use this API to cancel all open orders in one go. You can filter by segment
or tag
to cancel specific orders, or cancel all open orders with a single request. This applies to both AMO and regular orders. The order_id
s of the cancelled orders will be returned in the response.
Cancel Multi Order Limits and Rate Limits
- A maximum of 200 orders can be cancelled in a single request. Any request exceeding this limit will be rejected.
- The Cancel Multi Order API is subject to a different rate limit compared to the standard limits applied across the system. For more information on the rate limits for this API, please check here.
Header Parameters
Name | Required | Type | Description |
---|---|---|---|
Authorization | true | string | Requires the format Bearer access_token where access_token is obtained from the Token API. |
Accept | true | string | Defines the content format the client expects, which should be set to application/json . |
Query Parameters
Name | Required | Type | Description |
---|---|---|---|
segment | false | string | The segment associated with the open orders. Possible values: NSE_EQ , BSE_EQ , NSE_FO , BSE_FO , MCX_FO , NCD_FO , BCD_FO . |
tag | false | string | The tag associated with the open orders. |
Responses
- 2XX
- 4XX
Response Body
- Success (200)
- Partial Success (207)
{
"status": "success",
"data": {
"order_ids": [
"1644490272000",
"1644490272001",
"1644490272003"
]
},
"errors": null,
"summary": {
"total": 3,
"success": 3,
"error": 0
}
}
Name | Type | Description |
---|---|---|
status | string | A string indicating the outcome of the request. Possible values: success , partial_success , error .success - when all the cancel order request are successful. partial_success - when some cancel order request encountered errors. error - when all the cancel order request encountered errors. |
data | object | Successful response data for cancel multi order request. |
data.order_ids | array | List of reference order IDs associated with successfully cancelled orders. |
errors | array | An array containing the main content of the error response for partial_success and error scenarios. |
errors[].error_code | string | A specific error code. |
errors[].message | string | Descriptive error message. |
errors[].property_path | string | Indicates which part of the request triggered the error. It can be null. |
errors[].invalid_value | string | Shows the value causing the error. It can be null. |
errors[].instrument_key | string | A Key of instrument for a specific order. |
errors[].order_id | string | Order ID associated to specific order. It can be null. |
summary | object | A summary of the outcomes for the batch of orders processed, detailing total orders, successful completions, and errors. |
summary.total | integer | The total number of order present in the payload for cancel multi orders. |
summary.success | integer | Indicates the successful cancelled orders. |
summary.error | integer | Indicates the unsuccessful cancelled orders. |
{
"status": "partial_success",
"data": {
"order_ids": [
"1644490272000",
"1644490272001",
"1644490272003"
]
},
"errors": [
{
"error_code": "UDAPI100500",
"message": "Something went wrong... please contact us",
"property_path": null,
"invalid_value": null,
"order_id": "240923010689802",
"instrument_key": "MCX_FO|436245"
}
],
"summary": {
"total": 4,
"success": 3,
"error": 1
}
}
Name | Type | Description |
---|---|---|
status | string | A string indicating the outcome of the request. Possible values: success , partial_success , error .success - when all the cancel order request are successful. partial_success - when some cancel order request encountered errors. error - when all the cancel order request encountered errors. |
data | object | Successful response data for cancel multi order request. |
data.order_ids | array | List of reference order IDs associated with successfully cancelled orders. |
errors | array | An array containing the main content of the error response for partial_success and error scenarios. |
errors[].error_code | string | A specific error code. |
errors[].message | string | Descriptive error message. |
errors[].property_path | string | Indicates which part of the request triggered the error. It can be null. |
errors[].invalid_value | string | Shows the value causing the error. It can be null. |
errors[].instrument_key | string | A Key of instrument for a specific order. |
errors[].order_id | string | Order ID associated to specific order. It can be null. |
summary | object | A summary of the outcomes for the batch of orders processed, detailing total orders, successful completions, and errors. |
summary.total | integer | The total number of order present in the payload for cancel multi orders. |
summary.success | integer | Indicates the successful cancelled orders. |
summary.error | integer | Indicates the unsuccessful cancelled orders. |
{
"status": "error",
"data": null,
"errors": [
{
"error_code": "UDAPI100500",
"message": "Something went wrong... please contact us.",
"property_path": null,
"invalid_value": null,
"order_id": "240923010689802",
"instrument_key": "NSE_EQ|INE528G01035"
}
],
"summary": {
"total": 1,
"success": 0,
"error": 1
}
}
{
"status": "error",
"errors": [
{
"error_code": "UDAPI1109",
"message": "No open or pending order available",
"property_path": null,
"invalid_value": null
}
]
}
Name | Type | Description |
---|---|---|
status | string | A string indicating the outcome of the request. Possible values: success , partial_success , error .success - when all the cancel order request are successful. partial_success - when some cancel order request encountered errors. error - when all the cancel order request encountered errors. |
data | object | Successful response data for cancel multi order request. |
data.order_ids | array | List of reference order IDs associated with successfully cancelled orders. |
errors | array | An array containing the main content of the error response for partial_success and error scenarios. |
errors[].error_code | string | A specific error code. |
errors[].message | string | Descriptive error message. |
errors[].property_path | string | Indicates which part of the request triggered the error. It can be null. |
errors[].invalid_value | string | Shows the value causing the error. It can be null. |
errors[].instrument_key | string | A Key of instrument for a specific order. |
errors[].order_id | string | Order ID associated to specific order. It can be null. |
summary | object | A summary of the outcomes for the batch of orders processed, detailing total orders, successful completions, and errors. |
summary.total | integer | The total number of order present in the payload for cancel multi orders. |
summary.success | integer | Indicates the successful cancelled orders. |
summary.error | integer | Indicates the unsuccessful cancelled orders. |
Error codes
Error code | Description |
---|---|
UDAPI1108 | Invalid segment. - Please ensure that segment provided in query param is correct. |
UDAPI1109 | No open or pending order available. - Please ensure that there are open or pending orders available. |
UDAPI1110 | Available open or pending orders should not be more than limit. - Please ensure that available open or pending should be within the limit. |
Examples
A comprehensive set of examples is provided to illustrate various use cases and implementation scenarios for this API. To view detailed examples and access sample code, please refer to: API Examples.
Loading...