V3 Bracket Order Error

POST /api/v3/orders/sync

Request:

(symbol=NSE:BANKNIFTY2410347800CE, qty=15, type=1, side=1, productType=BO, limitPrice=10.15, stopPrice=0, disclosedQty=0, validity=DAY, offlineOrder=False, stopLoss=1.05, takeProfit=2.05)

Response:

{“code”:-50,“message”:“Invalid input”,“s”:“error”}

Can somebody throw insights into the invalid input here please?

Hi @the_pug

This should be because the inputs are not entered in the right format , Please find the format to be entered for different inputs :

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),

Hi @WWhYB2qrsx

ok, it was the java object log and not json format, but they are of right type. I can post the json format request payload shortly. Java object is serialised to json a bit later just before hitting fyers

public class FyersNewOrderRequest {

    private String symbol;
    private int qty;
    private int type;
    private int side;
    private ProductType productType;
    private BigDecimal limitPrice;
    private BigDecimal stopPrice;
    private int disclosedQty;
    private String validity;
    private String offlineOrder;
    private BigDecimal stopLoss;
    private BigDecimal takeProfit;

    public enum ProductType {
        CNC,
        Intraday,
        Margin,
        CO,
        BO
    }
}

apart from json vs java object - do you spot anything wrong with the names or data types?

@WWhYB2qrsx let me fix offlineOrder from string to boolean

@the_pug These changes should be enough , adding the Order placement docs for you’re reference of the Data types and format

https://myapi.fyers.in/docsv3#tag/Order-Placement-Guide