Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dr24's avatar
Level 2

Problem with enabling Hedge mode using binance api

I am trying to activate Hedge mode on binance api. According to documentation required endpoint is POST /fapi/v1/positionSide/dual. Now I am using php jaggedsoft package in order to communicate with binance api. The error I am getting constantly is

"msg": "Mandatory parameter 'dualSidePosition' was not sent, was empty/null, or malformed."

The configuration in my file are as follows

BinanceController.php

public function changePositionMode()
{
    $class = new BinanceController($key, $secret);
	$api = new Binance\API($class->key, $class->secret);

	$data = $api->dualSidePost('BTCUSDT');

    return response()->json([
        'data' => $data
    ]);
}

php-binance-api.php

public function dualSidePost(string $symbol = null)
{   
    $params = [
        "dualSidePosition" => true
    ];

    return $this->httpRequest("v1/positionSide/dual", "POST", $params, true);
   
}

And in postman I put json request like this

{
    "dualSidePosition[]":true
}

Now, I tried changing request in postman in various ways, for example

{    
    "dualSidePosition":true
}

or this

{    
    "dualSidePosition[]":[true]
}

but I always get the same error, like that parameter dualSidePosition is somehow wrongly configured. Note that all my other POST or GET routes work perfectly fine and I am able to connect to binance api with no problem. Any help is appreciated.

0 likes
1 reply
codemeister's avatar

Try this:

{ "dualSidePosition": "true" }

because the request must be string.

Please or to participate in this conversation.