Skip to Content

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/positions endpoint as Exit Position. A pending_orders_cancel value 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

AttributeData TypeDescription
pending_orders_cancel*intMust be set to 1 in the request body to cancel the pending working order(s) associated with a position before exiting it. Eg: 1
idstringOptional. 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

AttributeData TypeDescription
sstringStatus of the request. Eg: ok / error
codeintResponse code identifying the specific response. Eg: 200
messagestringMessage describing the result of the request. Eg: The position is closed.
Last updated on