Get Order Information

Preview Order

Corresponding request class TradeOrderPreviewRequest

Description

Preview an order and return the pre-order eligibility check and asset information. This endpoint does not submit or execute the order, and a passed preview does not guarantee a fill.

Attached and OCA order preview is not supported. Multi-leg preview is available only for compatible Prime accounts and contracts.

Parameters

ParameterTypeRequiredDescription
accountstringYesUser authorized account
symbolstringConditionalStock symbol, e.g., AAPL. A standalone contract uses symbol; a multi-leg preview identifies contracts through contract_legs
sec_typestringYesContract type: STK, OPT, WAR, IOPT, FUT, FUND, CC, or MLEG for multi-leg orders
actionstringYesOrder side BUY/SELL
order_typestringYesOrder type MKT(market order), LMT(limit order), STP(stop order), STP_LMT(stop limit order), TRAIL(trailing stop order)
total_quantityLongConditionalOrder quantity. Required for every non-FUND order; FUND purchases may omit it
limit_pricedoubleNoLimit price, required when order_type is LMT or STP_LMT; not required for STP
aux_pricedoubleNoStop trigger price for STP/STP_LMT; trailing amount for TRAIL. If both trailing fields are supplied, trailing_percent takes precedence
trailing_percentdoubleNoTrailing percentage for TRAIL; takes precedence over aux_price when both are supplied
outside_rthbooleanNotrue: Allow pre-market and after-hours trading (US stocks only), false: Not allowed, default allows
marketstringNoMarket (US stocks US, HK stocks HK, Shanghai-HK Stock Connect CN)
currencystringNoCurrency (US stocks USD, HK stocks HKD, Shanghai-HK Stock Connect CNH)
time_in_forcestringNoTime in force: DAY, GTC, GTD, or OPG. When omitted, ordinary orders default to DAY; CC and FUND orders use GTC
exchangestringNoExchange (US stocks SMART, HK stocks SEHK, Shanghai-HK Stock Connect SEHKNTL, Shenzhen-HK Stock Connect SEHKSZSE)
expirystringNoExpiry date (options, warrants, bull/bear certificates only)
strikestringNoStrike price (options, warrants, bull/bear certificates only)
rightstringNoOption right PUT/CALL (options, warrants, bull/bear certificates only)
multiplierfloatNoMultiplier, quantity per lot (options, warrants, bull/bear certificates only)
local_symbolstringNoRequired for warrants and bull/bear certificates, the 5-digit number under the name in the warrant/bull bear certificate list in the APP
total_quantity_scaleintNoQuantity scale for fractional shares
cash_amountDoubleNoAmount-based order amount. FUND purchases are supported; the current SDK does not support stock amount orders
adjust_limitdoubleNoPrice adjustment range; default is 0
trading_session_typeTradingSessionTypeNoPRE_RTH_POST, OVERNIGHT, RTH, FULL, HK_AUC, HK_CTS, or HK_AUC_CTS; actual support depends on the account, market, instrument, and order type
expire_timelongNoGTD expiration timestamp in milliseconds
alloc_accountsList<String>NoGlobal accounts only Must be supplied with alloc_shares; account entries must be non-empty, and both lists must have the same length and correspond by index
alloc_sharesList<Double>NoGlobal accounts only Must be supplied with alloc_accounts; each value must be positive and both lists must have the same length
algo_strategystringNoAlgorithm strategy name
algo_paramsList<TagValue>NoAlgorithm parameters
display_sizeIntegerNoIceberg display quantity. The model exposes this field, but TradeOrderPreviewRequest has no convenience setter for it; use only for accounts and orders that support Iceberg preview
min_display_sizeIntegerNoIceberg minimum display quantity; applicability and Java usage limitations are the same as for display_size
check_intervalsIntegerNoIceberg price-check interval in seconds; applicability and Java usage limitations are the same as for display_size
price_typestringNoIceberg price type; applicability and Java usage limitations are the same as for display_size
start_timeLongNoIceberg effective start time in milliseconds; applicability and Java usage limitations are the same as for display_size
end_timeLongNoIceberg effective end time in milliseconds; applicability and Java usage limitations are the same as for display_size
combo_typestringNoMulti-leg combination type
contract_legsList<ContractLeg>NoMulti-leg definitions
secret_keystringNoTrader secret key, for institutional users only
user_markstringNoOrder comment. Trimming, length normalization, and return behavior are account-dependent. Prime accounts trim surrounding whitespace and retain at most the first 200 characters
order_idintNoOrder ID
sourcestringNoOrder source identifier
attach_typestringNoAttached-order type; attached-order preview is not supported
profit_taker_orderIdintNoAttached profit-taker order ID; attached-order preview is not supported
profit_taker_pricedoubleNoAttached profit-taker price; attached-order preview is not supported
profit_taker_tifstringNoAttached profit-taker time in force; attached-order preview is not supported
profit_taker_rthbooleanNoWhether the attached profit-taker allows extended hours; attached-order preview is not supported
stop_loss_order_typestringNoAttached stop-loss order type; attached-order preview is not supported
stop_loss_orderIdintNoAttached stop-loss order ID; attached-order preview is not supported
stop_loss_pricedoubleNoAttached stop-loss trigger price; attached-order preview is not supported
stop_loss_limit_pricedoubleNoAttached stop-loss limit price; attached-order preview is not supported
stop_loss_tifstringNoAttached stop-loss time in force; attached-order preview is not supported
stop_loss_trailing_percentdoubleNoAttached trailing-stop percentage; attached-order preview is not supported
stop_loss_trailing_amountdoubleNoAttached trailing-stop amount; attached-order preview is not supported
oca_ordersList<TradeOrderModel>NoOCA order list; OCA preview is not supported

Response

FieldTypeDescription
accountStringAccount ID
initMarginDoubleInitial margin assuming the order is filled
maintMarginDoubleMaintenance margin assuming the order is filled
equityWithLoanDoubleEquity with loan assuming the order is filled
initMarginBeforeDoubleInitial margin before the hypothetical fill
maintMarginBeforeDoubleMaintenance margin before the hypothetical fill
equityWithLoanBeforeDoubleEquity with loan before the hypothetical fill
marginCurrencyStringCurrency of the asset and margin preview values
commissionDoubleEstimated commission; currency is commissionCurrency
gstDoubleEstimated goods and services tax; currency is commissionCurrency
commissionCurrencyStringCurrency of the estimated commission and GST
availableEEDoubleAvailable excess equity assuming the order is filled, in marginCurrency
excessLiquidityDoubleExcess liquidity assuming the order is filled, in marginCurrency
overnightLiquidationDoubleOvernight excess liquidity assuming the order is filled, in marginCurrency
isPassBooleanWhether the order passes the pre-order check
messageStringError reason when the check does not pass
statusStringPreview status
minCommissionDoubleEstimated minimum commission
maxCommissionDoubleEstimated maximum commission
maxOrderSizeDoubleMaximum order quantity indicated by the preview
warningTextStringWarning text returned with the preview

Example

ContractItem contract = ContractItem.buildStockContract("SPY", "USD");

TradeOrderPreviewRequest request = TradeOrderPreviewRequest.buildLimitOrder(contract, ActionType.BUY, 1, 100.0d);
TradeOrderPreviewResponse response = client.execute(request);
System.out.println(JSONObject.toJSONString(response));

Example Response

{
  "code": 0,
  "message": "success",
  "timestamp": 1748413352204,
  "data": {
    "account": "123456",
    "initMargin": 432.617714,
    "maintMargin": 424.264714,
    "equityWithLoan": 1111.3237541,
    "initMarginBefore": 387.617714,
    "maintMarginBefore": 386.764714,
    "equityWithLoanBefore": 1111.3237541,
    "marginCurrency": "USD",
    "commission": 0.0,
    "commissionCurrency": "USD",
    "availableEE": 677.8311632,
    "excessLiquidity": 687.05904,
    "overnightLiquidation": 687.05904,
    "gst": 0.0,
    "isPass": true
  }
}

Get Orders

Request class: TigerHttpRequest(MethodName.ORDERS)

Description

Get orders

Parameters

Get a specific single order

ParameterTypeRequiredDescription
accountstringYesUser authorized account: 572386
idintYesOrder number returned after successful order placement
secret_keystringNoTrader secret key, for institutional users only
show_chargesboolNoWhether to return order fee details

Get order list

ParameterTypeRequiredDescription
accountstringYesUser authorized account: 572386
seg_typeSegmentTypeNoAccount segment type, optional values: SegmentType.SEC for securities; SegmentType.FUT for futures; SegmentType.FUND for funds, SegmentType.ALL: represents securities+futures+funds. Default is SegmentType.SEC
sec_typestringNoALL/STK/OPT/FUT/FOP/CASH default ALL
marketstringNoALL/US/HK/CN default ALL
symbolstringNoStock symbol
expirystringNoExpiry date (options, warrants, bull/bear certificates only)
strikestringNoStrike price (options, warrants, bull/bear certificates only)
rightstringNoOption right PUT/CALL (options, warrants, bull/bear certificates only)
start_datestringNoStart time, filtered on the timestamp selected by sort_by; format '2018-05-01' or "2018-05-01 10:00:00" (default GMT+8, can specify time zone)
end_datestringNoEnd time, filtered on the timestamp selected by sort_by; format '2018-05-15' or "2018-05-01 10:00:00" (default GMT+8, can specify time zone)
statesarrayNoOrder-state filter for Global, Prime, and Paper. Global converts values to status codes before querying; Prime/Paper filter returned orders. Omission applies no state filter. See Order Status
isBriefbooleanNoOnly supports global accounts Whether to return simplified order information
limitintegerNoDefault is 100, maximum limit is 300
sort_byOrderSortByNoOmnibus accounts only. Timestamp used for sorting and start_date/end_date filtering. LATEST_CREATED sorts descending and filters by order creation/submission time; LATEST_STATUS_UPDATED sorts descending and filters by the most recent order status update time. The service defaults to LATEST_CREATED when omitted.
secret_keystringNoTrader secret key, for institutional users only
langstringNoLanguage support (Language enum): zh_CN, zh_TW, en_US, default: en_US
page_tokenstringNoPagination query token, other query conditions cannot change when using pageToken for pagination

Both start_date and end_date are optional; omitting either bound applies no corresponding time filter. The current interface defines no maximum query span, but results are paginated and subject to the per-page limit. Specify a reasonable time range and paginate with page_token.

The server validates the request method and time range encoded by page_token; clients should still keep every filter unchanged across pages. A page filtered by states can contain fewer than limit items, including zero, so continue while nextPageToken is present. Concurrent order creation or updates can change cross-page results; pagination does not guarantee snapshot consistency.

Response

com.tigerbrokers.stock.openapi.client.https.response.trade.SingleOrderResponse or
com.tigerbrokers.stock.openapi.client.https.response.trade.BatchOrderResponse

For Global accounts, a successful response can contain data: null, making SingleOrderResponse.getItem() return null, when the order is not found. Prime-account not-found errors are defined downstream.

FieldTypeDescription
nextPageTokenstringToken for querying the next page
itemsarrayOrder array, refer to field descriptions below

Order data items properties:

NameExampleDescription
id27363676799501312Global unique order ID, returned after successful order placement
orderId830154374User local auto-increment order ID, not globally unique
externalId830154374Extended ID, for API orders it's the orderId value
parentId0Parent order's order ID
account572386Trading account
actionBUYOrder side, BUY or SELL
orderTypeLMTOrder type
limitPrice108.62Limit order price
auxPrice0.0Stop order auxiliary price - trailing amount
trailingPercent5Trailing stop order trailing percentage
totalQuantity111Order quantity
totalQuantityScale0Order quantity offset, default 0. For fractional shares, totalQuantity and totalQuantityScale combined represent real order quantity
timeInForceDAYDAY/GTC/GTD/OPG
expireTime1669000183188Only has value when timeInForce is GTD
outsideRthtrueWhether to allow pre-market and after-hours trading
filledQuantity50Filled quantity
filledQuantityScale0Filled quantity offset
totalCashAmount100Total amount for an amount-based order; may be absent for a quantity-based order
filledCashAmount100Filled amount for an amount-based order; may be absent or zero for a quantity-based order
refundCashAmount0Refund amount, equals total order amount minus filled amount
avgFillPrice108.62Volume-weighted average of fill prices, excluding commissions and other fees; fees are returned separately. Returns 0 when no average fill price is available
remarkOrder is expiredError description
statusFilledOrder status, reference: Order Status
attrDescExerciseOrder description information, reference: Order Description
commission0.99Commission and related fees
commissionCurrencyUSDCommission currency
gst1.34Goods and services tax
realizedPnl0.0FIFO realized P&L. Commission and GST are returned separately; refer to the account statement for the exact calculation basis and currency. It is meaningful after a closing fill and is usually 0 for opening or unfilled orders.
openTime1657667486000Order placement time
updateTime1657670428000Last update time
latestTime1657670428000Status update time
nameAlibabaContract name
symbolBABAStock symbol
identifierBABAContract identifier
currencyUSDCurrency
marketUSTrading market
expiry20251219Expiry for options, warrants, CBBCs, and futures
strike200Strike price for options, warrants, and CBBCs
rightCALLOption right
multiplier0.0Multiplier, quantity per lot
secTypeSTKTrading type
userMarkmy_strategy_1Order remark parameter, returns the set value, length cannot exceed 200
canModifyfalseWhether the order can be modified
canCancelfalseWhether the order can be canceled
liquidationfalseWhether it's forced liquidation
isOpentrueWhether it's an opening position
latestPrice108.62Latest market price when returned
tradingSessionTypeRTHTrading session type
sourceOpenApiOrder source
discount0Discount indicator
replaceStatusNONEOrder Replace Status
cancelStatusNONEOrder Cancel Status
chargesOrder commission and fee details (single order query only)
commissionDiscountAmount0Commission discount amount (single order query only)
orderDiscountAmount0Order deduction amount
orderDiscount0Order discount status (single order query only). 1: Pending discount; 2: Applied; 0: Default
attrList["EXERCISE"]Order attributes: LIQUIDATION, FRACTIONAL_SHARE, EXERCISE, EXPIRE, ASSIGNMENT, CASH_SETTLE, KNOCK_OUT, RECALL, ODD_LOT, DEALER, GREY_MARKET, BLOCK_TRADE, ATTACHED_ORDER, or OCA
displaySize100Iceberg order display quantity
minDisplaySize50Iceberg order minimum display quantity
checkIntervals30Iceberg order price-check interval in seconds
priceTypeLIMIT_PRICEIceberg order price type
cashQuantity100Legacy amount-order field; use fields such as totalCashAmount for current amount-order information
lastFillPrice108.62Price of the latest fill
goodTillDate2025-12-31Good-till date when returned
triggerStatusTriggeredTrigger status for conditional orders
ocaGroupId87055OCA group ID
comboLegsMulti-leg order description
allocAccountsAllocation sub-account list for Global-account orders
allocSharesQuantity allocated to each corresponding sub-account
algoStrategyTWAPAlgorithm strategy
algoParametersAlgorithm parameter list
comboTypeCUSTOMMulti-leg combination type
comboTypeDescMulti-leg combination description
legsMulti-leg order details
startTime1687271400000Iceberg effective start time
endTime1687294800000Iceberg effective end time

Charge Description:

NameExampleDescription
categoryTIGERFee category: TIGER/THIRD_PARTY
categoryDescTiger ChargeFee category description
total18Total fee for current category
detailsFee details. See ChargeDetails below

ChargeDetails Description:

NameExampleDescription
typeSETTLEMENT_FEEFee type: SETTLEMENT_FEE/STAMP_DUTY/TRANSACTION_LEVY/EXCHANGE_FEE/FRC_TRANSACTION_LEVY
typeDescSettlement FeeFee type description
originalAmount4Fee amount
afterDiscountAmount4Fee after discount

Example

Get single order

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
QuerySingleOrderRequest request = new QuerySingleOrderRequest();

String bizContent = AccountParamBuilder.instance()
        .account("572386")
        .id(31227598058424320L)
        .isShowCharges(true)
        .lang(Language.en_US)
        .buildJson();

request.setBizContent(bizContent);
SingleOrderResponse response = client.execute(request);

if (response.isSuccess()) {
  System.out.println(JSONObject.toJSONString(response));
  Long id = response.getItem().getId();
  String action = response.getItem().getAction();
  // ...
} else {
  System.out.println(response.getMessage());
}

Get order list

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
QueryOrderRequest request = new QueryOrderRequest();

String bizContent = AccountParamBuilder.instance()
    .account("572386")
    .startDate("2023-04-01 00:00:00", TimeZoneId.NewYork)
    .endDate("2023-06-20 23:59:59", TimeZoneId.NewYork)
    .secType(SecType.STK)
    .sortBy(OrderSortBy.LATEST_CREATED)
    .limit(5)
    .buildJson();

request.setBizContent(bizContent);
BatchOrderResponse response = client.execute(request);

if (response.isSuccess()) {
  System.out.println(JSONObject.toJSONString(response));
  List<TradeOrder> orders = response.getItem().getOrders();
  TradeOrder order1 = orders.get(0);
  String symbol = order1.getSymbol();
  Long id = order1.getId();
  // ...
} else {
  System.out.println(response.getMessage());
}

Use pageToken for paginated order retrieval

List<JSONObject> results = new ArrayList<>();
int page = 1;
String pageToken = "";

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
long startTime = sdf.parse("2023-01-01").getTime();
long endTime = sdf.parse("2025-08-01").getTime();

while (true) {
    TigerHttpRequest request = new TigerHttpRequest(MethodName.ORDERS);
    String bizContent = AccountParamBuilder.instance()
        .account("402501")
        .symbol("AAPL")
        .startDate(String.valueOf(startTime))
        .endDate(String.valueOf(endTime))
        .limit(10)
        .pageToken(pageToken)
        .buildJson();
    request.setBizContent(bizContent);
    TigerHttpResponse response = client.execute(request);

    JSONObject responseData = JSON.parseObject(response.getData());
    JSONArray items = responseData.getJSONArray("items");
    
    System.out.println("page " + page + ", size " + items.size() + 
        ", next_page_token: " + responseData.getString("nextPageToken"));
    page++;

    if (items != null && !items.isEmpty()) {
        for (int i = 0; i < items.size(); i++) {
            results.add(items.getJSONObject(i));
        }
    }

    pageToken = responseData.getString("nextPageToken");
    if (StringUtils.isEmpty(pageToken)) {
        break;
    }
}

System.out.println("total: " + results.size() + ", results: " + results);

Example Response

Single order

{
    "code": 0,
    "data": {
        "account": "572386",
        "action": "SELL",
        "algoStrategy": "LMT",
        "attrDesc": "",
        "attrList": [
            "SETTLED"
        ],
        "avgFillPrice": 3.54,
        "canCancel": false,
        "canModify": false,
        "cancelStatus": "NONE",
        "charges": [
            {
                "category": "TIGER",
                "categoryDesc": "Tiger Charge",
                "details": [
                    {
                        "afterDiscountAmount": 18,
                        "originalAmount": 18,
                        "type": "USER_COMMISSION",
                        "typeDesc": "Commission"
                    }
                ],
                "total": 18
            },
            {
                "category": "THIRD_PARTY",
                "categoryDesc": "Third Parties",
                "details": [
                    {
                        "afterDiscountAmount": 4,
                        "originalAmount": 4,
                        "type": "SETTLEMENT_FEE",
                        "typeDesc": "Settlement Fee"
                    },
                    {
                        "afterDiscountAmount": 22,
                        "originalAmount": 22,
                        "type": "STAMP_DUTY",
                        "typeDesc": "Stamp Duty"
                    },
                    {
                        "afterDiscountAmount": 0.58,
                        "originalAmount": 0.58,
                        "type": "TRANSACTION_LEVY",
                        "typeDesc": "Transaction Levy"
                    },
                    {
                        "afterDiscountAmount": 1.2,
                        "originalAmount": 1.2,
                        "type": "EXCHANGE_FEE",
                        "typeDesc": "Exchange Fee"
                    },
                    {
                        "afterDiscountAmount": 0.04,
                        "originalAmount": 0.04,
                        "type": "FRC_TRANSACTION_LEVY",
                        "typeDesc": "AFRC Transaction Levy"
                    }
                ],
                "total": 27.82
            }
        ],
        "commission": 45.82,
        "currency": "HKD",
        "discount": 0,
        "externalId": "710344498739626686",
        "filledCashAmount": 21240,
        "filledQuantity": 6000,
        "filledQuantityScale": 0,
        "gst": 0,
        "id": 36810407788938240,
        "identifier": "01177",
        "isOpen": false,
        "latestTime": 1729740324000,
        "limitPrice": 3.54,
        "liquidation": false,
        "market": "HK",
        "name": "SINO BIOPHARM",
        "openTime": 1729740323000,
        "orderDiscount": 0,
        "orderId": 0,
        "orderType": "LMT",
        "outsideRth": false,
        "realizedPnl": -6388.735,
        "remark": "",
        "replaceStatus": "NONE",
        "secType": "STK",
        "source": "android",
        "status": "Filled",
        "symbol": "01177",
        "timeInForce": "GTC",
        "totalQuantity": 6000,
        "totalQuantityScale": 0,
        "tradingSessionType": "RTH",
        "updateTime": 1730045103000,
        "userMark": ""
    },
    "message": "success",
    "sign": "F9xRzsjqgFlfaUJVajSber2jfCOVt1DIovKcE3yxWK9DFqfTPXHxKqCJ3aT8bGPl/8THViWW0A62LlRL1RB41cLt6bsMUyG7+nSQOE2vPIdo29SyZGcPAiSdRHbY8h3Nq9V1PzVQVqs07joUOw5dUuO5M3TgY/R0UHFV0lwxkBM=",
    "success": true,
    "timestamp": 1730971141181
}

Order List

{
    "code":0,
    "data":{
        "items":[
            {
                "account":"572386",
                "action":"BUY",
                "algoStrategy":"MKT",
                "attrDesc":"",
                "avgFillPrice":9.36,
                "canCancel":false,
                "canModify":false,
                "commission":2.4,
                "currency":"USD",
                "discount":0,
                "externalId":"980",
                "filledQuantity":10,
                "id":31227598058424320,
                "identifier":"NIO.SI",
                "isOpen":true,
                "latestTime":1687146866000,
                "liquidation":false,
                "market":"SG",
                "name":"NIO Inc.",
                "openTime":1687146865000,
                "orderId":980,
                "orderType":"MKT",
                "outsideRth":false,
                "realizedPnl":0,
                "remark":"",
                "secType":"STK",
                "source":"OpenApi",
                "status":"Filled",
                "symbol":"NIO.SI",
                "timeInForce":"DAY",
                "totalQuantity":10,
                "updateTime":1687146866000,
                "userMark":""
            },
            {
                "account":"572386",
                "action":"BUY",
                "algoStrategy":"LMT",
                "attrDesc":"",
                "avgFillPrice":0,
                "canCancel":false,
                "canModify":false,
                "commission":0,
                "currency":"USD",
                "discount":0,
                "externalId":"979",
                "filledQuantity":0,
                "id":31227591745209344,
                "identifier":"NIO.SI",
                "isOpen":true,
                "latestTime":1687146817000,
                "limitPrice":2,
                "liquidation":false,
                "market":"SG",
                "name":"NIO Inc.",
                "openTime":1687146817000,
                "orderId":979,
                "orderType":"LMT",
                "outsideRth":true,
                "realizedPnl":0,
                "remark":"Order Price exceed max price step (30) limit. For more information, please contact customer service at 400-603-7555.",
                "secType":"STK",
                "source":"OpenApi",
                "status":"Invalid",
                "symbol":"NIO.SI",
                "timeInForce":"DAY",
                "totalQuantity":10,
                "updateTime":1687146817000,
                "userMark":""
            },
            {
                "account":"572386",
                "action":"BUY",
                "algoStrategy":"LMT",
                "attrDesc":"",
                "avgFillPrice":0,
                "canCancel":false,
                "canModify":false,
                "commission":0,
                "currency":"USD",
                "discount":0,
                "externalId":"978",
                "filledQuantity":0,
                "id":31227575457809408,
                "identifier":"NIO.SI",
                "isOpen":true,
                "latestTime":1687146693000,
                "limitPrice":9,
                "liquidation":false,
                "market":"SG",
                "name":"NIO Inc.",
                "openTime":1687146693000,
                "orderId":978,
                "orderType":"LMT",
                "outsideRth":true,
                "realizedPnl":0,
                "remark":"Order Price exceed max price step (30) limit. For more information, please contact customer service at 400-603-7555.",
                "secType":"STK",
                "source":"OpenApi",
                "status":"Invalid",
                "symbol":"NIO.SI",
                "timeInForce":"DAY",
                "totalQuantity":10,
                "updateTime":1687146693000,
                "userMark":""
            },
            {
                "account":"572386",
                "action":"BUY",
                "algoStrategy":"LMT",
                "attrDesc":"",
                "avgFillPrice":0,
                "canCancel":false,
                "canModify":false,
                "commission":0,
                "currency":"USD",
                "discount":0,
                "externalId":"977",
                "filledQuantity":0,
                "id":31175091790938112,
                "identifier":"JD",
                "isOpen":true,
                "latestTime":1686788253000,
                "limitPrice":35,
                "liquidation":false,
                "market":"US",
                "name":"JD.com",
                "openTime":1686746274000,
                "orderId":977,
                "orderType":"LMT",
                "outsideRth":true,
                "realizedPnl":0,
                "remark":"Order is expired",
                "secType":"STK",
                "source":"OpenApi",
                "status":"Inactive",
                "symbol":"JD",
                "timeInForce":"DAY",
                "totalQuantity":1,
                "updateTime":1686788253000,
                "userMark":""
            },
            {
                "account":"572386",
                "action":"BUY",
                "algoStrategy":"LMT",
                "attrDesc":"",
                "avgFillPrice":0,
                "canCancel":false,
                "canModify":false,
                "commission":0,
                "currency":"USD",
                "discount":0,
                "externalId":"976",
                "filledQuantity":0,
                "id":31175084828133376,
                "identifier":"JD",
                "isOpen":true,
                "latestTime":1686788253000,
                "limitPrice":35.9,
                "liquidation":false,
                "market":"US",
                "name":"JD.com",
                "openTime":1686746221000,
                "orderId":976,
                "orderType":"LMT",
                "outsideRth":true,
                "realizedPnl":0,
                "remark":"Order is expired",
                "secType":"STK",
                "source":"OpenApi",
                "status":"Inactive",
                "symbol":"JD",
                "timeInForce":"DAY",
                "totalQuantity":1,
                "updateTime":1686788253000,
                "userMark":""
            }
        ],
        "nextPageToken":"b3JkZXJzfDE2ODAzMjE2MDAwMDB8MTY4NzMxOTk5OTAwMHwzMTE3NTA4NDgyODEzMzM3Ng=="
    },
    "message":"success",
    "sign":"u59vLeh+5Wvim9SwxaW16k9nvTXfnSkZqPqUcq0p0CBtfXQNUFk4nxJXXA6jKXF2RcdfzZn+lkODMpxiI8dGC2bi+/4MoqpnkWGQFAlur/YCSSgTG+TUv1p2mfwZ2CLpKzzNaDk1NEcni+AX1JBeWJeo0GS6bgo8ic22hdS5BLE=",
    "success":true,
    "timestamp":1687251914180
}

Rate Limit

The base rate limit is 120 requests/min.


Get Filled Orders List

Request class: QueryOrderRequest(MethodName.FILLED_ORDERS)

Description

Get list of orders with filled status

Parameters

Refer to Get Orders. start_date and end_date are required, and the maximum range is 90 days.

Example

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
QueryOrderRequest request = new QueryOrderRequest(MethodName.FILLED_ORDERS);

String bizContent = AccountParamBuilder.instance()
        .account("402901")
        .secType(SecType.STK)
        .startDate("2023-05-15 22:34:30")
        .endDate("2023-06-06 22:34:31")
        .buildJson();

request.setBizContent(bizContent);
BatchOrderResponse response = client.execute(request);

Response

Refer to Get Orders

Rate Limit

The base rate limit is 120 requests/min.


Get Active Orders List

Request class: QueryOrderRequest(MethodName.ACTIVE_ORDERS)

Parameters

Refer to Get Orders; the result may include partially filled orders. Omitting the start time adds no start_date filter.

Example

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
QueryOrderRequest request = new QueryOrderRequest(MethodName.ACTIVE_ORDERS);

String bizContent = AccountParamBuilder.instance()
        .account("DU000001")
        .secType(SecType.STK)
        .buildJson();

request.setBizContent(bizContent);
BatchOrderResponse response = client.execute(request);

Response

Refer to Get Orders

Rate Limit

The base rate limit is 120 requests/min.


Get Inactive Orders List

Request class: QueryOrderRequest(MethodName.INACTIVE_ORDERS)

Parameters

Refer to Get Orders. Omitting the start time adds no start_date filter.

Example

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
QueryOrderRequest request = new QueryOrderRequest(MethodName.INACTIVE_ORDERS);

String bizContent = AccountParamBuilder.instance()
        .account("DU000001")
        .secType(SecType.STK)
        .buildJson();

request.setBizContent(bizContent);
BatchOrderResponse response = client.execute(request);

Response

Refer to Get Orders

Rate Limit

The base rate limit is 120 requests/min.


Get Transaction Records

Request class: TigerHttpRequest(MethodName.ORDER_TRANSACTIONS)

Description

Get transaction records of orders

Parameters

ParameterTypeRequiredDescription
accountStringYesAccount; Prime and paper accounts are supported
order_idlongNoGlobal order ID returned after successful order placement, not the local order ID. Supply it to query by order; limit and page_token still apply
symbolStringSee noteSymbol; provide it with sec_type when filtering by instrument
sec_typeStringNoSTK: Stocks, FUT: Futures, OPT: Options, WAR: Warrants, IOPT: Bull/Bear Certificates, CC: Cryptocurrency. Recommended for contract filtering. FUT also requires a valid futures symbol; other types may be filtered by sec_type alone
expiryStringNo, required when sec_type is OPT/WAR/IOPT and symbol is suppliedExpiry date
rightStringNo, required when sec_type is OPT/WAR/IOPT and symbol is suppliedCALL/PUT
strikedoubleNo, required when sec_type is OPT/WAR/IOPT and symbol is suppliedStrike price when querying an option, warrant, or CBBC by symbol
start_datelongNoStart timestamp in milliseconds. The request builder also accepts a formatted date-time string and converts it to milliseconds
end_datelongNoEnd timestamp in milliseconds
since_datestrNoStart date; accepted formats are yyyyMMdd, yyyy-MM-dd, and yyyy/MM/dd
to_datestrNoEnd date; accepted formats are yyyyMMdd, yyyy-MM-dd, and yyyy/MM/dd
limitintNoLimit on number of returned data, default 20, maximum 100
secret_keyStringNoTrader secret key, for institutional users only
page_tokenStringNoPagination query token, when using this field for pagination, other query conditions cannot be changed

The main accepted combinations are order_id; sec_type alone except for FUT; or sec_type plus symbol. Do not send symbol alone: that combination passes parameter validation, but the server does not apply it as a filter. OPT/WAR/IOPT symbol queries also require expiry, strike, and right. Every combination supports limit and page_token; keep all query conditions unchanged while paging.

Response

The response data is a wrapper containing items and nextPageToken; nextPageToken belongs to the wrapper rather than each transaction item.

Wrapper FieldExampleDescription
itemsTransaction record list
nextPageTokenxxxxxxToken for querying the next page
FieldExampleDescription
id24653027221308416Transaction record ID
accountId402190Account
orderId24637316162520064Order ID
secTypeSTKSecurity type
symbolCIISymbol
currencyUSDCurrency
marketUSMarket
actionBUYAction, BUY/SELL
filledQuantity100Filled quantity
filledQuantityScale0Quantity scale. The offset of the filled quantity, defaulting to 0. The filledQuantity and filledQuantityScale are combined to represent an order quantity. For example, if qty=111 and scale=2, then the actual qty=111*10^(-2)=1.11
filledPrice21Filled price
filledAmount2167.0Filled amount
transactedAt2021-11-15 22:34:30Transaction time
transactionTime1636986870000Transaction timestamp

Example

// Query by symbol
TigerHttpRequest request = new TigerHttpRequest(MethodName.ORDER_TRANSACTIONS);
String bizContent = AccountParamBuilder.instance()
    .account("402501")
    .secType(SecType.STK)
    .symbol("CII")
    .limit(30)
    .startDate("2021-11-15 22:34:30")
    .endDate("2021-11-15 22:34:31")
    .buildJson();
request.setBizContent(bizContent);
TigerHttpResponse response = client.execute(request);

JSONArray data = JSON.parseObject(response.getData()).getJSONArray("items");
JSONObject trans1 = data.getJSONObject(0);
 

// Query by orderId
request = new TigerHttpRequest(MethodName.ORDER_TRANSACTIONS);
bizContent = AccountParamBuilder.instance()
        .account("402501")
        .orderId(24637316162520064L)
        .limit(30)
        .buildJson();
request.setBizContent(bizContent);
response = client.execute(request);

data = JSON.parseObject(response.getData()).getJSONArray("items");
trans1 = data.getJSONObject(0);

Using pageToken for paginated transaction record retrieval

List<JSONObject> results = new ArrayList<>();
int page = 1;
String pageToken = "";

// Build query parameters
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
long startTime = sdf.parse("2023-01-01").getTime();
long endTime = sdf.parse("2025-08-01").getTime();

while (true) {
    TigerHttpRequest request = new TigerHttpRequest(MethodName.ORDER_TRANSACTIONS);
    String bizContent = AccountParamBuilder.instance()
        .account("402501")
        .secType(SecType.STK)
        .startDate(String.valueOf(startTime))
        .endDate(String.valueOf(endTime))
        .limit(10)
        .pageToken(pageToken)
        .buildJson();
    request.setBizContent(bizContent);
    TigerHttpResponse response = client.execute(request);

    JSONObject responseData = JSON.parseObject(response.getData());
    JSONArray items = responseData.getJSONArray("items");
    
    System.out.println("page " + page + ", size " + items.size() + 
        ", next_page_token: " + responseData.getString("nextPageToken"));
    page++;

    if (items != null && !items.isEmpty()) {
        for (int i = 0; i < items.size(); i++) {
            results.add(items.getJSONObject(i));
        }
    }

    pageToken = responseData.getString("nextPageToken");
    if (StringUtils.isEmpty(pageToken)) {
        break;
    }
}

System.out.println("total: " + results.size() + ", results: " + results);

Example Response

{
  "items": [
    {
      "id": 24653027221308416,
      "accountId": 402901,
      "orderId": 24637316162520064,
      "secType": "STK",
      "symbol": "CII",
      "currency": "USD",
      "market": "US",
      "action": "BUY",
      "filledQuantity": 100,
      "filledQuantityScale": 0,
      "filledPrice": 21.67,
      "filledAmount": 2167,
      "transactedAt": "2021-11-15 22:34:30",
      "transactionTime": 1636986870000
    }
  ],
  "nextPageToken": "xxxxxx"
}

Rate Limit

The base rate limit is 60 requests/min.


Did this page help you?