Guides
Guides

Order and position IDs

How order IDs and position IDs connect across orders, positions and position history.

Each futures order belongs to one position. A position can have many orders (open, average-in, stop-loss, take-profit, partial close, reverse, close) and keeps one position_id for its lifetime. Join orders and positions on position_id, not on symbol or asset.

Fields by endpoint

EndpointOrder UUID fieldPosition UUID field
Create new order (v2 and v1)order_idposition_id
Order by id, Get order detail, Open orders, Order history, Execution reportidposition_id (same value as future_position_uuid)
Open Positionsstoploss.order_id, takeprofit.order_idposition_id (same value as id)
Position historyorder_idposition_id (id is the history row UUID)
Square off, Partial Close, Reverse positionorder_idposition_id
Set SL/TP—position_id

Position status at placement

Placing an order creates its position immediately, with status INITIATED, and returns the position_id without waiting for a fill. The position_id does not change. The position is listed in Open Positions once it is OPEN.

This applies to unfilled LIMIT orders. If a LIMIT order is cancelled before any fill, its position_id is not returned by Open Positions or Position history. Unfilled orders on the same asset and currency can share a position_id.

Place response (202 Accepted):

{
    "success": true,
    "data": {
        "leverage": "5",
        "quantity": "4",
        "price": "1.5093",
        "order_id": "01a0f1cc-3a89-7ee0-9e30-55008dc3e5fb",
        "status": "CREATED",
        "message": "OK",
        "client_order_id": null,
        "position_id": "01a0f1cc-3a87-727a-b3b6-fc871c4a6cab"
    }
}

Open Positions after the fill (trimmed):

{
    "success": true,
    "data": [
        {
            "created_at": "2026-09-30T10:11:29Z",
            "updated_at": "2026-09-30T10:11:29Z",
            "entry_price": "1.5094",
            "quantity": "4",
            "leverage": "5",
            "order_type": "LONG",
            "status": "OPEN",
            "id": "01a0f1cc-3a87-727a-b3b6-fc871c4a6cab",
            "position_id": "01a0f1cc-3a87-727a-b3b6-fc871c4a6cab",
            "symbol": "XRPUSDT",
            "trade_currency": "USDT"
        }
    ]
}

Position lifecycle

Every order below carries the same position_id.

ActionEndpointResult
OpenCreate new orderorder_id of the opening order and position_id.
Average-inCreate new order (same asset and currency)New order_id, same position_id. One row in Open Positions.
Set SL/TPSet SL/TPStop-loss and take-profit order UUIDs are in Open Positions (stoploss.order_id, takeprofit.order_id).
Partial closePartial Closeorder_id of the close order. PARTIAL row in Position history.
ReverseReverse positionorder_id of a LONG or SHORT order for twice the open quantity. CLOSED row for the closed side. Open SL/TP orders become SYSTEM_CANCELLED.
CloseSquare offorder_id of the close order. CLOSED row in Position history.
Stop-loss trigger or liquidation—CLOSED or LIQUIDATED row with the triggering order_id.

Position history rows

Position history returns one row per close event, with status PARTIAL, CLOSED, or LIQUIDATED. Rows for one position share its position_id; each row's order_id is the order that closed that quantity, and pnl is the realised PnL for it. A reverse produces a CLOSED row while the position stays open on the other side.

created_at is the position open time and is the same on every row for the position. updated_at is the close time. Rows are sorted by created_at, newest first.

Close responses

Square off (POST /fapi/v1/futures/positions/{position_id}/close):

{
    "success": true,
    "data": {
        "order_id": "01a0f1cb-12a7-7f30-9c86-d36db7775dfe",
        "position_id": "01a0f1ca-8e83-7c9f-b3e6-d51b34cba2e3",
        "status": "CREATED",
        "message": "OK"
    }
}

Partial close (POST /fapi/v1/futures/positions/{position_id}/close/partial):

{
    "success": true,
    "data": {
        "order_id": "01a0f1ca-e9ac-7ed4-8dd0-86098e4c445e",
        "position_id": "01a0f1ca-8e83-7c9f-b3e6-d51b34cba2e3",
        "quantity": "4"
    }
}

The partial close response does not include PnL. Use the PARTIAL row in Position history with the same order_id.

Limitations

  • SYSTEM_CANCELLED stop-loss and take-profit orders are returned by Order by id but not by Order history.
  • Set SL/TP and Edit SL/TP do not return stop-loss or take-profit order UUIDs. Read them from Open Positions.

Did this page help you?