Complaint Regarding Error in Placing BO/CO Orders Using Fyers API V3

I am writing to bring to your attention an issue I encountered while trying to place Bracket Order (BO) or Cover Order (CO) using the Fyers API V3. The code snippet I used is as follows:

order_data = {
    "symbol":"NSE:UCOBANK-EQ",
    "qty":1,
    "type":2,                # 1 = Limit Order/2 = Market Order/3 = Stop Order (SL-M)/4 = Stoplimit Order (SL-L)
    "side":1,               # 1 = BUY/-1 = SELL
    "productType":"BO",      # CNC/INTRADAY/MARGIN/CO/BO
    "limitPrice":0,
    "stopPrice":0,
    "validity":"DAY",
    "disclosedQty":0,
    "offlineOrder":False,
    "stopLoss":sl,
    "takeProfit":tp,
    "orderTag":"tag1"
}

res = fyers.place_order(order_data)

However, upon execution, the code returns the following error:

{
    'code': -50,
    'message': 'productType must be one of the following: "CNC", "MARGIN", "INTRADAY"',
    's': 'error'
}

According to the Fyers API V3 documentation, "productType" should include "BO" and "CO".

It appears that the API does not recognize these values, which is causing the error.

Could you please provide clarification on this matter and, if possible, share a sample code snippet for placing BO or CO orders using the Fyers API V3?

Thank you for your assistance.

2
1 reply