Futures · Trading

Get an order by clientOrderId

Changed on

Recover the exchange order id after a lost create response using the same clientOrderId. Returns any status (10/20/30/40/50), including cancelled and error orders.

get/api/futures/trade/orders/by-client-id/{clientOrderId}

Request

  • Base URL
    https://api.binibit.com
  • URL
    https://api.binibit.com/api/futures/trade/orders/by-client-id/{clientOrderId}
  • Auth
    none declared

Path parameters

clientOrderIdstring required

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.

Response

OK

idstring nullable

Order identifier assigned by the exchange. Pass it to the close/cancel and stop-loss endpoints.

clientOrderIdstring nullable

The identifier you supplied on creation, echoed back. Null when none was sent.

createTimestampstring date-time

When the order was accepted (UTC).

updateTimestampstring date-time

When the order last changed — a fill, a stop move, a close (UTC).

pricenumber double nullable

Limit price for a limit order; for a filled position, the entry price. Null on a market order that has not filled yet.

amountnumber double

Order size in the pair's base asset.

currencyPairCodestring nullable

Pair this order belongs to, e.g. BTC_USDT.

takeProfitnumber double nullable

Take-profit trigger price attached to this order, or null if none is set. This is a level ON the order — it never appears as a separate order in the history.

stopLossnumber double nullable

Stop-loss trigger price attached to this order, or null if none is set. Like take-profit, a level on the order rather than an order of its own.

realizedPnlnumber double

Profit or loss already booked on this position, in the settlement currency. Grows as the position is closed in parts; final once the status is PublicApi.Models.Futures.FuturesOrderStatus.PositionClosed.

leveragenumber double

Leverage the position was opened with.

isLongboolean

True for a long (buy) position, false for a short (sell) one.

isMarketboolean

True if the order was submitted at market, false if it carries a limit PublicApi.Models.Futures.FuturesOrderDto.Price.

liquidationPricenumber double

Price at which this position would be liquidated. Moves as margin is added or PnL accrues.

fillednumber double

How much of PublicApi.Models.Futures.FuturesOrderDto.Amount has been executed so far. Zero while the order is resting.

feenumber double

Trading fee charged on this order so far, in PublicApi.Models.Futures.FuturesOrderDto.FeeAsset. Funding is reported separately in PublicApi.Models.Futures.FuturesOrderDto.FundingFee.

feeAssetstring nullable

Asset the PublicApi.Models.Futures.FuturesOrderDto.Fee was charged in. Null if nothing has been charged yet.

amountInPositionnumber double

Size currently held open, in the base asset. Falls below PublicApi.Models.Futures.FuturesOrderDto.Amount as the position is closed in parts, and reaches zero when it is fully closed.

futuresOrderStatus10 | 20 | 30 | 40 | 50

Where a futures order is in its life. This says nothing about what KIND of order it is — limit versus market is isMarket, and buy versus sell is isLong.

fundingFeenumber double

Total funding paid (positive) or received (negative) while this position has been open.

initialMarginnumber double

Margin committed when the position opened. The denominator of both percentage figures below.

currentMarginnumber double

Margin backing the position right now, after PnL and any margin changes.

unRealizedPnlnumber double

Profit or loss on the still-open part of the position at the current mark price.

unRealizedPnlPercentagenumber double

Unrealized PnL as a percentage of PublicApi.Models.Futures.FuturesOrderDto.InitialMargin. Zero when the initial margin is zero rather than an error.

totalPnlPercentagenumber double

Realized plus unrealized PnL as a percentage of PublicApi.Models.Futures.FuturesOrderDto.InitialMargin — the whole result of the position so far, where PublicApi.Models.Futures.FuturesOrderDto.UnRealizedPnlPercentage covers only the open part.

roenumber double

Reserved: the exchange currently reports 0 here for every order. Use PublicApi.Models.Futures.FuturesOrderDto.TotalPnlPercentage for return on margin.

Changes