import requests
import json
url = “https://api-sandbox.upstox.com/v2/order/place”
payload = json.dumps({
“quantity”: 2100,
“product”: “D”,
“validity”: “DAY”,
“price”: 0,
“tag”: “string”,
“instrument_token”: “NSE_FO|123456”,
“order_type”: “MARKET”,
“transaction_type”: “BUY”,
“disclosed_quantity”: 0,
“trigger_price”: 0,
“is_amo”: False
})
headers = {
‘Content-Type’: ‘application/json’
}
response = requests.request(“POST”, url, headers=headers, data=payload)
print(response.text)