place_order returning some order_id class object

chinmay_23
When i'm placing an order. It's reurning an object " " . How can i get the order_id for that order without having to call function for details of all the orders. Technically i should be recieving a dictionary right?
  • rakeshr
    Yes, it returns an order_id. You can check the python doc here.
  • chinmay_23
    But it should return a dictionary. But it is returning a object from which i cannot access the order_id.
  • chinmay_23
    Also i was facing another error today.
    I logged into the API using
    'kite = KiteConnect(api_k)
    kite.set_access_token(access_token)'

    and i was trying to place order using
    'order_id = kite.place_order('REGULAR','NSE','SBIN','SELL',1,'MIS','LIMIT',price=430)'
    But it was giving an error : '*** kiteconnect.exceptions.InputException: Invalid `api_key` or `access_token`'

    but i'm able to access the 'kite.ltp()' , 'kite.orders()' historical data function and all the other functions it is giving the above given error only while placing the order.
  • rakeshr
    But it should return a dictionary.
    place_order extract order_id value from the dictionary. So, it returns a value i.e string in python client lib.
    'order_id = kite.place_order('REGULAR','NSE','SBIN','SELL',1,'MIS','LIMIT',price=430)'
    You need to use 'regular' instead of 'REGULAR' for order variety, check all order param detail here.
    But it is returning a object from which i cannot access the order_id.
    Can you paste here complete order param? we will take a look.
Sign In or Register to comment.