OrdersService
Get Order History
Retrieve terminal order history for an account. Supports optional subaccount, trigger, symbol, side, status, and time-range filters with cursor pagination.
Request
curl --request GET \ \ --url 'https://api.testnet.polyester.com/v1/orders/history?endTime=1735689600000000000&includeAttachedRisk=false&includeAttachedRiskState=false&limit=100&pageToken=eyJvZmZzZXQiOjEwMH0&side=BUY&startTime=1735689600000000000&status=PENDING&subaccountId=6789012345678&symbol=BTC-USDT&triggerId=9155001234567' \ --header 'Accept: */*' \ --header 'X-API-KEY-ID: YOUR_API_KEY_ID' \ --header 'X-API-TIMESTAMP: YOUR_API_TIMESTAMP' \ --header 'X-API-SIGNATURE: YOUR_API_SIGNATURE'
Responses
{
"nextPageToken": "eyJvZmZzZXQiOjIwMH0",
"orders": [
{
"attachedRisk": {
"oco": false,
"stopLoss": {
"policy": {
"child": {},
"triggerPrice": "0.005"
},
"state": {
"armedAt": "2025-01-01T00:00:00Z",
"childOrderId": "5USXJZmk",
"status": "NOT_CONFIGURED",
"terminalAt": "2025-01-01T00:00:00Z",
"triggerId": "59VD7Lar"
}
},
"takeProfit": {
"policy": {
"child": {},
"triggerPrice": "0.005"
},
"state": {
"armedAt": "2025-01-01T00:00:00Z",
"childOrderId": "5USXJZmk",
"status": "NOT_CONFIGURED",
"terminalAt": "2025-01-01T00:00:00Z",
"triggerId": "59VD7Lar"
}
},
"trailingStop": {
"policy": {
"activationPrice": "0.005",
"maxSlippageTicks": 1,
"trailingDistanceTicks": "0.000000001"
},
"state": {
"armedAt": "2025-01-01T00:00:00Z",
"childOrderId": "5USXJZmk",
"status": "NOT_CONFIGURED",
"terminalAt": "2025-01-01T00:00:00Z",
"triggerId": "59VD7Lar"
}
}
},
"avgPx": "0.005",
"batchRequestId": "2",
"clientOrderId": "cli-ord-20250101-001",
"createdAt": "2025-01-01T00:00:00Z",
"cumQty": "100000",
"expireAt": "2025-01-01T00:00:00Z",
"feeAsset": "QUOTE",
"inheritedCumQty": "100000",
"leavesQty": "100000",
"lineage": {
"generation": 1,
"id": "2"
},
"marketClientRefPrice": "0.005",
"marketMaxSlippageBps": 1,
"marketMaxSlippageTicks": 1,
"orderId": "5USXJZmk",
"orderType": "LIMIT",
"origQty": "100000",
"origin": {
"childSeq": 1,
"parentOrderId": "5USXJZmk",
"scope": "DIRECT",
"triggerId": "59VD7Lar",
"triggerType": "STOP_LOSS"
},
"postOnly": false,
"price": "0.005",
"side": "BUY",
"status": "PENDING",
"stpMode": "EXPIRE_MAKER",
"submittedMaxQuoteDebit": "1",
"symbol": "BTC-USDT",
"terminalAt": "2025-01-01T00:00:00Z",
"terminalReason": "USER_REQUEST",
"terminalReasonCode": 1,
"tif": "GTC",
"version": 1
}
]
}RFC3339 timestamp (nanosecond precision supported)
Include attached-risk policy fields in each order. Defaults to false when omitted.
Include attached-risk state fields in each order. Defaults to false when omitted.
RFC3339 timestamp (nanosecond precision supported)
OrderStatus enum name (e.g. FILLED, CANCELED)
Filter by symbol(s): use repeated params (?symbol=BTC-USDT&symbol=ETH-USDT) or comma-separated values.
Filter by trigger public ID (base58).
Opaque cursor for the next page. Empty when no more results exist.
eyJvZmZzZXQiOjIwMH0True when the take-profit and stop leg are linked as one-cancels-the-other.
falseLimit price in quote units scaled by 1e9.
Market child with implicit IOC behavior.
Trigger price in quote units scaled by 1e9.
0.005Time the leg was armed, in nanoseconds since epoch (UTC). Zero if not armed.
2025-01-01T00:00:00ZChild order ID created by this leg after it fires.
5USXJZmkCurrent runtime lifecycle status for this attached-risk leg.
NOT_CONFIGUREDTime the leg reached a terminal state, in nanoseconds since epoch (UTC). Zero if not terminal.
2025-01-01T00:00:00ZTrigger identifier for this attached-risk leg.
59VD7LarLimit price in quote units scaled by 1e9.
Market child with implicit IOC behavior.
Trigger price in quote units scaled by 1e9.
0.005Time the leg was armed, in nanoseconds since epoch (UTC). Zero if not armed.
2025-01-01T00:00:00ZChild order ID created by this leg after it fires.
5USXJZmkCurrent runtime lifecycle status for this attached-risk leg.
NOT_CONFIGUREDTime the leg reached a terminal state, in nanoseconds since epoch (UTC). Zero if not terminal.
2025-01-01T00:00:00ZTrigger identifier for this attached-risk leg.
59VD7LarOptional activation price: trailing only starts after this price is reached. If omitted, trailing starts immediately after the parent order fills. Expressed in quote units scaled by 1e9.
0.005Maximum allowed slippage in basis points (1 bp = 0.01%).
Positive maximum absolute price delta in Q9 execution-price ticks (1 tick = 1e-9 quote units).
1Trailing distance in basis points (1 bp = 0.01%).
Trailing distance as a price delta in 1e-9 quote-unit ticks.
0.000000001Time the leg was armed, in nanoseconds since epoch (UTC). Zero if not armed.
2025-01-01T00:00:00ZChild order ID created by this leg after it fires.
5USXJZmkCurrent runtime lifecycle status for this attached-risk leg.
NOT_CONFIGUREDTime the leg reached a terminal state, in nanoseconds since epoch (UTC). Zero if not terminal.
2025-01-01T00:00:00ZTrigger identifier for this attached-risk leg.
59VD7LarAverage execution price across the lineage through this generation, in quote units scaled by 1e9. Zero if no fills.
0.005Batch-replace identity that admitted this order. Zero for other origins.
2Client-provided, account-scoped identifier for correlation, lookup, and cancellation. Empty when none was supplied.
cli-ord-20250101-001Creation timestamp in nanoseconds since epoch (UTC).
2025-01-01T00:00:00ZCumulative filled quantity across the lineage through this generation, scaled by the pair's base_quantity_scale from GetSpotConfig for symbol_id.
100000Exact UTC expiry time for GTD orders, within the supported signed Unix-nanosecond range from 1677-09-21T00:12:43.145224193Z through 2262-04-11T23:47:16.854775807Z. Omitted for all other time-in-force policies. The order cannot execute when the current time equals this value.
2025-01-01T00:00:00ZFee asset selected for fills.
QUOTECumulative filled base quantity inherited from predecessors when this replacement was accepted, scaled by the pair's base_quantity_scale from GetSpotConfig for symbol_id. Zero for the original order and immutable within a generation. cum_qty_scaled minus this value is the quantity executed by this generation, not the quantity new to a client session.
100000Remaining working quantity scaled by the pair's base_quantity_scale from GetSpotConfig for symbol_id. Zero for terminal orders.
100000One-based replacement generation, distinct from per-order state version.
1Stable logical-order ID: the first generation's public order ID. Replace preserves this ID; an independent new order starts a new lineage.
2Optional client-side reference price used for MARKET slippage protection, in quote units scaled by 1e9.
0.005Optional MARKET max slippage in basis points (1 bp = 0.01%).
1Non-negative MARKET maximum absolute price delta in Q9 execution-price ticks (1 tick = 1e-9 quote units). Zero means no absolute cap is configured.
1Public order identifier as fixed64.
5USXJZmkOrder type.
LIMITCurrent accepted total order quantity, updated by successful modifies, scaled by the pair's base_quantity_scale from GetSpotConfig for symbol_id.
100000Child sequence number for multi-child trigger strategies. Zero when not applicable.
1Parent order ID for attached-risk child orders.
5USXJZmkBroad class describing how the order was created.
DIRECTTrigger identifier when the order was created by a trigger.
59VD7LarTrigger strategy that created this order, or unspecified for direct orders.
STOP_LOSSTrue if the order was submitted as post-only (maker-only).
falseLimit price in quote units scaled by 1e9. Zero for MARKET orders.
0.005Order side.
BUYCurrent order lifecycle status.
PENDINGSelf-trade prevention mode.
EXPIRE_MAKERSubmitted hard all-in quote debit limit, scaled by the pair's quote_quantity_scale from GetSpotConfig. Present only when that sizing method was submitted.
1Trading symbol numeric identifier.
BTC-USDTTerminal timestamp in nanoseconds since epoch (UTC). Zero for open orders.
2025-01-01T00:00:00ZStable string for terminal_reason_code (e.g. "POST_ONLY_CROSS", "USER_REQUEST"). Empty for non-terminal orders.
USER_REQUESTTerminal reason code for canceled/rejected orders. Zero for non-terminal orders.
1Time-in-force policy.
GTCPer-order state version. Starts at 1 and increases for every published state change. Use this field to reconcile API and realtime updates.
1| Key | Status | Error | When |
|---|---|---|---|
| unauthenticated | 401 | Unauthenticated | Authentication required. |
| permission-denied | 403 | Permission Denied | Permission denied. |
| invalid-argument | 400 | Invalid Argument | Invalid argument. |
| not-found | 404 | Not Found | Not found. |
| unavailable | 503 | Unavailable | Service unavailable. |