中文

Get Order Information

Preview Order

Corresponding request class TradeOrderPreviewRequest

Description

Preview an order, returns whether the order can be submitted (i.e., whether the order can be executed), as well as asset information.

Parameters

ParameterTypeRequiredDescription
accountstringYesUser authorized account
symbolstringYesStock code, e.g., AAPL
sec_typestringYesContract type (STK stocks, OPT US stock options, WAR HK warrants, IOPT HK bull/bear certificates)
actionstringYesTrade direction BUY/SELL
order_typestringYesOrder type MKT(market order), LMT(limit order), STP(stop order), STP_LMT(stop limit order), TRAIL(trailing stop order)
total_quantityintYesOrder quantity (HK stocks, Shanghai-HK Stock Connect, warrants, bull/bear certificates have minimum quantity limits)
limit_pricedoubleNoLimit price, required when order_type is LMT, STP, STP_LMT
aux_pricedoubleNoStock stop price. Required when order_type is STP, STP_LMT; when order_type is TRAIL, this is the trailing amount
trailing_percentdoubleNoTrailing stop order percentage, when order_type is TRAIL, aux_price and trailing_percent are mutually exclusive
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_forcestringNoOrder validity period, can only be DAY (valid for the day) and GTC (valid until cancelled), default is DAY
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 direction 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

Response

FieldTypeDescription
accountStringAccount ID
initMarginDoubleInitial margin after placing order, does not support futures
maintMarginDoubleMaintenance margin after placing order, does not support futures
equityWithLoanDoubleLoanable assets after placing order, does not support futures
initMarginBeforeDoubleInitial margin before placing order, does not support futures
maintMarginBeforeDoubleMaintenance margin before placing order, does not support futures
equityWithLoanBeforeDoubleLoanable assets before placing order, does not support futures
marginCurrencyStringMargin currency
commissionDoubleEstimated commission
gstDoubleEstimated goods and services tax
commissionCurrencyStringEstimated commission currency
availableEeDoubleAvailable remaining assets, does not support futures
excessLiquidityDoubleExcess liquidity, does not support futures
overnightLiquidationDoubleOvernight excess liquidity, does not support futures
isPassBooleanWhether the order can be submitted
messageStringError reason for non-submittable order

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));

Response Example

{
  "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

Corresponding 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 code
expirystringNoExpiry date (options, warrants, bull/bear certificates only)
strikestringNoStrike price (options, warrants, bull/bear certificates only)
rightstringNoOption direction PUT/CALL (options, warrants, bull/bear certificates only)
start_datestringNoStart time of order placement (when sort_by=LATEST_STATUS_UPDATED, filter by order status update time), format '2018-05-01' or "2018-05-01 10:00:00" (default GMT+8, can specify timezone), closed interval
end_datestringNoEnd time of order placement (when sort_by=LATEST_STATUS_UPDATED, filter by order status update time), format '2018-05-15' or "2018-05-01 10:00:00" (default GMT+8, can specify timezone), open interval
statesarrayNoOnly supports global accounts Order status, default queries valid orders, reference: Order Status (hyperlink)
isBriefbooleanNoOnly supports global accounts Whether to return simplified order information
limitintegerNoDefault is 100, maximum limit is 300
sort_byOrderSortByNoOnly supports omnibus accounts Sort and start/end time action field, LATEST_CREATED/LATEST_STATUS_UPDATED; default: LATEST_CREATED
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

Response

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

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
actionBUYTrade direction, 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
expireTime1669000183188Only has value when timeInForce is GTD
outsideRthtrueWhether to allow pre-market and after-hours trading
filledQuantity50Filled quantity
filledQuantityScale0Filled quantity offset
totalCashAmount100Total order amount, null when ordering by shares
filledCashAmount100Filled amount, null when ordering by shares
refundCashAmount0Refund amount, equals total order amount minus filled amount
avgFillPrice108.62Average fill price including commission
remarkOrder is expiredError description
statusFilledOrder status, reference: Order Status
attrDescExerciseOrder description information, reference: Order Description
commission0.99Includes commission, stamp duty, regulatory fees, etc.
commissionCurrencyUSDCommission currency
gst1.34Goods and services tax (only for TBSG license users)
realizedPnl0.0Realized P&L
openTime1657667486000Order placement time
updateTime1657670428000Last update time
latestTime1657670428000Status update time
symbolBABAStock code
currencyUSDCurrency
marketUSTrading market
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 cancelled
liquidationfalseWhether it's forced liquidation
isOpentrueWhether it's an opening position
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 attribute list. Various attributes mean: LIQUIDATION forced liquidation, FRACTIONAL_SHARE fractional shares order, EXERCISE exercise, etc.

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.getString("symbol");
  Long id = order1.getLong("id");
  // ...
} 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);

Response Example

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
}

Get Filled Orders List

Corresponding Request Class: QueryOrderRequest(MethodName.FILLED_ORDERS)

Description

Get list of orders with filled status

Parameters

Refer to Get Orders, where start_date and end_date are required parameters.

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


Get Active Orders List

Corresponding Request Class: QueryOrderRequest(MethodName.ACTIVE_ORDERS)

Parameters

Refer to Get Orders, may include partially filled orders

Example

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

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

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

Response

Refer to Get Orders


Get Inactive Orders List

Corresponding Request Class: QueryOrderRequest(MethodName.INACTIVE_ORDERS)

Parameters

Refer to Get Orders

Example

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

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

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

Response

Refer to Get Orders


Get Transaction Records

Corresponding Request Class: TigerHttpRequest(MethodName.ORDER_TRANSACTIONS)

Description

Get transaction records of orders

Parameters

ParameterTypeRequiredDescription
accountStringYesAccount, currently only supports integrated accounts
order_idlongYesGlobal order ID returned after successful order placement, not local order ID. Either order_id or symbol is required. When using orderId, symbol parameter doesn't take effect
symbolStringYesStock symbol. Either order_id or symbol is required.
sec_typeStringNo, required when querying by symbolSTK:Stock/FUT:Futures/OPT:Options/WAR:Warrants/IOPT:Bull/Bear Certificates, query all if not specified.
expiryStringNo, required when sect_type is OPT/WAR/IOPTExpiry date
rightStringNo, required when sect_type is OPT/WAR/IOPTCALL/PUT
start_datelongNoStart time (yyyy-MM-dd HH-mm-ss format needs to be converted to millisecond timestamp)
end_datelongNoEnd time (yyyy-MM-dd HH-mm-ss format needs to be converted to millisecond timestamp)
limitintNoLimit on number of returned data, default 20, maximum 100
secretKeyStringNoTrader secret key, for institutional users only
page_tokenStringNoPagination query token, when using this field for pagination, other query conditions cannot be changed

Response

FieldExampleDescription
id24653027221308416Transaction record ID
accountId402190Account
orderId24637316162520064Order ID
secTypeSTKSecurity type
symbolCIISymbol
currencyUSDCurrency
marketUSMarket
actionBUYAction, BUY/SELL
filledQuantity100Filled quantity
filledPrice21Filled price
filledAmount2167.0Filled amount
transactedAt2021-11-15 22:34:30Transaction time
transactionTime1636986870000Transaction timestamp
nextPageTokenxxxxxxNext page token

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
TigerHttpRequest request = new TigerHttpRequest(MethodName.ORDER_TRANSACTIONS);
    String bizContent = AccountParamBuilder.instance()
        .account("402501")
        .orderId(24637316162520064L)
        .limit(30)
        .buildJson();
request.setBizContent(bizContent);
TigerHttpResponse response = client.execute(request);

JSONArray data = JSON.parseObject(response.getData()).getJSONArray("items");
JSONObject 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);

Response Example

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