Cancel Pending Orders
This API allows you to cancel pending opposite orders on your open positions, for all symbols or a single position.
USE CASE
Cancel working opposite orders on a position so you can exit it cleanly.
Details
- This is an added functionality for exit position API. If a user has open positions in particular stocks and also working opposite order of the particular stock, the user can close the working orders and then exit the open positions.
- The following should be passed in the body of the DELETE method of positions to cancel the pending orders:
- It uses the same
DELETE /api/v3/positionsendpoint as Exit Position. Apending_orders_cancelvalue of 1 in the body selects this action. - It is an add-on to the Exit Position API. The pending orders are cancelled so that the position can be exited.
- To limit it to one symbol, also send the position id in the body, for example
NSE:SBIN-EQ-INTRADAY. - Without a position id, pending orders are cancelled for all open positions that have a working opposite order.
- Rate limits differ between the Standard and Prime plans. See Plans & rate limits.
{"pending_orders_cancel": 1}
If only a single symbol's order and position needs to be cancelled, the position ID should also be sent in the body:
{"id": "NSE:SBIN-EQ-INTRADAY","pending_orders_cancel": 1}
Request Attributes
| Attribute | Data Type | Description |
|---|---|---|
pending_orders_cancel* | int | Must be set to 1 in the request body to cancel the pending working order(s) associated with a position before exiting it. Eg: 1 |
id | string | Optional. Position ID to target a single symbol's working order and position for cancellation/exit instead of all. Eg: NSE:SBIN-EQ-INTRADAY |
Response Attributes
| Attribute | Data Type | Description |
|---|---|---|
s | string | Status of the request. Eg: ok / error |
code | int | Response code identifying the specific response. Eg: 200 |
message | string | Message describing the result of the request. Eg: The position is closed. |
Last updated on