I place NIFTY options with POST ``https://api.dhan.co/v2/orders. The body uses orderType: "MARKET", price is omitted, triggerPrice is 0, validity is DAY, productType is MARGIN, and exchangeSegment is NSE_FNO. The header is only access-token.
Dhan accepts the order, then the order book shows it as LIMIT. The same contract placed from the Dhan app stays MARKET.
can i give me dummy node js code for market order place
{
“dhanClientId”: “*********”,
“correlationId”: “spmvyx9pnq0”,
“transactionType”: “BUY”,
“exchangeSegment”: “NSE_FNO”,
“productType”: “MARGIN”,
“orderType”: “MARKET”,
“validity”: “DAY”,
“securityId”: “54128”,
“quantity”: 65,
“disclosedQuantity”: 0,
“price”: 0,
“triggerPrice”: 0,
“afterMarketOrder”: false
}
can any one debug this why place limit order
@Riken_Mehta @Vaibhav_Lad @Shrutika_Poojari
Hi @RTX-AYUSH ,
Thanks for sharing the full payload and the details that really helps us understand what you are seeing.
Please be informed that there is nothing wrong with your code or your request body. As per the latest regulatory framework, market orders can no longer be placed through APIs.
So whenever a MARKET order is sent via the API, it is automatically converted into a LIMIT order with Market Price Protection (MPP) applied, where the limit price is derived within a predefined MPP range to keep execution controlled.
That is why the same contract shows as MARKET when placed from the app but appears as LIMIT in the order book when placed through the API.
So, this is expected behaviour at the exchange/API level rather than an query at your end, and no change to your Node.js snippet is required.
Feel free to write us at apihelp@dhan.co for any more queries.