Skip to main content

Get Order Information

API Description

This interface provides information for current unfilled orders. Users can specify a list of order IDs to query specific orders. If neither the instrument nor order IDs are specified, the response will include all unfilled orders under the specified order type. The response includes details such as the instrument, trade direction, quantity, quantity unit, margin, leverage, maker fee, taker fee, timestamp etc.

Note: Order information data is only available via RESTful API.

Precautions

  1. This API is only used to obtain information about unfulfilled orders. It does not support batch query of all order records by orderId. Please do not confuse usage scenarios.
  2. The request parameter "positionType" may return additional data beyond the specified type. For example: If set to execute (market orders), the response may also include plan orders (limit orders). For "planTrigger", the response will be returned only after the order is triggered and placed. For "moveStopProfitLoss", the response behaves as expected.

Authentication

This is a private interface and requires authentication. For details on using the RESTful API, refer to Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface.

Request Method

GET

Endpoint

v1/perpum/order

Frequency Limit

The frequency limit for this interface is 10 requests/s per user ID and IP. In addition to this per-interface limit, a global rate limit is also enforced.

For detailed information on Global rate limits and API Rate Limiting Policyolicy*, please refer to the "Frequency Limit" section at click here

Request Parameters

ParameterMandatoryTypeDescription
sourceIdsfalseStringList of order IDs separated by commas (,).
Example: "orderId1,orderId2,orderId3"
Note: The number of order IDs cannot exceed 20.
positionTypetrueStringOrder type: execute/plan/moveStop/stopProfitLoss
execute: market order,
plan: plan order,
moveStop: trailing stop loss and take profit,
stopProfitLoss: stop loss and take profit
instrumentfalseStringThe base currency of the instrument. (e.g., BTC or btc). This parameter is case-insensitive.
Note: For instruments that start with numbers (e.g., 1000PEPE), both uppercase and lowercase formats are valid.

Response Parameters

ParameterTypeDescription
idStringOrder ID
baseSizeBigDecimalContract size in base currency
contractTypeStringContract type:
1: perpetual contract
userIdLongContract account user ID
feeBigDecimalHandling fee
createdDateLongOrder creation timestamp
currentPieceBigDecimalCurrent number of contracts
directionStringTrade direction:long/short
frozenFeeBigDecimalFrozen handeling fee
indexPriceBigDecimalIndex trigger price
instrumentStringRepresents trading instrument.
Example: BTC (for BTC/USDT), BTC_USDC (for BTC/USDC)
leverageBigDecimalPosition leverage
liquidateByStringOpening and closing event types:
Manual
makerFeeBigDecimalMaker fee
takerFeeBigDecimalTaker fee
marginBigDecimalMargin used by the position
orderPriceBigDecimalOrder price specified by user
totalPieceBigDecimalTotal number of contracts
orderStatusStringOrder status:
unFinish: unfulfilled, part: partially filled, Finish: fully filled, Cancel: cancelled
originalTypeStringOriginal order type
posTypeStringPosition type:plan/planTrigger/execute
positionMarginBigDecimalPosition margin
positionModelIntegerPosition margin mode:
0: Isolated margin 1: Cross margin
quantityBigDecimalSpecifies order size based on quantityUnit:
If quantityUnit=0, the quantity is measured the quote currency (e.g., USDT in BTC-USDT),
If quantityUnit=1, the quantity is measured in number of contracts,
If quantityUnit=2, the quantity is measured in the base currency (e.g., BTC in BTC-USDT)
quantityUnitIntegerSpecifies the unit for order size:
0: Denominated in the quote currency (e.g., USDT in BTC-USDT),
1: Denominated in number of contracts,
2: Denominated in the base currency (e.g., BTC in BTC-USDT)
statusStringStatus:open/close
stopLossPriceStringStop loss price
stopLossRateStringStop loss rate
stopProfitPriceStringTake profit price
stopProfitRateStringTake profit rate
stopLossOrderPriceStringStop loss limit price
stopProfitOrderPriceStringTake profit limit price
updatedDateLongLast order update timestamp
sourceStringSource: web/api
thirdOrderIdStringCustom order ID assigned by the user

Request Example

The following Python code shows how to get order information.

Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Futures > Restful Private Interface.

params = {
"positionType" : "execute",
# "instrument" : "btc",
"sourceIds" : "33308753606524437,33308753605637070,33308753616147587" }

api_url = "/v1/perpum/order"
method = "GET"
response_code, response_data = FuturesRestfulPrivate(params, api_url, method, sec_key, api_key) # function FuturesRestfulPrivate() is defined in section (Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface.)

Note: For a complete Java code example, please refer to Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface.

Response Example

The following is an example response returned by the above Python request:

{'code': 0,
'data': [{'baseSize': 0.002,
'contractType': 1,
'createdDate': 1740905644000,
'currentPiece': 2,
'direction': 'long',
'fee': '0',
'frozenFee': '0.0168',
'id': 33308753605637070,
'indexPrice': 85880.1,
'instrument': 'BTC',
'leverage': 2,
'liquidateBy': 'manual',
'makerFee': '0.0001',
'margin': 84,
'orderPrice': 84000,
'orderStatus': 'unFinish',
'originalType': 'plan',
'posType': 'plan',
'positionMargin': 84,
'positionModel': 0,
'quantity': 100,
'quantityUnit': 0,
'source': 'api',
'status': 'open',
'stopLossPrice': 83000,
'stopLossRate': 0.02380952,
'stopProfitPrice': 95000,
'stopProfitRate': 0.2619048,
'takerFee': '0.0006',
'thirdOrderId': '103-12-53',
'totalPiece': 2,
'triggerPrice': 84400,
'triggerType': 1,
'updatedDate': 1740905777000,
'userId': 1162061}, {..........},{.......}],
'msg': ''}