Futures · Trading

Close order/position

Changed on

Returns true when closed or already closed; repeating a close is safe. A rejected close returns 400 with a coded ApiErrorDto.

put/api/futures/trade/close

Request

  • Base URL
    https://api.binibit.com
  • URL
    https://api.binibit.com/api/futures/trade/close
  • Auth
    none declared

Headers

Your API key, verbatim. Create one at https://azbit.com/dashboard/settings/api-settings.

Signature of THIS request — lower-case hex of HMAC-SHA256 over publicKey + fullUrl + body, keyed with your private key. It changes with every request, so it cannot be set once and reused. Full algorithm and code samples are at the top of this page.

Request body

orderIdstring nullable

Identifier of the order or position to close, as returned when it was created.

isMarketboolean

True to close at market immediately. False to place a closing limit order at PublicApi.Models.Futures.FuturesCloseOrderDto.LimitPrice, which leaves the position open until that price is reached.

limitPricenumber double nullable

Price for the closing limit order. Required when PublicApi.Models.Futures.FuturesCloseOrderDto.IsMarket is false; ignored otherwise.

Response

OK

boolean required

Changes