Not able to place order thru Kite aPI

akum42
I am new to the Kite API tried to place an order the first time but was not able to place it. I am able to access my holding and other data thru kiteConnect.
I am using Orderparam given in the example only.
OrderParams orderParams = new OrderParams();
orderParams.quantity = 1;
orderParams.orderType = Constants.ORDER_TYPE_LIMIT;
orderParams.tradingsymbol = "ASHOKLEY";
orderParams.product = Constants.PRODUCT_CNC;
orderParams.exchange = Constants.EXCHANGE_NSE;
orderParams.transactionType = Constants.TRANSACTION_TYPE_BUY;
orderParams.validity = Constants.VALIDITY_DAY;
orderParams.price = 120.2;
orderParams.triggerPrice = 0.0;
orderParams.tag = "myTag";
order = kiteConnect.placeOrder(orderParams, Constants.VARIETY_REGULAR);
  • akum42
    Error:
    2021-12-13 10:56:15.395 ERROR 50981 --- [ Thread-2] zerodha.KiteTradeApp : null
    at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.dealWithException(KiteResponseHandler.java:54)
    at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(KiteResponseHandler.java:20)
    at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.postRequest(KiteRequestHandler.java:86)
    at com.zerodhatech.kiteconnect.KiteConnect.placeOrder(KiteConnect.java:353)
  • sujith
    Can you paste the exception.message and status code here?
    Maybe you can run javakiteconnect with debug log on and check the json response.
  • akum42
    I am using the following conf for logs(Sprint boot application.yml):
    logging:
    level:
    root: ERROR
    ...
    com.zerodhatech: DEBUG

    Do I need to do something more to enable logs in kiteconnect
  • akum42
    using this to create kiteConnect = new KiteConnect("...",true);
  • akum42
    com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException
  • SRIJAN
    @akum42 what's the exception message you are getting??
  • akum42
    TOTP is mandatory to place orders on third-party apps.
    Let me try to set TOTP
  • rishab
    Great! thanks for sharing, this is helpful.
Sign In or Register to comment.