☰
Login
Signup
Home
›
Java client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
14.1K
All Categories
0
Incidents
158
Node JS client
43
Go client
801
.Net API client
386
Kite Publisher
538
.Net / VBA / Excel (3rd party)
465
Algorithms and Strategies
1K
Java client
1.1K
API clients
408
PHP client
4.1K
Python client
349
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.4K
General
In this Discussion
February 2022
vipbhavsar
February 2022
SRIJAN
February 2022
sujith
400 Error while placing order on commodity
vipbhavsar
February 2022
in
Java client
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
February 2022
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
February 2022
Use "MCX" instead of constant.
vipbhavsar
February 2022
@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
February 2022
Use try-catch block.
sujith
February 2022
@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.
@sujith - new KiteConnect("api_key", true); prints message as null
Exception code - 400
Exception message - null
Any other change required to print detailed message?
Can you paste the complete stacktrace here with debug log on?
PS: Make sure to remove app and client specific tokens.