kite.orders('160823000008781') Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.7/site-packages/kiteconnect/__init__.py", line 321, in orders return self._get("orders.info", {"order_id": order_id}) File "/Library/Python/2.7/site-packages/kiteconnect/__init__.py", line 440, in _get return self._request(route, "GET", params) File "/Library/Python/2.7/site-packages/kiteconnect/__init__.py", line 526, in _request raise(exp(data["message"], code=r.status_code)) kiteconnect.exceptions.DataException: Invalid response from OMS
kite.orders() is working fine, but when called with specific order id, it is giving error
kite.orders("170317000372587")
Traceback (most recent call last):
File "", line 1, in
kite.orders("170317000372587")
File "C:\Python27\lib\site-packages\kiteconnect\__init__.py", line 342, in orders
return self._get("orders.info", {"order_id": order_id})
File "C:\Python27\lib\site-packages\kiteconnect\__init__.py", line 463, in _get
return self._request(route, "GET", params)
File "C:\Python27\lib\site-packages\kiteconnect\__init__.py", line 554, in _request
raise(exp(data["message"], code=r.status_code))
TokenException: Invalid token
It seems to be working fine. Can you elaborate what you are trying to do?
a = kite.order_place(tradingsymbol = 'INFY', quantity = 1, exchange = 'NSE', transaction_type = 'BUY', order_type = 'LIMIT', product = 'MIS', price = 2000)
>>> a
u'170317000372587'
>>> kite.orders(a)
Try logging in again and place order or fetch order.
>>> from kiteconnect import KiteConnect
>>> kite = KiteConnect(api_key = api_key')
>>> kite.set_access_token(access_token)
>>> kite.order_place(exchange = 'NSE', tradingsymbol = 'ASHOKLEY',
transaction_type = 'BUY', quantity = 1,
price = 105.05, product = 'MIS',
order_type = 'LIMIT', squareoff_value = 1,
stoploss_value = 1,trailing_stoploss = 1)
u'170317000458124'
>>> kite.orders('170317000458124')
Traceback (most recent call last):
File "", line 1, in
kite.orders('170317000458124')
File "C:\Python27\lib\site-packages\kiteconnect\__init__.py", line 342, in orders
return self._get("orders.info", {"order_id": order_id})
File "C:\Python27\lib\site-packages\kiteconnect\__init__.py", line 463, in _get
return self._request(route, "GET", params)
File "C:\Python27\lib\site-packages\kiteconnect\__init__.py", line 554, in _request
raise(exp(data["message"], code=r.status_code))
TokenException: Invalid token