Getting error for placing order with API V3 - Error: Invalid Input

Hello,

I am facing issue for placing order with API V3.

I can see there is no change for order placement from V2 to V3 except data = data and for API v2 it was working fine.

I am attaching part of the code for reference

Hi @chaitanyakalyani.demat-vbz

You are passing ‘False’ as a string in offlineOrder. Please change the data type it would be False as bool.
Try with it. It will work.

If you face any issue again then let me know I will help you
Thanks

Hello @Z4PBvkQGyF ,

I tried with that as well still getting the same issue.

Hello @shruthi_shetty ,

Can you please help me to resolve this issue?

Hi @chaitanyakalyani.demat-vbz ,

As I can see you pass type : 1 (this is for limit order) and you give limit price = 0
Kindly try with type = 2 and then place order

Hope it will help , and let me know if you find issue

Hello Pankaj,

I checked and as you suggested but still having the same issue.

Hi @chaitanyakalyani.demat-vbz

we will get you on call and resolve query on remote.

Hi @chaitanyakalyani.demat-vbz,

Please provide your Client ID in a DM so our team can contact you.

Hello @Z4PBvkQGyF ,

After some code updates issue was resolved.

Updated proper typecasting for int and float parameters issue got resolved. Before typecasting it was considering string and throwing errors of invalid type.

Updated part of code for reference

    data = {

        "symbol":  EntrySymbol,

        "qty": int(quantity),

        "type": int(TypeOfOrder),

        "side": int(act_order_side),

        "productType": product_type,

        "limitPrice": float(limit_Price),

        "stopPrice": float(stop_Price),

        "validity": validity,

        "disclosedQty":0,

        "offlineOrder":False,

        "stopLoss": float(stop_Loss),

        "takeProfit":float(take_profit),

    }

    print(data)

    response = [fyers.place](http://fyers.place)_order(data = data)

    print(response)

Hi @chaitanyakalyani.demat-vbz
It is good to know issue has been resolved for you.

I have the same issue when trying to place an order. I tried the above solution but it still same error message. I am using V3.0.5 API.

@Z4PBvkQGyF Can you please help?

Thanks

Dhaval