Hi Team,
Margin V2 endpoint is throwing error
'{“errorType”:“Order_Error”,“errorCode”:“DH-906”,“errorMessage”:“Incorrect request for order and cannot be processed”}
Request you to confirm if endpoint is working
Developer Kit SS
import http.client
import json
def calculate_margin(dhanClientId,token,exchangeSegment, transactionType, quantity, productType, securityId, price, triggerPrice):
payload = {
"dhanClientId": dhanClientId,
"exchangeSegment": exchangeSegment,
"transactionType": transactionType,
"quantity": quantity,
"productType": productType,
"securityId": securityId,
"price": price,
"triggerPrice": triggerPrice
}
headers = {
'access-token': token,
'Content-Type': "application/json",
'Accept': "application/json"
}
conn = http.client.HTTPSConnection("api.dhan.co")
conn.request("POST", "/v2/margincalculator", json.dumps(payload), headers)
res = conn.getresponse()
data = res.read()
return data.decode("utf-8")
response = calculate_margin(
dhanClientId=client_id(),
token= access_token(),
exchangeSegment="NSE_EQ",
transactionType="BUY",
quantity=10,
productType="CNC",
securityId="1594", #infy
price=1500,
triggerPrice=0
)
print(response)