Error when placing AMO using KiteConnect

When trying the following:

order_id = kite.order_place(
tradingsymbol = scrip,
exchange = data.Exchange,
quantity = int(data.Quantity),
product = data.OrderType,
transaction_type = data.TransType,
order_type = "LIMIT",
price = data.Price,

I get the following exception:

OrderException: Invalid `validity`.

As per the documentation, "AMO" is a valid value for validity:

"validity": [
  • sujith
    Hi @ashwinjain1,
    Orders can have a validity of DAY or IOC. We will update documentation.
    'amo' is a variety. If you want to place after market order you need to send variety as 'amo'.
    Check out the example for placing order here. It has an example for regular order, you can just change the variety of order to make it 'amo'.
  • ashwinjain1
    Dear @sujith,

    Thank you the remedy. Can you also get the following part of the documentation updated -

    "order_variety": [

    I had tried order_variety = "AMO" and it gave me the following error -

    TypeError: order_place() got an unexpected keyword argument 'order_variety'

    The parameter name needs to be changed to variety.
  • sujith
    Thank you for notifying, we will update documentation.
This discussion has been closed.