Hello Team,
I am working on a customized (light weight) GUI application from Where I can trade F&O with some predefined scripts. Just for reference, GUI will look below:
On a button click, when i am calling option order place API, I am getting below error:
"internalErrorMessage":"JSON parse error: Cannot coerce empty String (\"\") to co.dhan.api.model.enums.AmoTimevalue (but could if coercion was enabled usingCoercionConfig); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot coerce empty String (\"\") to co.dhan.api.model.enums.AmoTimevalue (but could if coercion was enabled usingCoercionConfig)\n at [Source: (PushbackInputStream); line: 1, column: 359] (through reference chain: co.dhan.api.model.OrderRequest[\"amoTime\"])"}
My order data is as below:
Dhan: Placing Order: {'dhanClientId': <confidential>, 'correlationId':<confidential>, 'transactionType': 'SELL', 'exchangeSegment': 'NSE_FNO', 'productType': 'MARGIN', 'orderType': 'MARKET', 'validity': 'DAY', 'tradingSymbol': 'NIFTY25JAN2317850CE', 'securityId': '55888', 'quantity': 50, 'disclosedQuantity': 50, 'price': 0, 'triggerPrice': 0, 'afterMarketOrder': 'false', 'amoTime': '', 'boProfitValue': '', 'boStopLossValue': '', 'drvExpiryDate': '2023-01-25', 'drvOptionType': 'CALL', 'drvStrikePrice': -1}
Can you let me know why I am getting error , though I am sending string for dhanClientId?
I am following: Orders - DhanHQ Ver 1.0 / API Document
[Fixed]
Below combination works.
"afterMarketOrder": 'false',
"amoTime":"OPEN",