Kite Input Exception

Avinash34
OrderParams coverOrderParams = new OrderParams();
coverOrderParams.tradingsymbol = "HDFC BANK";
coverOrderParams.transactionType = Constants.TRANSACTION_TYPE_BUY;
coverOrderParams.quantity = 1;
coverOrderParams.price = 1670.1;
coverOrderParams.triggerPrice = 1660.1;
coverOrderParams.product=Constants.PRODUCT_MIS;
coverOrderParams.exchange=Constants.EXCHANGE_NSE;
coverOrderParams.validity=Constants.VALIDITY_DAY;
coverOrderParams.orderType=Constants.ORDER_TYPE_LIMIT;


Order coverOrderResponse = kiteConnect.placeOrder(coverOrderParams, Constants.VARIETY_CO);
System.out.println("Cover Order placed successfully: Order ID - " + coverOrderResponse.orderId);

Error :
com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.dealWithException(KiteResponseHandler.java:55)
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(KiteResponseHandler.java:21)
at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.postRequest(KiteRequestHandler.java:90)
at com.zerodhatech.kiteconnect.KiteConnect.placeOrder(KiteConnect.java:389)

Above is my code , I am not understanding why I am getting input exception , please let me know if I gave something wrong , for above I have followed example code kite github , I have even set up TOTP also. I read previous threads nothing solved my query.
  • rakeshr
    Can you enable the debug log and paste complete stack trace here?
  • Avinash34
    @rakeshr Thanks for reply! I think this is the issue , but in which case do we get this? I thought this much of logs would be enough , please let me know if you still wanna see complete logs.
    Aug 25, 2023 12:08:36 PM okhttp3.internal.platform.Platform log
    INFO:
    Aug 25, 2023 12:08:36 PM okhttp3.internal.platform.Platform log
    INFO: {"status":"error","message":"The instrument you are placing an order for has either expired or does not exist.","data":null,"error_type":"InputException"}
    Aug 25, 2023 12:08:36 PM okhttp3.internal.platform.Platform log
    INFO: <-- END HTTP (154-byte body)
    com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException
    at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.dealWithException(KiteResponseHandler.java:55)
    at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(KiteResponseHandler.java:21)
    at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.postRequest(KiteRequestHandler.java:90)
    at com.zerodhatech.kiteconnect.KiteConnect.placeOrder(KiteConnect.java:389)
    at org.example.Main.placeCoverOrderWithStopLoss(Main.java:256)
    at org.example.Main$1.run(Main.java:188)
    at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
    at java.base/java.util.TimerThread.run(Timer.java:516)
  • sujith
    You seem to be sending the wrong tradingsymbol, you can check the correct tradingsymbol from the instruments master.
  • Avinash34
    Thank you @sujith and @rakeshr , it worked!
This discussion has been closed.