Using this code, the order was placed successfully and was also executed successfully (I saw that order was executed in Kite). Order id is: 171017000220682. However, since its a bracket order, if the order was executed, two corresponding sell-side orders should also have been placed automatically (one for Square-off value and one for stop-loss). But I don't see this in Kite.
You have placed MIS order and not bracket order.
You can check out example for placing bracket order here.
You need to pass variety as 'bo'.
After your clarification, I have modified the code to:
payload = {}
payload['api_key']=api_key
payload['access_token']=access_token
payload['tradingsymbol']="RELCAPITAL"
payload['exchange']="NSE"
payload['transaction_type']="BUY"
payload['order_type']="LIMIT"
payload['quantity']=1
payload['product']="MIS"
payload['validity']="DAY"
payload['price']=550
payload['squareoff_value']=552
payload['stoploss_value']=0.5
response = requests.post("https://api.kite.trade/orders/regular", data=payload, order_variety='bo')
When I run, I get an error message: "request() got an unexpected keyword argument 'order_variety'"
I tried replacing "order_variety" with "variety" but still get the same error. What is the exact parameter name that I need to pass?
Your final endpoint must be "https://api.kite.trade/orders/bo".