Not able to get order detail using kite.orders(orderid)

travian
Getting this error

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
  • Vivek
    @travian You are getting this everytime you call the order info api? or is it intermittent?
  • travian
    I am getting it today only. I didn't face it before. For all the orders, i am getting this error today.
  • Vivek
    @travian can you pm your api details along with acces token and order id please.
  • travian
    sent.
    kite.orders() is working fine, but when called with specific order id, it is giving error
  • Guhan
    I am having same problem

    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
  • Guhan
    but kite.orders() is working
  • sujith
    Hi @Guhan,
    It seems to be working fine. Can you elaborate what you are trying to do?
  • Guhan
    I was testing order_place and postback of kite...
    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)
  • Guhan
    i am getting the error that i mentioned before.
  • Guhan
    @sujith I forgot to tag your name for above reply, so tagging now
  • sujith
    @Guhan,
    Try logging in again and place order or fetch order.
  • Guhan
    @sujith I tried again but it is not working
    >>> 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
  • sujith
    Please follow up on this thread.
This discussion has been closed.