(Resolved) Issue with placing Order via API

@Hardik when I am placing the oder :

dhan.place_slice_order(security_id=‘60460’, exchange_segment=dhan.NSE_FNO,transaction_type=dhan.BUY,quantity=75,order_type=dhan.MARKET,product_type=dhan.MARGIN,price=0) it is throwing up the following error:
{‘status’: ‘failure’,
‘remarks’: {‘error_code’: ‘DH-905’,
‘error_type’: ‘Input_Exception’,
‘error_message’: ‘Missing required fields, bad values for parameters etc.’},
‘data’: {‘errorType’: ‘Input_Exception’,
‘errorCode’: ‘DH-905’,
‘errorMessage’: ‘Missing required fields, bad values for parameters etc.’}}

Till last Friday this code was working fine. What has changed? I have also added static IP to my profile

Hey @Sujit_Modi ,

We request to please try the below code once by making necessary changes:

dhan.place_order(security_id=‘xxxx’, # Nifty PE
exchange_segment=dhan.NSE_FNO,
transaction_type=dhan.BUY,
quantity=75,
order_type=dhan.MARKET,
product_type=dhan.MARGIN,
price=0)

Please let us know if this works.

@Shrutika_Poojari
Ran the following :

o=dhan.place_order(security_id=‘60460’, exchange_segment=dhan.NSE_FNO,transaction_type=dhan.BUY,quantity=75,order_type=dhan.MARKET,product_type=dhan.MARGIN,price=0)

But still the same error:

{‘status’: ‘failure’,
‘remarks’: {‘error_code’: ‘DH-905’,
‘error_type’: ‘Input_Exception’,
‘error_message’: ‘Missing required fields, bad values for parameters etc.’},
‘data’: {‘errorType’: ‘Input_Exception’,
‘errorCode’: ‘DH-905’,
‘errorMessage’: ‘Missing required fields, bad values for parameters etc.’}}

getting the same error here, its really infuriating, also made a similar post, please take a look

1 Like

try> product_type=dhan.CNC , price=float(price)

Interestingly when I use the access token directly from the Dhan website, it works fine. But when I use the access token generated through consentID+TOTP, the issue persists.

@Hardik @Shrutika_Poojari

1 Like

Hey @Sujit_Modi

Yes, this was an issue and we have fixed the same. It should be working fine now.