Order placement api for OPTIONS not working


Pls check why this api request is not working ?

curl -X ‘POST’
-H ‘accept: application/json’
-H 'access-token: ’
-H ‘Content-Type: application/json’
-d ‘{
“dhanClientId”: “*******”,
“correlationId”: “quick1”,
“transactionType”: “BUY”,
“exchangeSegment”: “NSE_FNO”,
“productType”: “MARGIN”,
“orderType”: “MARKET”,
“validity”: “DAY”,
“tradingSymbol”: “BANKNIFTY02MAR2340400CE”,
“securityId”: “48703”,
“quantity”: 1,
“disclosedQuantity”: 1,
“price”: 0.0,
“triggerPrice”: 0.0,
“afterMarketOrder”: false,
“amoTime”: “OPEN”,
“boProfitValue”: 0.0,
“boStopLossValue”: 0.0,
“drvExpiryDate”: “2023-03-02”,
“drvOptionType”: “CALL”,
“drvStrikePrice”: 40400

error -

“errorCode”: “BAD_REQUEST_ERROR”,
“httpStatus”: “BAD_REQUEST”,
“internalErrorCode”: “RS-9005”,
“internalErrorMessage”: " todo mandatory fields "

Hello @Bishnupada

Can you try once with disclosedQuantity as 0?

Hi @Hardik
Thanks for your response. Actually, it worked when I made the quantity=25.
Can you please tell me, is the SecurityId specific to Dhan only and how/where can I get it to use it in my code without reading the CSV file??

1 Like

Hey @Bishnupada

Great to know that. Security ID is a unique ID for each scrip traded on the exchange, which is updated every morning and uploaded here - Security ID List.

You can automate loading this CSV on your terminal directly via this URL.

1 Like