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
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User authorized account |
| symbol | string | Conditional | Stock symbol, e.g., AAPL. A standalone contract uses symbol; a multi-leg preview identifies contracts through contract_legs |
| sec_type | string | Yes | Contract type: STK, OPT, WAR, IOPT, FUT, FUND, CC, or MLEG for multi-leg orders |
| action | string | Yes | Order side BUY/SELL |
| order_type | string | Yes | Order type MKT(market order), LMT(limit order), STP(stop order), STP_LMT(stop limit order), TRAIL(trailing stop order) |
| total_quantity | Long | Conditional | Order quantity. Required for every non-FUND order; FUND purchases may omit it |
| limit_price | double | No | Limit price, required when order_type is LMT or STP_LMT; not required for STP |
| aux_price | double | No | Stop trigger price for STP/STP_LMT; trailing amount for TRAIL. If both trailing fields are supplied, trailing_percent takes precedence |
| trailing_percent | double | No | Trailing percentage for TRAIL; takes precedence over aux_price when both are supplied |
| outside_rth | boolean | No | true: Allow pre-market and after-hours trading (US stocks only), false: Not allowed, default allows |
| market | string | No | Market (US stocks US, HK stocks HK, Shanghai-HK Stock Connect CN) |
| currency | string | No | Currency (US stocks USD, HK stocks HKD, Shanghai-HK Stock Connect CNH) |
| time_in_force | string | No | Time in force: DAY, GTC, GTD, or OPG. When omitted, ordinary orders default to DAY; CC and FUND orders use GTC |
| exchange | string | No | Exchange (US stocks SMART, HK stocks SEHK, Shanghai-HK Stock Connect SEHKNTL, Shenzhen-HK Stock Connect SEHKSZSE) |
| expiry | string | No | Expiry date (options, warrants, bull/bear certificates only) |
| strike | string | No | Strike price (options, warrants, bull/bear certificates only) |
| right | string | No | Option right PUT/CALL (options, warrants, bull/bear certificates only) |
| multiplier | float | No | Multiplier, quantity per lot (options, warrants, bull/bear certificates only) |
| local_symbol | string | No | Required 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_scale | int | No | Quantity scale for fractional shares |
| cash_amount | Double | No | Amount-based order amount. FUND purchases are supported; the current SDK does not support stock amount orders |
| adjust_limit | double | No | Price adjustment range; default is 0 |
| trading_session_type | TradingSessionType | No | PRE_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_time | long | No | GTD expiration timestamp in milliseconds |
| alloc_accounts | List<String> | No | Global 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_shares | List<Double> | No | Global accounts only Must be supplied with alloc_accounts; each value must be positive and both lists must have the same length |
| algo_strategy | string | No | Algorithm strategy name |
| algo_params | List<TagValue> | No | Algorithm parameters |
| display_size | Integer | No | Iceberg 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_size | Integer | No | Iceberg minimum display quantity; applicability and Java usage limitations are the same as for display_size |
| check_intervals | Integer | No | Iceberg price-check interval in seconds; applicability and Java usage limitations are the same as for display_size |
| price_type | string | No | Iceberg price type; applicability and Java usage limitations are the same as for display_size |
| start_time | Long | No | Iceberg effective start time in milliseconds; applicability and Java usage limitations are the same as for display_size |
| end_time | Long | No | Iceberg effective end time in milliseconds; applicability and Java usage limitations are the same as for display_size |
| combo_type | string | No | Multi-leg combination type |
| contract_legs | List<ContractLeg> | No | Multi-leg definitions |
| secret_key | string | No | Trader secret key, for institutional users only |
| user_mark | string | No | Order comment. Trimming, length normalization, and return behavior are account-dependent. Prime accounts trim surrounding whitespace and retain at most the first 200 characters |
| order_id | int | No | Order ID |
| source | string | No | Order source identifier |
| attach_type | string | No | Attached-order type; attached-order preview is not supported |
| profit_taker_orderId | int | No | Attached profit-taker order ID; attached-order preview is not supported |
| profit_taker_price | double | No | Attached profit-taker price; attached-order preview is not supported |
| profit_taker_tif | string | No | Attached profit-taker time in force; attached-order preview is not supported |
| profit_taker_rth | boolean | No | Whether the attached profit-taker allows extended hours; attached-order preview is not supported |
| stop_loss_order_type | string | No | Attached stop-loss order type; attached-order preview is not supported |
| stop_loss_orderId | int | No | Attached stop-loss order ID; attached-order preview is not supported |
| stop_loss_price | double | No | Attached stop-loss trigger price; attached-order preview is not supported |
| stop_loss_limit_price | double | No | Attached stop-loss limit price; attached-order preview is not supported |
| stop_loss_tif | string | No | Attached stop-loss time in force; attached-order preview is not supported |
| stop_loss_trailing_percent | double | No | Attached trailing-stop percentage; attached-order preview is not supported |
| stop_loss_trailing_amount | double | No | Attached trailing-stop amount; attached-order preview is not supported |
| oca_orders | List<TradeOrderModel> | No | OCA order list; OCA preview is not supported |
Response
| Field | Type | Description |
|---|---|---|
| account | String | Account ID |
| initMargin | Double | Initial margin assuming the order is filled |
| maintMargin | Double | Maintenance margin assuming the order is filled |
| equityWithLoan | Double | Equity with loan assuming the order is filled |
| initMarginBefore | Double | Initial margin before the hypothetical fill |
| maintMarginBefore | Double | Maintenance margin before the hypothetical fill |
| equityWithLoanBefore | Double | Equity with loan before the hypothetical fill |
| marginCurrency | String | Currency of the asset and margin preview values |
| commission | Double | Estimated commission; currency is commissionCurrency |
| gst | Double | Estimated goods and services tax; currency is commissionCurrency |
| commissionCurrency | String | Currency of the estimated commission and GST |
| availableEE | Double | Available excess equity assuming the order is filled, in marginCurrency |
| excessLiquidity | Double | Excess liquidity assuming the order is filled, in marginCurrency |
| overnightLiquidation | Double | Overnight excess liquidity assuming the order is filled, in marginCurrency |
| isPass | Boolean | Whether the order passes the pre-order check |
| message | String | Error reason when the check does not pass |
| status | String | Preview status |
| minCommission | Double | Estimated minimum commission |
| maxCommission | Double | Estimated maximum commission |
| maxOrderSize | Double | Maximum order quantity indicated by the preview |
| warningText | String | Warning 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User authorized account: 572386 |
| id | int | Yes | Order number returned after successful order placement |
| secret_key | string | No | Trader secret key, for institutional users only |
| show_charges | bool | No | Whether to return order fee details |
Get order list
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User authorized account: 572386 |
| seg_type | SegmentType | No | Account 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_type | string | No | ALL/STK/OPT/FUT/FOP/CASH default ALL |
| market | string | No | ALL/US/HK/CN default ALL |
| symbol | string | No | Stock symbol |
| expiry | string | No | Expiry date (options, warrants, bull/bear certificates only) |
| strike | string | No | Strike price (options, warrants, bull/bear certificates only) |
| right | string | No | Option right PUT/CALL (options, warrants, bull/bear certificates only) |
| start_date | string | No | Start 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_date | string | No | End 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) |
| states | array | No | Order-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 |
| isBrief | boolean | No | Only supports global accounts Whether to return simplified order information |
| limit | integer | No | Default is 100, maximum limit is 300 |
| sort_by | OrderSortBy | No | Omnibus 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_key | string | No | Trader secret key, for institutional users only |
| lang | string | No | Language support (Language enum): zh_CN, zh_TW, en_US, default: en_US |
| page_token | string | No | Pagination 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.
| Field | Type | Description |
|---|---|---|
| nextPageToken | string | Token for querying the next page |
| items | array | Order array, refer to field descriptions below |
Order data items properties:
| Name | Example | Description |
|---|---|---|
| id | 27363676799501312 | Global unique order ID, returned after successful order placement |
| orderId | 830154374 | User local auto-increment order ID, not globally unique |
| externalId | 830154374 | Extended ID, for API orders it's the orderId value |
| parentId | 0 | Parent order's order ID |
| account | 572386 | Trading account |
| action | BUY | Order side, BUY or SELL |
| orderType | LMT | Order type |
| limitPrice | 108.62 | Limit order price |
| auxPrice | 0.0 | Stop order auxiliary price - trailing amount |
| trailingPercent | 5 | Trailing stop order trailing percentage |
| totalQuantity | 111 | Order quantity |
| totalQuantityScale | 0 | Order quantity offset, default 0. For fractional shares, totalQuantity and totalQuantityScale combined represent real order quantity |
| timeInForce | DAY | DAY/GTC/GTD/OPG |
| expireTime | 1669000183188 | Only has value when timeInForce is GTD |
| outsideRth | true | Whether to allow pre-market and after-hours trading |
| filledQuantity | 50 | Filled quantity |
| filledQuantityScale | 0 | Filled quantity offset |
| totalCashAmount | 100 | Total amount for an amount-based order; may be absent for a quantity-based order |
| filledCashAmount | 100 | Filled amount for an amount-based order; may be absent or zero for a quantity-based order |
| refundCashAmount | 0 | Refund amount, equals total order amount minus filled amount |
| avgFillPrice | 108.62 | Volume-weighted average of fill prices, excluding commissions and other fees; fees are returned separately. Returns 0 when no average fill price is available |
| remark | Order is expired | Error description |
| status | Filled | Order status, reference: Order Status |
| attrDesc | Exercise | Order description information, reference: Order Description |
| commission | 0.99 | Commission and related fees |
| commissionCurrency | USD | Commission currency |
| gst | 1.34 | Goods and services tax |
| realizedPnl | 0.0 | FIFO 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. |
| openTime | 1657667486000 | Order placement time |
| updateTime | 1657670428000 | Last update time |
| latestTime | 1657670428000 | Status update time |
| name | Alibaba | Contract name |
| symbol | BABA | Stock symbol |
| identifier | BABA | Contract identifier |
| currency | USD | Currency |
| market | US | Trading market |
| expiry | 20251219 | Expiry for options, warrants, CBBCs, and futures |
| strike | 200 | Strike price for options, warrants, and CBBCs |
| right | CALL | Option right |
| multiplier | 0.0 | Multiplier, quantity per lot |
| secType | STK | Trading type |
| userMark | my_strategy_1 | Order remark parameter, returns the set value, length cannot exceed 200 |
| canModify | false | Whether the order can be modified |
| canCancel | false | Whether the order can be canceled |
| liquidation | false | Whether it's forced liquidation |
| isOpen | true | Whether it's an opening position |
| latestPrice | 108.62 | Latest market price when returned |
| tradingSessionType | RTH | Trading session type |
| source | OpenApi | Order source |
| discount | 0 | Discount indicator |
| replaceStatus | NONE | Order Replace Status |
| cancelStatus | NONE | Order Cancel Status |
| charges | Order commission and fee details (single order query only) | |
| commissionDiscountAmount | 0 | Commission discount amount (single order query only) |
| orderDiscountAmount | 0 | Order deduction amount |
| orderDiscount | 0 | Order 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 |
| displaySize | 100 | Iceberg order display quantity |
| minDisplaySize | 50 | Iceberg order minimum display quantity |
| checkIntervals | 30 | Iceberg order price-check interval in seconds |
| priceType | LIMIT_PRICE | Iceberg order price type |
| cashQuantity | 100 | Legacy amount-order field; use fields such as totalCashAmount for current amount-order information |
| lastFillPrice | 108.62 | Price of the latest fill |
| goodTillDate | 2025-12-31 | Good-till date when returned |
| triggerStatus | Triggered | Trigger status for conditional orders |
| ocaGroupId | 87055 | OCA group ID |
| comboLegs | Multi-leg order description | |
| allocAccounts | Allocation sub-account list for Global-account orders | |
| allocShares | Quantity allocated to each corresponding sub-account | |
| algoStrategy | TWAP | Algorithm strategy |
| algoParameters | Algorithm parameter list | |
| comboType | CUSTOM | Multi-leg combination type |
| comboTypeDesc | Multi-leg combination description | |
| legs | Multi-leg order details | |
| startTime | 1687271400000 | Iceberg effective start time |
| endTime | 1687294800000 | Iceberg effective end time |
Charge Description:
| Name | Example | Description |
|---|---|---|
| category | TIGER | Fee category: TIGER/THIRD_PARTY |
| categoryDesc | Tiger Charge | Fee category description |
| total | 18 | Total fee for current category |
| details | Fee details. See ChargeDetails below |
ChargeDetails Description:
| Name | Example | Description |
|---|---|---|
| type | SETTLEMENT_FEE | Fee type: SETTLEMENT_FEE/STAMP_DUTY/TRANSACTION_LEVY/EXCHANGE_FEE/FRC_TRANSACTION_LEVY |
| typeDesc | Settlement Fee | Fee type description |
| originalAmount | 4 | Fee amount |
| afterDiscountAmount | 4 | Fee 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | String | Yes | Account; Prime and paper accounts are supported |
| order_id | long | No | Global order ID returned after successful order placement, not the local order ID. Supply it to query by order; limit and page_token still apply |
| symbol | String | See note | Symbol; provide it with sec_type when filtering by instrument |
| sec_type | String | No | STK: 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 |
| expiry | String | No, required when sec_type is OPT/WAR/IOPT and symbol is supplied | Expiry date |
| right | String | No, required when sec_type is OPT/WAR/IOPT and symbol is supplied | CALL/PUT |
| strike | double | No, required when sec_type is OPT/WAR/IOPT and symbol is supplied | Strike price when querying an option, warrant, or CBBC by symbol |
| start_date | long | No | Start timestamp in milliseconds. The request builder also accepts a formatted date-time string and converts it to milliseconds |
| end_date | long | No | End timestamp in milliseconds |
| since_date | str | No | Start date; accepted formats are yyyyMMdd, yyyy-MM-dd, and yyyy/MM/dd |
| to_date | str | No | End date; accepted formats are yyyyMMdd, yyyy-MM-dd, and yyyy/MM/dd |
| limit | int | No | Limit on number of returned data, default 20, maximum 100 |
| secret_key | String | No | Trader secret key, for institutional users only |
| page_token | String | No | Pagination 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 Field | Example | Description |
|---|---|---|
| items | Transaction record list | |
| nextPageToken | xxxxxx | Token for querying the next page |
| Field | Example | Description |
|---|---|---|
| id | 24653027221308416 | Transaction record ID |
| accountId | 402190 | Account |
| orderId | 24637316162520064 | Order ID |
| secType | STK | Security type |
| symbol | CII | Symbol |
| currency | USD | Currency |
| market | US | Market |
| action | BUY | Action, BUY/SELL |
| filledQuantity | 100 | Filled quantity |
| filledQuantityScale | 0 | Quantity 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 |
| filledPrice | 21 | Filled price |
| filledAmount | 2167.0 | Filled amount |
| transactedAt | 2021-11-15 22:34:30 | Transaction time |
| transactionTime | 1636986870000 | Transaction 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.
Updated 28 days ago
