How to implement OCO in fapi testnet binancefuture

I want implement OCO in sell but he display error this Invalid orderType.

$base_url  = 'fapi/v1/order'
$payload = [
    'symbol' => 'BTCUSDT',
    'side' => 'SELL',
    'type' => 'OCO', 
    'quantity' => 1,
    'price' => 50000,
    'stopPrice' => 49000,
    'stopLimitPrice' => 48000,
    'stopLimitTimeInForce' => 'GTC',
    'timestamp' => round(microtime(true) * 1000),
];

Error :
Array ( [code] => -1116 [msg] => Invalid orderType. )

Hello, on the Binance API Documentation, you can review the parameters for placing a new order using fapi. The accepted values for type parameter are: LIMIT, MARKET, STOP/TAKE_PROFIT, STOP_MARKET/TAKE_PROFIT_MARKET and TRAILING_STOP_MARKET.

1 Like