Placing CO order failed with error

apind81
apind81 edited October 2020 in Python client
kite.place_order(tradingsymbol=tradingsymbol, exchange=exchange, quantity=trade_quantity,
transaction_type=transaction_type, order_type="MARKET", validity="DAY", product="MIS",
trigger_price=sl_price, variety="CO")
Above python code for placing CO order failed with below error:
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/Desktop/Kite/Banknifty-v1.py', wdir='C:/Users/Desktop/Kite')

File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)

File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Desktop/Kite/Banknifty-v1.py", line 214, in
start()

File "C:/Users/Desktop/Kite/Banknifty-v1.py", line 209, in start
place_order(new_order_type,ltp3)

File "C:/Users/Desktop/Kite/Banknifty-v1.py", line 136, in place_order
trigger_price=sl_price, variety="CO")

File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 346, in place_order
return self._post("order.place", params)["order_id"]

File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 821, in _post
return self._request(route, "POST", params)

File "C:\Users\AppData\Local\Continuum\Anaconda3\lib\site-packages\kiteconnect\connect.py", line 886, in _request
raise exp(data["message"], code=r.status_code)

InputException: Invalid `api_key` or `access_token`.
Tagged:
This discussion has been closed.