Futures · Trading

Open a futures position

Changed on

Limit or market via isMarket, long or short via isLong. Stop-loss and take-profit are levels attached to this order, not orders of their own — there is no separate stop-entry type. The margin comes from the UTA account named in futuresAccountId. A repeated clientOrderId returns 200 with the original order id and isExisting=true; repeat parameters are not compared. Status 30 or 40 means the original order did not become a position. A 200 response always carries a non-empty id; a rejection is always a 400 response with an PublicApi.Models.ApiErrorDto.

post/api/futures/trade/create-order

Request

  • Base URL
    https://api.binibit.com
  • URL
    https://api.binibit.com/api/futures/trade/create-order
  • 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

isMarketboolean

True to execute immediately at market. False for a limit order, which then requires PublicApi.Models.Futures.CreateFuturesOrderDto.Price and rests until the market reaches it.

isLongboolean

True to go long (buy), false to go short (sell).

leverageinteger

Per-order leverage. Defaults to 10x when omitted; values above the pair maximum are silently reduced to maxLeverage.

pricenumber double nullable

Limit price. Required for a limit order; ignored when PublicApi.Models.Futures.CreateFuturesOrderDto.IsMarket is true.

stopLossnumber double nullable

Optional stop-loss trigger price, attached to the position this order opens. Omit for none.

takeProfitnumber double nullable

Optional take-profit trigger price, attached to the position this order opens. Omit for none.

amountnumber double

Order size in the pair's base asset. Must be at least minOrderSize. When lotSize is positive, the amount must be an exact multiple or the server returns 400 invalid_amount (110102); it does not round to a lot. Digits beyond quantityPrecision are truncated downward.

currencyPairCodestring nullable

Pair to trade, e.g. BTC_USDT.

futuresAccountIdstring uuid

Which Unified Trading Account puts up the margin — take the id from GET api/uta/accounts. Each sub-account is an isolated margin pool, so this choice decides what a liquidation can reach.

clientOrderIdstring nullable

Optional client-supplied idempotency key, echoed back in the response and on the position/order. A repeat with the same key for the same user returns the existing order's id instead of opening a new one (no time window).

Response

OK

idstring nullable

Exchange-assigned order identifier. Use it to close, cancel or look the order up.

clientOrderIdstring nullable

The identifier you supplied on the request, echoed back so a reply can be matched to its send. Null when none was sent.

isExistingboolean

True when clientOrderId already identified an order: the same id is returned with 200. Repeat request parameters are not compared with the original.

futuresOrderStatusinteger nullable

Current status of that order. Status 30 (cancelled) or 40 (error) means the original order did not become a position. Null when an older core has not supplied this field.

Changes