400 Error while placing order on commodity

vipbhavsar
I am getting 400 error while placing commodity order on SilverMIC. I am sending following OrderParams for Order

orderParams.quantity = 1
orderParams.orderType = Constants.ORDER_TYPE_MARKET;
orderParams.tradingsymbol = "SILVERMIC22APRFUT";
orderParams.product = Constants.PRODUCT_MIS;
orderParams.exchange = Constants.EXCHANGE_MCX;
orderParams.transactionType = Constants.TRANSACTION_TYPE_BUY;
orderParams.validity = Constants.VALIDITY_DAY;

kiteConnect.placeOrder(orderParams, Constants.VARIETY_REGULAR);

Can you please suggest, if I am missing anything?
  • sujith
    You can either print the exception message and see the correct message or run javakiteconnect with debug logs on and see the raw json response.
  • SRIJAN
    Use "MCX" instead of constant.
  • vipbhavsar
    @SRIJAN - Using "MCX" did not work
    @sujith - new KiteConnect("api_key", true); prints message as null

    Exception code - 400
    Exception message - null

    Any other change required to print detailed message?
  • SRIJAN
    Use try-catch block.
  • sujith
    @vipbhavsar,
    Can you paste the complete stacktrace here with debug log on?

    PS: Make sure to remove app and client specific tokens.
Sign In or Register to comment.