Order Queries

Get Order

Signature

pub async fn get_order(&self, req: GetOrderRequest) -> Result<Option<Order>, TigerError>

Description

Get details of a single order by ID.

Parameters

ParameterTypeRequiredDescription
req.accountOption<String>NoAccount (auto-injected if omitted)
req.idOption<i64>ConditionalGlobal order ID (provide id or order_id)
req.order_idOption<i64>ConditionalOrder number (provide id or order_id)
req.is_briefOption<bool>NoBrief mode

Response

Result<Option<Order>, TigerError>

FieldTypeDescription
idi64Global order ID
order_idi64Order number
accountStringAccount
symbolStringSymbol
sec_typeStringSecurity type
actionStringBUY/SELL
order_typeStringMKT/LMT/STP/STP_LMT/TRAIL
total_quantityi64Order quantity
filled_quantityi64Filled quantity
limit_pricef64Limit price
aux_pricef64Stop/trailing price
avg_fill_pricef64Average fill price
statusStringOrder status
time_in_forceStringDAY/GTC/GTD
outside_rthboolExtended hours allowed
commissionf64Commission
realized_pnlf64Realized PnL
open_timei64Order time (ms)
update_timei64Update time (ms)
currencyStringCurrency
marketStringMarket
can_modifyboolCan modify
can_cancelboolCan cancel

Example

use tigeropen::model::trade_requests::GetOrderRequest;

let order = trade.get_order(GetOrderRequest { id: Some(31234567), ..Default::default() }).await?;
if let Some(o) = order {
    println!("{} {} {} qty={} status={}", o.symbol, o.action, o.order_type, o.total_quantity, o.status);
}

Response Example

{
  "id": 31234567,
  "order_id": 100234,
  "account": "402901",
  "symbol": "AAPL",
  "sec_type": "STK",
  "action": "BUY",
  "order_type": "LMT",
  "total_quantity": 100,
  "filled_quantity": 100,
  "limit_price": 195.50,
  "avg_fill_price": 195.48,
  "status": "Filled",
  "time_in_force": "DAY",
  "commission": 1.99,
  "currency": "USD",
  "market": "US"
}

Get Orders

Signature

pub async fn get_orders(&self, req: OrdersRequest) -> Result<Vec<Order>, TigerError>

Description

Get all orders with optional filters.

Parameters

ParameterTypeRequiredDescription
req.accountOption<String>NoAccount
req.sec_typeOption<String>NoFilter by security type
req.marketOption<String>NoFilter by market
req.symbolOption<String>NoFilter by symbol
req.start_dateOption<i64>NoStart time (13-digit ms)
req.end_dateOption<i64>NoEnd time (13-digit ms)
req.limitOption<i32>NoMax results
req.statesOption<Vec<String>>NoFilter by status
req.page_tokenOption<String>NoPagination token

Response

Same fields as Get Order.

Example

let orders = trade.get_orders(OrdersRequest { limit: Some(20), ..Default::default() }).await?;
for o in &orders {
    println!("[{}] {} {} {}", o.id, o.symbol, o.action, o.status);
}

Get Active Orders

Signature

pub async fn get_active_orders(&self, req: OrdersRequest) -> Result<Vec<Order>, TigerError>

Description

Get pending (active) orders.

Parameters

Same as Get Orders.

Example

let active = trade.get_active_orders(OrdersRequest::default()).await?;
println!("{} active orders", active.len());

Get Inactive Orders

Signature

pub async fn get_inactive_orders(&self, req: OrdersRequest) -> Result<Vec<Order>, TigerError>

Description

Get cancelled or expired orders.

Parameters

Same as Get Orders.

Example

let inactive = trade.get_inactive_orders(OrdersRequest::default()).await?;

Get Filled Orders

Signature

pub async fn get_filled_orders(&self, req: OrdersRequest) -> Result<Vec<Order>, TigerError>

Description

Get filled orders. Use start_date/end_date to filter by time range.

Parameters

Same as Get Orders.

Example

let filled = trade.get_filled_orders(OrdersRequest::default()).await?;
for o in &filled {
    println!("{} {} avg_price={} commission={}", o.symbol, o.action, o.avg_fill_price, o.commission);
}

Get Order Transactions

Signature

pub async fn get_order_transactions(&self, req: OrderTransactionsRequest) -> Result<Vec<Transaction>, TigerError>

Description

Get trade execution records.

Parameters

ParameterTypeRequiredDescription
req.accountOption<String>NoAccount
req.order_idOption<i64>NoFilter by order
req.symbolOption<String>YesSymbol
req.sec_typeOption<String>NoSecurity type
req.start_dateOption<i64>NoStart time (ms)
req.end_dateOption<i64>NoEnd time (ms)
req.limitOption<i32>NoMax results
req.page_tokenOption<String>NoPagination token

Response

Result<Vec<Transaction>, TigerError>

FieldTypeDescription
idi64Transaction ID
order_idi64Order number
accountStringAccount
symbolStringSymbol
sec_typeStringSecurity type
actionStringBUY/SELL
filled_pricef64Fill price
filled_quantityi64Fill quantity
filled_amountf64Fill amount
commissionf64Commission
transacted_atStringTransaction time
transaction_timei64Transaction timestamp (ms)

Example

use tigeropen::model::trade_requests::OrderTransactionsRequest;

let txns = trade.get_order_transactions(OrderTransactionsRequest {
    symbol: Some("AAPL".into()),
    ..Default::default()
}).await?;
for t in &txns {
    println!("{} {} price={} qty={}", t.symbol, t.action, t.filled_price, t.filled_quantity);
}

Response Example

[
  {
    "id": 987654,
    "order_id": 100234,
    "account": "402901",
    "symbol": "AAPL",
    "sec_type": "STK",
    "action": "BUY",
    "filled_price": 195.48,
    "filled_quantity": 100,
    "filled_amount": 19548.0,
    "commission": 1.99,
    "transacted_at": "2025-06-24T15:30:01Z",
    "transaction_time": 1719240601000
  }
]

Did this page help you?