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
| Parameter | Type | Required | Description |
|---|---|---|---|
| req.account | Option<String> | No | Account (auto-injected if omitted) |
| req.id | Option<i64> | Conditional | Global order ID (provide id or order_id) |
| req.order_id | Option<i64> | Conditional | Order number (provide id or order_id) |
| req.is_brief | Option<bool> | No | Brief mode |
Response
Result<Option<Order>, TigerError>
| Field | Type | Description |
|---|---|---|
| id | i64 | Global order ID |
| order_id | i64 | Order number |
| account | String | Account |
| symbol | String | Symbol |
| sec_type | String | Security type |
| action | String | BUY/SELL |
| order_type | String | MKT/LMT/STP/STP_LMT/TRAIL |
| total_quantity | i64 | Order quantity |
| filled_quantity | i64 | Filled quantity |
| limit_price | f64 | Limit price |
| aux_price | f64 | Stop/trailing price |
| avg_fill_price | f64 | Average fill price |
| status | String | Order status |
| time_in_force | String | DAY/GTC/GTD |
| outside_rth | bool | Extended hours allowed |
| commission | f64 | Commission |
| realized_pnl | f64 | Realized PnL |
| open_time | i64 | Order time (ms) |
| update_time | i64 | Update time (ms) |
| currency | String | Currency |
| market | String | Market |
| can_modify | bool | Can modify |
| can_cancel | bool | Can 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| req.account | Option<String> | No | Account |
| req.sec_type | Option<String> | No | Filter by security type |
| req.market | Option<String> | No | Filter by market |
| req.symbol | Option<String> | No | Filter by symbol |
| req.start_date | Option<i64> | No | Start time (13-digit ms) |
| req.end_date | Option<i64> | No | End time (13-digit ms) |
| req.limit | Option<i32> | No | Max results |
| req.states | Option<Vec<String>> | No | Filter by status |
| req.page_token | Option<String> | No | Pagination 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| req.account | Option<String> | No | Account |
| req.order_id | Option<i64> | No | Filter by order |
| req.symbol | Option<String> | Yes | Symbol |
| req.sec_type | Option<String> | No | Security type |
| req.start_date | Option<i64> | No | Start time (ms) |
| req.end_date | Option<i64> | No | End time (ms) |
| req.limit | Option<i32> | No | Max results |
| req.page_token | Option<String> | No | Pagination token |
Response
Result<Vec<Transaction>, TigerError>
| Field | Type | Description |
|---|---|---|
| id | i64 | Transaction ID |
| order_id | i64 | Order number |
| account | String | Account |
| symbol | String | Symbol |
| sec_type | String | Security type |
| action | String | BUY/SELL |
| filled_price | f64 | Fill price |
| filled_quantity | i64 | Fill quantity |
| filled_amount | f64 | Fill amount |
| commission | f64 | Commission |
| transacted_at | String | Transaction time |
| transaction_time | i64 | Transaction 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
}
]Updated 1 day ago
Did this page help you?
