Fyers API Bracket Order (BO) placement

Hi All

I’m trying to place BO through API, but getting an error.

can someone please guide?

The API is not allowing to place BO

 
takeProfit = lp + (lp * 0.01)
stopLoss = lp - (lp * 0.01)

data = {
    "symbol":symbols,
    "qty":1,
    "type":1,
    "side":1,
    "productType":"BO",
    "limitPrice":lp,
    "stopPrice":lp-1,
    "validity":"DAY",
    "disclosedQty":0,
    "offlineOrder":False,
    "stopLoss": stopLoss,
    "takeProfit": takeProfit,
    "orderTag":"tag1"
}
response = fyers.place_order(data=data)
print(response)

Failed to place order: 400 {"code":-50,"message":"productType must be one of the following: \"CNC\", \"MARGIN\", \"INTRADAY\"","s":"error"}

In which symbol you are trying to place order?

Note: make sure you are placing SL and target in points instead of price

Hey @111697955480186402272

Please exclude the Ordertag key if you are placing a CO,BO order you should not face any issues

Thanks everyone for the help

it worked