It looks like you're new here. If you want to get involved, click one of these buttons!
import requests
headers = {
'X-Kite-Version': '3',
'Authorization': 'token api_key:access_token',
'Content-Type': 'application/json',
}
data = '[ { "exchange": "NSE", "tradingsymbol": "INFY", "transaction_type": "BUY", "variety": "regular", "product": "CNC", "order_type": "MARKET", "quantity": 1, "price": 0, "trigger_price": 0 } ]'
response = requests.post('https://api.kite.trade/margins/orders', headers=headers, data=data)
I get 'Response [400]' error when I execute the above. What is the error?
Everything seems to be correct. Can you print the response text and paste it here?
print(response.text)
I was new to using Response command and hence when I used to print response I used to get Response [400]. Worked when I did response.text. Thank you!