Error in Super Order API

Hi @Dhan_Auto_Moderator @Dhan

I am getting error while placing super order.
Can you please let me know what is missing in payload ?

url = “https://api.dhan.co/v2/super/orders

headers = {
‘Content-Type’: ‘application/json’,
‘access-token’: self.token_id
}

JSON payload: {“dhanClientId”: “xxxxxxxx”, “correlationId”: “SUPER”, “transactionType”: “BUY”, “exchangeSegment”: “NSE_FNO”, “productType”: “INTRADAY”, “orderType”: “MARKET”, “securityId”: “47216”, “quantity”: 75, “price”: 106.35, “targetPrice”: 132.9375, “stopLossPrice”: 90.6, “trailingJump”: 1, “tag”: “SUPER”}

order = requests.post(url, headers=headers, json=json_payload)

Error =>

{‘errorType’: ‘Input_Exception’, ‘errorCode’: ‘DH-905’, ‘errorMessage’: ‘Missing required fields, bad values for parameters etc.’}

Hey @MukeshM ,

We noticed that you are placing a market order and hence request you to set the price as 0 for the same. Additionally, we observed that you have mentioned “tag”: “SUPER”, which is not required you may try removing that field.

HI @Shrutika_Poojari ,

It is giving same error for both MARKET and LIMIT order

JSON payload: {“dhanClientId”: “XXXXXX”, “correlationId”: “SUPER”, “transactionType”: “BUY”, “exchangeSegment”: “NSE_FNO”, “productType”: “INTRADAY”, “orderType”: “MARKET”, “securityId”: “47221”, “quantity”: 75, “price”: 0.0, “targetPrice”: 151.9375, “stopLossPrice”: 101.15, “trailingJump”: 1}
order: <Response [400]>
order json : {‘errorType’: ‘Input_Exception’, ‘errorCode’: ‘DH-905’, ‘errorMessage’: ‘Missing required fields, bad values for parameters etc.’}

JSON payload: {“dhanClientId”: “XXXXXXX”, “correlationId”: “SUPER”, “transactionType”: “BUY”, “exchangeSegment”: “NSE_FNO”, “productType”: “INTRADAY”, “orderType”: “LIMIT”, “securityId”: “47221”, “quantity”: 75, “price”: 121.55, “targetPrice”: 151.9375, “stopLossPrice”: 101.15, “trailingJump”: 1}
order: <Response [400]>
order json : {‘errorType’: ‘Input_Exception’, ‘errorCode’: ‘DH-905’, ‘errorMessage’: ‘Missing required fields, bad values for parameters etc.’}

Hey @MukeshM ,

We request you to please try the below mentioned request structure by making necessary changes in client id and target , stop loss if required. As the same working fine from our end.

{
“dhanClientId”: “—”,
“correlationId”: “Super”,
“transactionType”: “BUY”,
“exchangeSegment”: “NSE_FNO”,
“productType”: “INTRADAY”,
“orderType”: “MARKET”,
“securityId”: “47221”,
“quantity”: 75,
“price”: 0,
“targetPrice”: 151.90,
“stopLossPrice”: 101.15,
“trailingJump”: 1
}

Thanks @Shrutika_Poojari - its working now

1 Like

Hi @Dhan_Auto_Moderator Can you please help me with below error for super order API.

curl --request DELETE
–url /v2/super/orders/363250922500XXXXX/STOP_LOSS_LEG
–header ‘Content-Type: application/json’
–header ‘access-token: JWT’
{“errorType”:“Order_Error”,“errorCode”:“DH-906”,“errorMessage”:“Incorrect request for order and cannot be processed”}

This orderID is already traded and when I am trying to cancel Target or SL I am getting this error after 40 secs, but it works fine when I cancel pending order.
Note: I was not able to post full link so truncated it.

@Shrutika_Poojari Could you please look into this.

Hi @Yash_007 ,

Welcome to madefortrade,

Kindly share the endpoint you are using to cancel the Super Order.

Hi @Shubham_Singh Here is the complete endpoint.
api[.]dhan[.]co/v2/super/orders/3132509235xxxxx/TARGET_LEG
api[.]dhan[.]co/v2/super/orders/3132509235xxxxx/STOP_LOSS_LEG

The entry leg is executed and above two legs are pending, now I am trying to cancel these legs.

I am getting error that new user can’t post links so added [.]

Hi @Shubham_Singh Please help me with the above problem, I am stuck at this point.

Hey @Yash_007 ,

As replicated from our side , super order cancel api seems to be working fine.

We request you to kindly refer our official document for detailed information - Super Order - DhanHQ Ver 2.0 / API Document.

Incase you still unable to do so then kindly help us with registered details over help@dhan.co

@Shrutika_Poojari Everything is working fine but not the cancellation of target/stoploss of the traded intraday super order, so from an implementation side I have no doubt.