☰
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
13.8K
All Categories
0
Incidents
153
Node JS client
39
Go client
793
.Net API client
378
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
992
Java client
1.1K
API clients
403
PHP client
4K
Python client
346
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
April 2022
dezmozz
April 2022
SRIJAN
Unable to place order - com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException
dezmozz
April 2022
in
Java client
Tried to place an order with the following code
public class OrderServices {
public static void BuyOrder(KiteConnect kiteSdk) throws KiteException, IOException {
OrderParams orderParams = new OrderParams();
orderParams.quantity = 1;
orderParams.orderType = Constants.ORDER_TYPE_MARKET;
orderParams.tradingsymbol = "IDFC";
orderParams.product = Constants.PRODUCT_MIS;
orderParams.exchange = Constants.EXCHANGE_NSE;
orderParams.transactionType = Constants.TRANSACTION_TYPE_BUY;
orderParams.validity = Constants.VALIDITY_IOC;
orderParams.price = 0.0;
orderParams.triggerPrice = 0.0;
orderParams.tag = "myTag"; //tag is optional and it cannot be more than 8 characters and only alphanumeric is allowed
Order order = kiteSdk.placeOrder(orderParams, Constants.VARIETY_REGULAR);
System.out.println(order.orderId);
}
}
.
.
.
.
.
// ORDER EXECUTION
try{
System.out.println("REQUESTING TO MAKE ORDER");
OrderServices.BuyOrder(kiteSdk);
System.out.println("ORDER SUCCESSFUL ");
} catch(Exception | KiteException e) {
System.out.println("Exception inside orders is :" + e +
" \n " + e.getMessage());
}
Tagged:
orders
InputException
SRIJAN
April 2022
What's the exact exception you are getting?? You can either run javakiteconnect with debug logs or catch and print the exception.
dezmozz
April 2022
This is the message I got.
Exception has occurred: com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException
SRIJAN
April 2022
This doesn't mean anything. You can read the documentation on how to enable debug log in javakiteconnect.
SRIJAN
April 2022
Also,it could be TOTP exception. Have you enabled TOTP??
dezmozz
April 2022
edited April 2022
No I don't have TOTP enabled.
SRIJAN
April 2022
TOTP is mandatory to place orders from third-party apps. You can know how to setup TOTP here:
https://support.zerodha.com/category/your-zerodha-account/login-credentials/login-credentials-of-trading-platforms/articles/time-based-otp-setup-mobile-only
dezmozz
April 2022
Thank you. was able to make order after setting up TOTP.
Sign In
or
Register
to comment.
Exception has occurred: com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException
https://support.zerodha.com/category/your-zerodha-account/login-credentials/login-credentials-of-trading-platforms/articles/time-based-otp-setup-mobile-only