Skip to content

Account & Trades (v2)

REST API v2 for USDT-M / USDC-M under /api/v2/futures. Paths use kebab-case. For spot / shared account v2 (e.g. balance flow on /api/v2/account), see Account & Trades (v2).

Overview

Successful responses use:

json
{ "code": 200, "msg": "success", "data": { } }
  • code = 200 on success; errors use negative codes (see Error codes).
  • Lists wrap rows in data as a JSON array (e.g. open orders, trades). Batch new order returns an array of { "code", "order" } per item.
  • See Basic information for SIGNED and JSON request body (v2) (same page).
  • Wire format (JSON): Integer timestamps and ids that are 64-bit in the system are sent as strings in JSON (not unquoted numbers). Null fields are usually omitted from the body (you will not see "field": null for most optional keys). Optional fields such as stopPrice or triggerBy only appear in the response when they have a value.

Enum parameters (reference)

Allowed values for common string enums in requests/responses. Each field below has the same allowed values on every route where it appears.

ParameterAllowed values
categoryUSDT (USDT-M), USDC (USDC-M)
sideBUY, SELL
positionSideLONG, SHORT
typeRegular order: LIMIT limit order, MARKET market order
Plan order: STOP converts to limit order on trigger, STOP_MARKET converts to market order on trigger
Update plan order body: STOP plan orders, STOP_PROFIT_LOSS TP/SL orders
stopCategorySTOP plan orders, STOP_PROFIT_LOSS TP/SL orders
timeInForceGTC, FOK, IOC, POST_ONLY
triggerBy / tpTriggerBy / slTriggerByCONTRACT_PRICE, MARK_PRICE
tpOrderType / slOrderTypeMARKET, LIMIT
stopOrderTypeTAKE_PROFIT, STOP_LOSS
stopTypeFIXED_STOP, TRAILING_STOP
fallbackTypeRATE, PRICE

New regular order (TRADE)

  • POST /api/v2/futures/order

Weight:1

Parameters

NameTypeMandatoryDescription
symbolSTRINGYESContract symbol id
sideSTRINGYESBUY or SELL
positionSideSTRINGYESLONG or SHORT
typeSTRINGYESLIMIT or MARKET
newClientOrderIdSTRINGYESClient order id
quantityDECIMALNOOrder quantity (unit: contracts); at least one of quantity / valueQuantity must be non-zero
valueQuantityDECIMALNOUSDT notional; at least one of quantity / valueQuantity must be non-zero
priceDECIMALNORequired when type = LIMIT; omit for MARKET
timeInForceSTRINGNOOne of GTC, FOK, IOC, POST_ONLY. Default GTC.
takeProfitSTRINGNOTake-profit price
tpTriggerBySTRINGNOPrice type used to trigger take-profit: CONTRACT_PRICE, MARK_PRICE
tpLimitPriceSTRINGNOLimit price after take-profit is triggered (when tpOrderType = LIMIT)
tpOrderTypeSTRINGNOOrder type after take-profit is triggered: MARKET, LIMIT
stopLossSTRINGNOStop-loss price
slTriggerBySTRINGNOPrice type used to trigger stop-loss: CONTRACT_PRICE, MARK_PRICE
slLimitPriceSTRINGNOLimit price after stop-loss is triggered (when slOrderType = LIMIT)
slOrderTypeSTRINGNOOrder type after stop-loss is triggered: MARKET, LIMIT
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1668418485058",
    "updateTime": "1668418485058",
    "orderId": "1289182123551455488",
    "clientOrderId": "test1115",
    "symbol": "BTC-SWAP-USDT",
    "price": "19000",
    "leverage": "2",
    "origQty": "10",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "9.5",
    "type": "LIMIT",
    "side": "BUY",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "NEW",
    "contractMultiplier": "0.001"
  }
}

Batch new orders (JSON) (TRADE)

  • POST /api/v2/futures/batch-orders

Weight:2

Content-Type: application/json — request body is a JSON array of order objects. For signing details, see JSON Request Body Signing Examples (API v2).

Query parameters (signed)

NameTypeMandatoryDescription
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYESrequired for SIGNED
recvWindowLONGNOrecv window

Request body (JSON array) — each element

Each object carries the same business fields as a single New regular order; semantics match that endpoint’s table.

NameTypeMandatoryDescription
newClientOrderIdSTRINGYESClient order id
symbolSTRINGYESContract symbol id
sideSTRINGYESBUY or SELL
positionSideSTRINGYESLONG or SHORT
typeSTRINGYESLIMIT or MARKET
quantityDECIMALNOPer element quantity (unit: contracts); at least one of quantity / valueQuantity must be non-zero
valueQuantityDECIMALNOUSDT notional; at least one of quantity / valueQuantity must be non-zero
priceDECIMALNORequired per element when type = LIMIT; defaults to 0 if omitted
timeInForceSTRINGNOOne of GTC, FOK, IOC, POST_ONLY; per element defaults to GTC if omitted

Response

data is an array of { code, order }; failed legs return order = null, successful legs return an order object.

json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "code": 200,
      "order": {
        "time": "1668418485058",
        "updateTime": "1668418485058",
        "orderId": "1289182123551455488",
        "clientOrderId": "c1",
        "symbol": "BTC-SWAP-USDT",
        "price": "19000",
        "leverage": "2",
        "origQty": "10",
        "executedQty": "0",
        "avgPrice": "0",
        "marginLocked": "9.5",
        "type": "LIMIT",
        "side": "BUY",
        "positionSide": "LONG",
        "timeInForce": "GTC",
        "status": "NEW",
        "contractMultiplier": "0.001"
      }
    },
    {
      "code": -2011,
      "order": null
    }
  ]
}

Update regular order (TRADE)

  • POST /api/v2/futures/order/update

Weight:2

Parameters

LIMIT orders only — amend price/size per the parameter table.

NameTypeMandatoryDescription
orderIdLONGNOMutually exclusive with origClientOrderId; pass one to identify the order
origClientOrderIdSTRINGNOMutually exclusive with orderId; client id of the order to update
newClientOrderIdSTRINGNONew client id; default generated if omitted
quantityDECIMALNONew quantity (optional, unit: contracts)
valueQuantityDECIMALNONew value quantity; default 0
priceDECIMALNONew price; default 0
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1767952682388",
    "updateTime": "1767952682388",
    "orderId": "2124135487564299264",
    "clientOrderId": "1767952681690",
    "symbol": "ETH-SWAP-USDT",
    "price": "4000",
    "leverage": "20",
    "origQty": "1",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "2",
    "type": "LIMIT",
    "side": "BUY",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "NEW",
    "contractMultiplier": "0.01"
  }
}

Cancel one regular order (TRADE)

  • DELETE /api/v2/futures/order

Weight:1

Parameters

NameTypeMandatoryDescription
orderIdLONGNOMutually exclusive with origClientOrderId; pass one to cancel
origClientOrderIdSTRINGNOMutually exclusive with orderId
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1668418485058",
    "updateTime": "1668418490000",
    "orderId": "1289182123551455488",
    "clientOrderId": "test1115",
    "symbol": "BTC-SWAP-USDT",
    "price": "19000",
    "leverage": "2",
    "origQty": "10",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "0",
    "type": "LIMIT",
    "side": "BUY",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "CANCELED",
    "contractMultiplier": "0.001"
  }
}

Batch cancel regular orders (TRADE)

  • DELETE /api/v2/futures/batch-orders

Weight:3

Parameters

NameTypeMandatoryDescription
symbolSTRINGYESComma-separated contract symbol ids
sideSTRINGNOOptional BUY or SELL; omit = no side filter. No positionSide on this route.
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

data is always null (no order payload, no string enums on this route).

json
{
  "code": 200,
  "msg": "success",
  "data": null
}

Get one regular order (USER_DATA)

  • GET /api/v2/futures/order

Weight:1

Parameters

NameTypeMandatoryDescription
orderIdLONGNOMutually exclusive with origClientOrderId; pass one to query
origClientOrderIdSTRINGNOMutually exclusive with orderId
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1668418485058",
    "updateTime": "1668418485058",
    "orderId": "1289182123551455488",
    "clientOrderId": "test1115",
    "symbol": "BTC-SWAP-USDT",
    "price": "19000",
    "leverage": "2",
    "origQty": "10",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "9.5",
    "type": "LIMIT",
    "side": "BUY",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "NEW",
    "contractMultiplier": "0.001"
  }
}

Open regular orders (USER_DATA)

  • GET /api/v2/futures/open-orders

Weight:1

Parameters

NameTypeMandatoryDescription
symbolSTRINGNOFilter by symbol id; empty = all
orderIdLONGNOCursor
limitINTNOdefault 20, min 1, max 1000
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "time": "1668418485058",
      "updateTime": "1668418485058",
      "orderId": "1289182123551455488",
      "clientOrderId": "test1115",
      "symbol": "BTC-SWAP-USDT",
      "price": "19000",
      "leverage": "2",
      "origQty": "10",
      "executedQty": "0",
      "avgPrice": "0",
      "marginLocked": "9.5",
      "type": "LIMIT",
      "side": "BUY",
      "positionSide": "LONG",
      "timeInForce": "GTC",
      "status": "NEW",
      "contractMultiplier": "0.001"
    }
  ]
}

History regular orders (USER_DATA)

  • GET /api/v2/futures/history-orders

Weight:5

Parameters

NameTypeMandatoryDescription
symbolSTRINGNOFilter by symbol id; empty = all
orderIdLONGNOCursor; default 0
startTimeLONGNOStart (ms); default rolling window if <= 0
endTimeLONGNOEnd (ms)
limitINTNOdefault 20, min 1, max 1000
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "time": "1668418485058",
      "updateTime": "1668418485058",
      "orderId": "1289182123551455488",
      "clientOrderId": "test1115",
      "symbol": "BTC-SWAP-USDT",
      "price": "19000",
      "leverage": "2",
      "origQty": "10",
      "executedQty": "0",
      "avgPrice": "0",
      "marginLocked": "9.5",
      "type": "LIMIT",
      "side": "BUY",
      "positionSide": "LONG",
      "timeInForce": "GTC",
      "status": "NEW",
      "contractMultiplier": "0.001"
    }
  ]
}

User trades (USER_DATA)

  • GET /api/v2/futures/user-trades

Weight:5

Parameters

NameTypeMandatoryDescription
symbolSTRINGYESContract symbol id
fromIdLONGNOdefault 0
toIdLONGNOdefault 0
startTimeLONGNOStart (ms)
endTimeLONGNOEnd (ms)
limitINTNOdefault 20, min 1, max 1000
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "time": "1668419000000",
      "createdTime": "1668419000100",
      "id": "9876543210",
      "orderId": "1289182123551455488",
      "matchOrderId": "1289182123551456000",
      "matchAccountId": "10001",
      "accountId": "122216245228131",
      "symbol": "BTC-SWAP-USDT",
      "price": "19000",
      "qty": "1",
      "commissionAsset": "USDT",
      "commission": "0.01",
      "makerRebate": "0",
      "type": "LIMIT",
      "side": "BUY",
      "positionSide": "LONG",
      "realizedPnl": "0",
      "ticketId": "t1",
      "isMaker": true,
      "matchOrderStrategy": 0
    }
  ]
}

New plan order (TRADE)

  • POST /api/v2/futures/algo-order

Weight:1

Parameters

NameTypeMandatoryDescription
symbolSTRINGYESContract symbol id
sideSTRINGYESBUY or SELL
positionSideSTRINGYESLONG or SHORT
typeSTRINGYESSTOP or STOP_MARKET
stopPriceDECIMALYESTrigger price
newClientOrderIdSTRINGYESClient order id
quantityDECIMALNOOrder quantity (unit: contracts); at least one of quantity / valueQuantity must be non-zero
valueQuantityDECIMALNOUSDT notional; at least one of quantity / valueQuantity must be non-zero
priceDECIMALNORequired when type = STOP (limit price after trigger); omit for STOP_MARKET
timeInForceSTRINGNOOne of GTC, FOK, IOC, POST_ONLY; default GTC if omitted
triggerBySTRINGNOTrigger price type: CONTRACT_PRICE (default), MARK_PRICE
takeProfitSTRINGNOTake-profit price
tpTriggerBySTRINGNOPrice type used to trigger take-profit: CONTRACT_PRICE, MARK_PRICE
tpLimitPriceSTRINGNOLimit price after take-profit is triggered (when tpOrderType = LIMIT)
tpOrderTypeSTRINGNOOrder type after take-profit is triggered: MARKET, LIMIT
stopLossSTRINGNOStop-loss price
slTriggerBySTRINGNOPrice type used to trigger stop-loss: CONTRACT_PRICE, MARK_PRICE
slLimitPriceSTRINGNOLimit price after stop-loss is triggered (when slOrderType = LIMIT)
slOrderTypeSTRINGNOOrder type after stop-loss is triggered: MARKET, LIMIT
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

Example — plan order (STOP / STOP_MARKET):

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1767952799216",
    "updateTime": "1767952799216",
    "orderId": "2124136467689134848",
    "clientOrderId": "1767952799112",
    "symbol": "BTC-SWAP-USDT",
    "price": "0",
    "leverage": "20",
    "origQty": "2",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "10",
    "type": "STOP_MARKET",
    "side": "BUY",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "ORDER_NEW",
    "contractMultiplier": "0.001",
    "stopPrice": "95000",
    "triggerBy": "CONTRACT_PRICE"
  }
}

Update plan order (TRADE)

  • POST /api/v2/futures/algo-order/update

Weight:2

Parameters

NameTypeMandatoryDescription
typeSTRINGYESSTOP (plan-order row) or STOP_PROFIT_LOSS (TP/SL row)
orderIdLONGNOMutually exclusive with origClientOrderId; pass one to locate the row to amend
origClientOrderIdSTRINGNOMutually exclusive with orderId; client id of the row to amend
newClientOrderIdSTRINGNONew client id; default generated if omitted
quantityDECIMALNONew quantity (unit: contracts)
valueQuantityDECIMALNOdefault 0
priceDECIMALNOdefault 0
stopPriceDECIMALNOTrigger price; default 0
triggerBySTRINGNOCONTRACT_PRICE or MARK_PRICE. Empty / omitted keeps the order’s original trigger type.
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

The returned object reflects the order family chosen by the request body's type: plan family returns STOP / STOP_MARKET, TP/SL family returns STOP_PROFIT_LOSS / STOP_PROFIT_LOSS_MARKET. TP/SL rows may include additional enum fields stopOrderType, stopType, and fallbackType (for trailing scenarios), plus related fields such as activePrice, fallbackQuantity, activeStatus, etc.

Example — plan family:

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1767952799216",
    "updateTime": "1767952800000",
    "orderId": "2124136467689134848",
    "clientOrderId": "1767952799112",
    "symbol": "BTC-SWAP-USDT",
    "price": "96000",
    "leverage": "20",
    "origQty": "2",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "10",
    "type": "STOP",
    "side": "BUY",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "ORDER_NEW",
    "contractMultiplier": "0.001",
    "stopPrice": "95000",
    "triggerBy": "CONTRACT_PRICE"
  }
}

Example — TP/SL family:

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1767952801000",
    "updateTime": "1767952802000",
    "orderId": "2124136467689135000",
    "clientOrderId": "1767952800001",
    "symbol": "BTC-SWAP-USDT",
    "price": "100000",
    "leverage": "20",
    "origQty": "1",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "5",
    "type": "STOP_PROFIT_LOSS",
    "side": "SELL",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "ORDER_NEW",
    "contractMultiplier": "0.001",
    "stopPrice": "99000",
    "triggerBy": "CONTRACT_PRICE",
    "stopOrderType": "TAKE_PROFIT",
    "stopType": "FIXED_STOP"
  }
}

Get one plan order (USER_DATA)

  • GET /api/v2/futures/algo-order

Weight:1

Plan and TP/SL rows resolve by id only.

Parameters

NameTypeMandatoryDescription
orderIdLONGNOMutually exclusive with origClientOrderId; pass one to query
origClientOrderIdSTRINGNOMutually exclusive with orderId
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

data is a single plan or TP/SL order:

  • type:
    • STOP — plan order, limit fill after trigger;
    • STOP_MARKET — plan order, market fill after trigger;
    • STOP_PROFIT_LOSS — TP/SL condition, limit after trigger;
    • STOP_PROFIT_LOSS_MARKET — TP/SL condition, market after trigger.
  • When type is STOP_PROFIT_LOSS or STOP_PROFIT_LOSS_MARKET, the row may include additional enum fields stopOrderType and stopType.
  • For trailing scenarios, the row may also include fallbackType, activePrice, fallbackQuantity, activeStatus, etc., when applicable.

Example — plan order (STOP / STOP_MARKET):

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1767952799216",
    "updateTime": "1767952800000",
    "orderId": "2124136467689134848",
    "clientOrderId": "1767952799112",
    "symbol": "BTC-SWAP-USDT",
    "price": "0",
    "leverage": "20",
    "origQty": "2",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "10",
    "type": "STOP",
    "side": "BUY",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "ORDER_NEW",
    "contractMultiplier": "0.001",
    "stopPrice": "96000",
    "triggerBy": "CONTRACT_PRICE"
  }
}

Example — TP/SL limit (STOP_PROFIT_LOSS, take-profit):

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1767952801000",
    "updateTime": "1767952802000",
    "orderId": "2124136467689135000",
    "clientOrderId": "tp-001",
    "symbol": "BTC-SWAP-USDT",
    "price": "100000",
    "leverage": "20",
    "origQty": "1",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "5",
    "type": "STOP_PROFIT_LOSS",
    "side": "SELL",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "ORDER_NEW",
    "contractMultiplier": "0.001",
    "stopPrice": "99000",
    "triggerBy": "MARK_PRICE",
    "stopOrderType": "TAKE_PROFIT",
    "stopType": "FIXED_STOP"
  }
}

Example — TP/SL market (STOP_PROFIT_LOSS_MARKET, stop-loss):

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1767952803000",
    "updateTime": "1767952803000",
    "orderId": "2124136467689135001",
    "clientOrderId": "sl-mkt-001",
    "symbol": "BTC-SWAP-USDT",
    "price": "0",
    "leverage": "20",
    "origQty": "1",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "5",
    "type": "STOP_PROFIT_LOSS_MARKET",
    "side": "SELL",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "ORDER_NEW",
    "contractMultiplier": "0.001",
    "stopPrice": "92000",
    "triggerBy": "CONTRACT_PRICE",
    "stopOrderType": "STOP_LOSS",
    "stopType": "FIXED_STOP"
  }
}

Example — trailing stop-loss (TRAILING_STOP, optional activePrice / fallback* when applicable):

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1767952804000",
    "updateTime": "1767952804000",
    "orderId": "2124136467689135002",
    "clientOrderId": "trail-001",
    "symbol": "BTC-SWAP-USDT",
    "price": "0",
    "leverage": "20",
    "origQty": "1",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "5",
    "type": "STOP_PROFIT_LOSS",
    "side": "SELL",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "ORDER_NEW",
    "contractMultiplier": "0.001",
    "stopPrice": "0",
    "triggerBy": "CONTRACT_PRICE",
    "stopOrderType": "STOP_LOSS",
    "stopType": "TRAILING_STOP",
    "activePrice": "95000",
    "fallbackType": "RATE",
    "fallbackQuantity": "0.01",
    "activeStatus": 0
  }
}

Cancel one plan order (TRADE)

  • DELETE /api/v2/futures/algo-order

Cancels a single plan or TP/SL row by id.

Weight:1

Parameters

NameTypeMandatoryDescription
orderIdLONGNOMutually exclusive with origClientOrderId; pass one to cancel
origClientOrderIdSTRINGNOMutually exclusive with orderId
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

data is the canceled order's final snapshot (plan or TP/SL):

  • type: same set as Get one plan orderResponseSTOP, STOP_MARKET, STOP_PROFIT_LOSS, STOP_PROFIT_LOSS_MARKET.
  • TP/SL rows also carry stopOrderType (TAKE_PROFIT, STOP_LOSS) and stopType (FIXED_STOP, TRAILING_STOP); trailing rows may include activePrice, fallbackType (RATE, PRICE), etc., when applicable.

Example — plan canceled:

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1767952799216",
    "updateTime": "1767952805000",
    "orderId": "2124136467689134848",
    "clientOrderId": "1767952799112",
    "symbol": "BTC-SWAP-USDT",
    "price": "0",
    "leverage": "20",
    "origQty": "2",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "10",
    "type": "STOP",
    "side": "BUY",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "ORDER_CANCELED",
    "contractMultiplier": "0.001",
    "stopPrice": "96000",
    "triggerBy": "CONTRACT_PRICE"
  }
}

Example — TP/SL canceled:

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "time": "1767952801000",
    "updateTime": "1767952805000",
    "orderId": "2124136467689135000",
    "clientOrderId": "tp-001",
    "symbol": "BTC-SWAP-USDT",
    "price": "100000",
    "leverage": "20",
    "origQty": "1",
    "executedQty": "0",
    "avgPrice": "0",
    "marginLocked": "5",
    "type": "STOP_PROFIT_LOSS",
    "side": "SELL",
    "positionSide": "LONG",
    "timeInForce": "GTC",
    "status": "ORDER_CANCELED",
    "contractMultiplier": "0.001",
    "stopPrice": "99000",
    "triggerBy": "MARK_PRICE",
    "stopOrderType": "TAKE_PROFIT",
    "stopType": "FIXED_STOP"
  }
}

Open plan orders (USER_DATA)

  • GET /api/v2/futures/open-algo-orders

Weight:1

Parameters

NameTypeMandatoryDescription
symbolSTRINGNOFilter; empty = all
orderIdLONGNOCursor
stopCategorySTRINGNOSTOP (plan orders only) or STOP_PROFIT_LOSS (TP/SL only); if omitted, results are plan STOP only (excludes TP/SL)
limitINTNOdefault 20, min 1, max 1000
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

data is an array of plan / TP-SL order rows:

  • Per-row type: same four values and meanings as Get one plan orderResponseSTOP, STOP_MARKET, STOP_PROFIT_LOSS, STOP_PROFIT_LOSS_MARKET. Which rows appear is determined by request stopCategory (it filters the row set only; it does not change per-row enum semantics).
  • TP/SL rows also carry stopOrderType (TAKE_PROFIT, STOP_LOSS) and stopType (FIXED_STOP, TRAILING_STOP); trailing rows may include activePrice, fallbackType (RATE, PRICE), fallbackQuantity, activeStatus, etc., when applicable.
json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "time": "1767952799216",
      "updateTime": "1767952799216",
      "orderId": "2124136467689134848",
      "clientOrderId": "1767952799112",
      "symbol": "BTC-SWAP-USDT",
      "price": "0",
      "leverage": "20",
      "origQty": "2",
      "executedQty": "0",
      "avgPrice": "0",
      "marginLocked": "10",
      "type": "STOP_MARKET",
      "side": "BUY",
      "positionSide": "LONG",
      "timeInForce": "GTC",
      "status": "ORDER_NEW",
      "contractMultiplier": "0.001",
      "stopPrice": "95000",
      "triggerBy": "CONTRACT_PRICE"
    },
    {
      "time": "1767952801000",
      "updateTime": "1767952802000",
      "orderId": "2124136467689135000",
      "clientOrderId": "tp-001",
      "symbol": "BTC-SWAP-USDT",
      "price": "100000",
      "leverage": "20",
      "origQty": "1",
      "executedQty": "0",
      "avgPrice": "0",
      "marginLocked": "5",
      "type": "STOP_PROFIT_LOSS",
      "side": "SELL",
      "positionSide": "LONG",
      "timeInForce": "GTC",
      "status": "ORDER_NEW",
      "contractMultiplier": "0.001",
      "stopPrice": "99000",
      "triggerBy": "MARK_PRICE",
      "stopOrderType": "TAKE_PROFIT",
      "stopType": "FIXED_STOP"
    },
    {
      "time": "1767952803000",
      "updateTime": "1767952803000",
      "orderId": "2124136467689135001",
      "clientOrderId": "sl-mkt-001",
      "symbol": "BTC-SWAP-USDT",
      "price": "0",
      "leverage": "20",
      "origQty": "1",
      "executedQty": "0",
      "avgPrice": "0",
      "marginLocked": "5",
      "type": "STOP_PROFIT_LOSS_MARKET",
      "side": "SELL",
      "positionSide": "LONG",
      "timeInForce": "GTC",
      "status": "ORDER_NEW",
      "contractMultiplier": "0.001",
      "stopPrice": "92000",
      "triggerBy": "CONTRACT_PRICE",
      "stopOrderType": "STOP_LOSS",
      "stopType": "FIXED_STOP"
    },
    {
      "time": "1767952804000",
      "updateTime": "1767952804000",
      "orderId": "2124136467689135002",
      "clientOrderId": "trail-001",
      "symbol": "BTC-SWAP-USDT",
      "price": "0",
      "leverage": "20",
      "origQty": "1",
      "executedQty": "0",
      "avgPrice": "0",
      "marginLocked": "5",
      "type": "STOP_PROFIT_LOSS",
      "side": "SELL",
      "positionSide": "LONG",
      "timeInForce": "GTC",
      "status": "ORDER_NEW",
      "contractMultiplier": "0.001",
      "stopPrice": "0",
      "triggerBy": "CONTRACT_PRICE",
      "stopOrderType": "STOP_LOSS",
      "stopType": "TRAILING_STOP",
      "activePrice": "95000",
      "fallbackType": "RATE",
      "fallbackQuantity": "0.01",
      "activeStatus": 0
    }
  ]
}

History plan orders (USER_DATA)

  • GET /api/v2/futures/history-algo-orders

Weight:5

Parameters

NameTypeMandatoryDescription
symbolSTRINGNOFilter; empty = all
orderIdLONGNOdefault 0
stopCategorySTRINGNOSTOP (plan orders only) or STOP_PROFIT_LOSS (TP/SL only); if omitted, results are plan STOP only (excludes TP/SL)
startTimeLONGNOStart (ms); default rolling window if <= 0
endTimeLONGNOEnd (ms)
limitINTNOdefault 20, min 1, max 1000
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

data is an array of plan / TP-SL order rows:

  • Per-row type: same four values and meanings as Get one plan orderResponseSTOP, STOP_MARKET, STOP_PROFIT_LOSS, STOP_PROFIT_LOSS_MARKET. Which rows appear is determined by request stopCategory (it filters the row set only; it does not change per-row enum semantics).
  • TP/SL rows also carry stopOrderType (TAKE_PROFIT, STOP_LOSS) and stopType (FIXED_STOP, TRAILING_STOP); trailing rows may include activePrice, fallbackType (RATE, PRICE), fallbackQuantity, activeStatus, etc., when applicable.
json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "time": "1767952799216",
      "updateTime": "1767952799216",
      "orderId": "2124136467689134848",
      "clientOrderId": "1767952799112",
      "symbol": "BTC-SWAP-USDT",
      "price": "0",
      "leverage": "20",
      "origQty": "2",
      "executedQty": "0",
      "avgPrice": "0",
      "marginLocked": "10",
      "type": "STOP_MARKET",
      "side": "BUY",
      "positionSide": "LONG",
      "timeInForce": "GTC",
      "status": "ORDER_NEW",
      "contractMultiplier": "0.001",
      "stopPrice": "95000",
      "triggerBy": "CONTRACT_PRICE"
    },
    {
      "time": "1767952801000",
      "updateTime": "1767952802000",
      "orderId": "2124136467689135000",
      "clientOrderId": "tp-001",
      "symbol": "BTC-SWAP-USDT",
      "price": "100000",
      "leverage": "20",
      "origQty": "1",
      "executedQty": "0",
      "avgPrice": "0",
      "marginLocked": "5",
      "type": "STOP_PROFIT_LOSS",
      "side": "SELL",
      "positionSide": "LONG",
      "timeInForce": "GTC",
      "status": "ORDER_NEW",
      "contractMultiplier": "0.001",
      "stopPrice": "99000",
      "triggerBy": "MARK_PRICE",
      "stopOrderType": "TAKE_PROFIT",
      "stopType": "FIXED_STOP"
    }
  ]
}

Batch cancel plan orders (TRADE)

  • DELETE /api/v2/futures/batch-cancel-algo-orders

Weight:3

Parameters

NameTypeMandatoryDescription
symbolSTRINGYESComma-separated symbol ids
stopCategorySTRINGYESRequired: STOP (cancel plan orders for the symbol) or STOP_PROFIT_LOSS (cancel TP/SL rows for the symbol)
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

data is always null (no order payload, no string enums on this route).

json
{
  "code": 200,
  "msg": "success",
  "data": null
}

Change leverage (TRADE)

  • POST /api/v2/futures/leverage

Weight:1

Parameters

NameTypeMandatoryDescription
symbolSTRINGYESContract symbol id
leverageSTRINGYESTarget leverage (string in request)
categorySTRINGNOUSDT-M: USDT, USDC-M: USDC; default USDT
timestampLONGYES
recvWindowLONGNOrecv window

Response

data reflects the new leverage setting; no string-enum fields (leverage is numeric).

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "symbolId": "BTC-SWAP-USDT",
    "leverage": 20
  }
}

Released under the MIT License.