Hello,
I’m new here.
I try to cancel a Limit order from API with php but don’t work.
When I execute the code I receive the order information, it don’t cancel the order.
If I want to put a new order the code work fine.
My code for new order:
$response = signedRequest(‘POST’, ‘fapi/v1/order’, [
‘symbol’ => ‘ETHUSDT’,
‘side’ => ‘BUY’,
‘positionSide’ => ‘LONG’,
‘type’ => ‘LIMIT’,
‘timeInForce’ => ‘GTC’,
‘quantity’ => 0.025,
‘price’ => 1275,
// ‘newClientOrderId’ => ‘my_order’, // optional
‘newOrderRespType’ => ‘FULL’ //optional
]);
echo json_encode($response);
My code for cancel order:
$response = signedRequest(‘DELETE’, ‘fapi/v1/order’, [
‘symbol’ => ‘ETHUSDT’,
‘origClientOrderId’ => ‘aigpUOssQqJu9GlHqBsBAI2’
]);
print_r($response);
This is the response:
Array
(
[orderId] => 8.3897654933889E+18
[symbol] => ETHUSDT
[status] => NEW
[clientOrderId] => aigpUOssQqJu9GlHqBsBAI2
[price] => 1275
[avgPrice] => 0.00000
[origQty] => 0.025
[executedQty] => 0
[cumQuote] => 0
[timeInForce] => GTC
[type] => LIMIT
[reduceOnly] =>
[closePosition] =>
[side] => BUY
[positionSide] => LONG
[stopPrice] => 0
[workingType] => CONTRACT_PRICE
[priceProtect] =>
[origType] => LIMIT
[time] => 1614521378942
[updateTime] => 1614521378942
)