Wanted help in orderPlace for V3 python API

Hi

my code is working fine till last week when I upgraded to V3. Now my order placement failing.

The response below

2023-09-28 19:49:57: : ((’ Login successful’,), ‘fyersordtrd.py’)

2023-09-28 19:49:57: : ((‘Inside fyers_place_simple_limit_fno_order()’,), ‘fyersordtrd.py’)

2023-09-28 19:49:57: : ((‘symbol-’, ‘NSE:BANKNIFTY23O0444900PE’, ‘-price-’, 550.0, ‘-quan-’, 1, ‘-buysell-’, 1), ‘fyersordtrd.py’)

{‘symbol’: ‘NSE:BANKNIFTY23O0444900PE’, ‘qty’: 1, ‘type’: 1, ‘side’: 1, ‘productType’: ‘MARGIN’, ‘limitPrice’: 550.0, ‘stopPrice’: 0, ‘validity’: ‘DAY’, ‘disclosedQty’: 0, ‘offlineOrder’: ‘False’, ‘stopLoss’: 0, ‘takeProfit’: 0}

2023-09-28 19:49:58: : ((‘The order response is:’, {‘code’: -50, ‘message’: ‘Invalid input’, ‘s’: ‘error’}), ‘fyersordtrd.py’)

2023-09-28 19:50:00: : (('error in parse_order_response() ', {‘code’: -50, ‘message’: ‘Invalid input’, ‘s’: ‘error’}), ‘fyersordtrd.py’)

The code is like Below

symbol = "NSE:BANKNIFTY23O0444900PE"

price = 550

quan =  1

buysell = 1

orderparams = {

                "symbol":symbol,

                "qty":1, # must be multiple of lot size

                "type":1,

                "side":1,#int variable 1 = BUY ; -1 = SELL

                "productType":prd_margin,

                "limitPrice":price ,

                "stopPrice":0,

                "validity":ord_day,

                "disclosedQty":0,

                "offlineOrder":"False",

                "stopLoss":0, # valid for co and bo order

                "takeProfit":0 # valid for co and bo order

                }

    print(orderparams)                

    ordresponse=[broker.place](http://broker.place)_order(orderparams)

an anyone help please ?

Hi @sushovan_roy

As I can see you are not following proper type casting. Please follow it.
as offlineOrder will bool value not string

Please follow this part to fill the values

        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_order(data = data)

        print(response)

Yes it is working now. Thanks