Got exception in Place Order API But Order got placed

aakash_bh
com.zerodhatech.kiteconnect.kitehttp.exceptions.OrderException: null
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.dealWithException(KiteResponseHandler.java:56) ~[kiteconnect-3
.1.1.jar!/:na]
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(KiteResponseHandler.java:20) ~[kiteconnect-3.1.1.jar!/:
na]
at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.postRequest(KiteRequestHandler.java:85) ~[kiteconnect-3.1.1.jar
!/:na]
at com.zerodhatech.kiteconnect.KiteConnect.placeOrder(KiteConnect.java:291) ~[kiteconnect-3.1.1.jar!/:na]

I got the above error in Place Order API , however the order still got placed. It was a buy order and My code assumed that order failed due to the exception and therefore never created a sell. It was an MIS order, I got charged for not Completing this at 3:20 pm.

The exception doesn't seems to have any information either. How are we supposed to handle these kind of scenarios?
  • sujith
    Can you give us the exact json response and status code from the Kite Connect API?
  • aakash_bh
    I'm not using the API but java SDK. The Place Order sdk call, threw Order Exception with Null as indicated above.
  • sujith
    You need to print the exception message and status code. You can check out the exception structure here.

    You may also run it in debug mode to see what are the params being sent and what is the exact json response.

    You can also check out this thread to know more about the error handling while placing orders.
Sign In or Register to comment.