API Error: RS-9005 error on modifying BO Target Leg order, CO SL & Limit Order, SL Market Order

I am not able to update the below order types.

  • BO Target Leg order
  • CO SL Order & CO Entry Limit Order
  • Simple SL Market Order

Please get it fixed.

Request:
{
“dhanClientId”: “”,
“orderId”: “”,
“exchangeOrderId”: “”,
“correlationId”: “NA”,
“orderStatus”: “PENDING”,
“transactionType”: “BUY”,
“exchangeSegment”: “NSE_EQ”,
“productType”: “BO”,
“orderType”: “LIMIT”,
“validity”: “DAY”,
“tradingSymbol”: “PNB”,
“securityId”: “10666”,
“quantity”: 2,
“disclosedQuantity”: 0,
“price”: 56.85,
“triggerPrice”: 0,
“afterMarketOrder”: false,
“boProfitValue”: 56.85,
“boStopLossValue”: 0,
“legName”: “TARGET_LEG”,
“createTime”: “2023-01-09 13:14:27”,
“updateTime”: “2023-01-09 13:14:27”,
“exchangeTime”: “2023-01-09 13:14:27”,
“drvExpiryDate”: “0001-01-01”,
“drvOptionType”: “NA”,
“drvStrikePrice”: 0,
“omsErrorCode”: null,
“omsErrorDescription”: null,
“filled_qty”: 0,
“algoId”: “1123010915224”
}

Response:
{“errorCode”:“BAD_REQUEST_ERROR”,“httpStatus”:“BAD_REQUEST”,“internalErrorCode”:“RS-9005”,“internalErrorMessage”:“Transactions Fails.”}

1 Like

Any updates on this @Naman @Hardik ?

Could not modify the below order types from API:

BO Tgt Leg
Co - Both legs
SLM

Hello @vinay_sd17

The order modification request that you are sending is different from Request Structure provided. I would ask you to confirm the API endpoint that you are calling and along with that, if you can have similar request structure as provided here.

Hi @Hardik

It’s the same, with removing unwanted fields in a request.

API Endpoint: https://api.dhan.co/orders/ [PUT]

Payload:
{
“dhanClientId”: “1100216460”,
“orderId”: “112301109297”,
“orderType”: “STOP_LOSS_MARKET”,
“legName”: “NA”,
“quantity”: 2,
“price”: 0.0,
“triggerPrice”: 56.85,
“validity”: “DAY”
}

Video: (SLM)

PS: In an earlier request call, I just sent the entire object received from the get orders call (Pending). In the same way, I can able to edit BO TGT order (or) Any Limit Order (or) SLL order. It’s failing only on BO SL, CO (Limit + SLM), and SLM orders. So I suspect that’s not the issue here. Some other checks fail at API.

1 Like

@Hardik Even I am facing problem when trying to modify the existing SLM order.
The request shows successful, but there is no change to the order when I verify it from the UI.

I have been referring the following link.

@vinay_sd17 brother, by any chance did this start working for you?

No @sugam192 Still the issue exists, @Hardik any eta for the fix? updating BO TGT leg/CO/SLM order.

1 Like

Hello @vinay_sd17 @sugam192

We deployed fix for this after this issue was initially raised by @vinay_sd17. Let me check with the team regarding the same and will update you here. Meanwhile, it will be helpful if @sugam192 can send request structure, order ID and client ID at api.dhan.co, so that we can troubleshoot better.

Issue is still there, I am getting same error response when trying to modify SL Market order.

Any workaround for this?

use api to cancel the order and place another order. This is what I did.

Hi @Hardik -

Was this issue fixed?
I am still getting this same error while trying to modify the BO order via API.

Hello @yogesharora

Welcome to Dhan community!

Yes, we did. Can you let me know the exact error you are getting and the error message?

I am getting the below response -
{'status': 'failure', 'remarks': {'error_code': 'RS-9005', 'message': None}, 'data': ''}

and my request looks like -
dhan.modify_order( order_id='3123110621116', order_type='LIMIT', leg_name='TARGET_LEG', quantity=1, price=1355, disclosed_quantity=0, trigger_price=1385, validity=dhan.DAY )

I think leg_name cannot be “target_leg” in a limit order type. It is only for BO order.

I am trying to modify the Target for a BO order only.

Ok, may be try and avoid using the “trigger_price” parameter? It seems to be conflicting with order_type=“LIMIT”. Although weird if your order place was successful. Can you share order place request too?

{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘RS-9005’, ‘message’: ‘The token was expected to have 3 parts, but got 1.’}, ‘data’: ‘’} …Im getting this error for my first program for get positions. pls help

Please help with below error and the payload given:

error:
{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘RS-9005’, ‘message’: ‘Transactions Fails.’}, ‘data’: ‘’}

payload:
begin dhan.place_order(security_id= str(11915), exchange_segment= BSE_EQ, transaction_type=BUY , quantity=1000, order_type=LIMIT, product_type= INTRADAY, price=26.7)

I am getting below error on post order api https://api.dhan.co/orders
{
“errorCode”: “INTERNAL_SERVER_ERROR”,
“httpStatus”: “INTERNAL_SERVER_ERROR”,
“internalErrorCode”: “RS-9005”,
“internalErrorMessage”: null
}

Hello @jogeswar

Welcome to MadeForTrade community!

Can you please add the request JSON as well, that you are sending on APIs?

@saisaigraph this is usually when the security ID is incorrect. Can you check the same once.