Error while placing a trade : 'error code': 'RS-9005' , 'message': 'Transaction Fails', 'data':''

I am facing this error while placing a trade.
NSE
Banknifty 07 Aug 51500 Call
security id: 50203

No other error message is displayed except transaction fails, tried it multiple times, every time it fails.

I am facing this in all option index trades

Hi @Spongy01,

Request you to share the request structure so we can check and assist you further.

@Spongy01,

Here is the request structure example for your reference wherein order is placed at a limit.

{
“dhanClientId”: “Client ID”,
“correlationId”: “”,
“transactionType”: “BUY”,
“exchangeSegment”: “NSE_FNO”,
“productType”: “MARGIN”,
“orderType”: “LIMIT”,
“validity”: “DAY”,
“tradingSymbol”: “”,
“securityId”: “50203”,
“quantity”: 15,
“disclosedQuantity”: 0,
“price”: 200,
“drvExpiryDate”: “07-08-2024 14:30”,
“drvOptionType”: “CALL”,
“drvStrikePrice”: “51500”
}

1 Like

Hello, I got that sorted, I was giving wrong exchangeSegment.

I am facing another issue, when I am trying to modify FNO (Bank Nifty options) order, it is asking to provide a legname, but it is given in the docs that it is conditonally required only for BO and CO type of orders, what value should I provide in legname.

This is the error I am receiving when I keep legname = None
{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘RS-9005’, ‘message’: ‘Index: 0, Size: 0’}, ‘data’: ‘’}

Then I tried keeping it as an empty string legname = “”, but it also returned in an error
{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘RS-9005’, ‘message’: ‘JSON parse error: Cannot coerce empty String (“”) to co.dhan.api.model.enums.LegName value (but could if coercion was enabled using CoercionConfig); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot coerce empty String (“”) to co.dhan.api.model.enums.LegName value (but could if coercion was enabled using CoercionConfig)\n at [Source: (PushbackInputStream); line: 1, column: 136] (through reference chain: co.dhan.api.model.OrderModifyRequest[“legName”])’}, ‘data’: ‘’}

Kindly help in this issue

Hi @Spongy01,

You can either write “legName”: “ENTRY_LEG” or remove this field and continue to enter the rest of the parameters.

tried removing the field previously but it also resulted in error, I will try placing entry leg in the value and see how it works

@Spongy01,

If you still face any error, please help us with the request structure here.