Error in cancelling Regular order

techsolve
Hi team,

Today I faced an issue in canceling a regular order which is in the Open position. It gave the following error:

"Order cannot be canceled as it is being processed. Try later."

This is what I tried:
curl --request DELETE "https://api.kite.trade/orders/regular/[My Order Number]" -H "X-Kite-Version: 3" -H "Authorization: token API_Key:Access Token"

Result:
{"status":"error","message":"Order cannot be cancelled as it is being processed. Try later.","data":null,"error_type":"InputException"}


Can you please tell me what is the reason behind this and how to fix it?

Thanks in advance.
  • sujith
    This is because you are trying to send a cancel request when the order processing is still going on.
    You need to make sure order is in the open state or trigger pending state.
  • techsolve
    We executed this order and after an hour or so tried to exit out of it. Do we need to wait more to check the "open" state of the order? How much time does it take to have the order in "Open" state after initial execution? Awaiting your response.
  • sujith
    Can you private message your order id and client id?
    We will check and get back to you.
  • sujith
    This is because you were trying to cancel an executed order.
    For exiting a position, you can check out this thread.
  • techsolve
    Got it. Thanks for your support.
This discussion has been closed.