☰
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.9K
All Categories
0
Incidents
156
Node JS client
40
Go client
793
.Net API client
380
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
347
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
January 31
vish045
January 30
sujith
Getting 405 Request method not allowed
vish045
January 30
edited January 30
in
Java client
Hi Team,
I was trying to place a BUY order for an option using the below attributes, I am getting 405 error code with message : Request method not allowed
Order params : {
"exchange" : "NFO",
"tradingsymbol" : "NIFTY2420121700CE",
"transactionType" : "BUY",
"quantity" : 50,
"price" : 222.0,
"product" : "MIS",
"orderType" : "MARKET",
"validity" : "DAY",
"disclosedQuantity" : null,
"triggerPrice" : null,
"squareoff" : null,
"stoploss" : null,
"trailingStoploss" : null,
"tag" : "TEST_NFO_TAG",
"parentOrderId" : null,
"validityTTL" : 0,
"icebergQuantity" : 0,
"icebergLegs" : 0,
"auctionNumber" : null
}
Could you please check what is wrong here. I am using kiteconnect version: 3.3.2 in my java application
2024-01-30 09:38:41.811+0530 - INFO 5912 [3-exec-8] okhttp3.OkHttpClient : {"status":"error","message":"Request method not allowed","data":null,"error_type":"GeneralException"}
2024-01-30 09:38:41.811+0530 - INFO 5912 [3-exec-8] okhttp3.OkHttpClient : <-- END HTTP (101-byte body)
2024-01-30 09:38:41.812+0530 -ERROR 5912 [3-exec-8] c.v.f.r.service.KiteService : KiteException occurred while placing order, code: 405, message: Request method not allowed
com.zerodhatech.kiteconnect.kitehttp.exceptions.GeneralException: null
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.dealWithException(KiteResponseHandler.java:52)
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:362)
at com.vish.fno.reader.service.KiteService.placeOptionOrder(KiteService.java:110)
Tagged:
java
kiteconnect
javakiteconnect
MIS
sujith
January 30
Did you try adding variety and place order?
sujith
January 30
You can check out the samples of javakiteconnect.
vish045
January 30
I dont see varierty in OrderParams POJO :
https://github.com/zerodha/javakiteconnect/blob/master/kiteconnect/src/com/zerodhatech/models/OrderParams.java
and these is no sample available for MARKET order for MIS Option order :
https://github.com/zerodha/javakiteconnect/blob/master/sample/src/Examples.java
vish045
January 30
Do you mean Constants.VARIETY_REGULAR, while calling placeOrder ?
vish045
January 30
Still seeing GeneralException trying Constants.VARIETY_REGULAR order with parameters :
{
"exchange" : "NFO",
"tradingsymbol" : "NIFTY2420121700CE",
"transactionType" : "BUY",
"quantity" : 50,
"price" : 0.0,
"product" : "MIS",
"orderType" : "MARKET",
"validity" : "DAY",
"disclosedQuantity" : null,
"triggerPrice" : 0.0,
"squareoff" : null,
"stoploss" : null,
"trailingStoploss" : null,
"tag" : null,
"parentOrderId" : null,
"validityTTL" : 0,
"icebergQuantity" : 0,
"icebergLegs" : 0,
"auctionNumber" : null
}
vish045
January 31
Its working now, thanks sujith.
This discussion has been closed.
and these is no sample available for MARKET order for MIS Option order : https://github.com/zerodha/javakiteconnect/blob/master/sample/src/Examples.java
{
"exchange" : "NFO",
"tradingsymbol" : "NIFTY2420121700CE",
"transactionType" : "BUY",
"quantity" : 50,
"price" : 0.0,
"product" : "MIS",
"orderType" : "MARKET",
"validity" : "DAY",
"disclosedQuantity" : null,
"triggerPrice" : 0.0,
"squareoff" : null,
"stoploss" : null,
"trailingStoploss" : null,
"tag" : null,
"parentOrderId" : null,
"validityTTL" : 0,
"icebergQuantity" : 0,
"icebergLegs" : 0,
"auctionNumber" : null
}