OrdersService
Get Order
Retrieve order details with a bounded page of lineage trades through this generation and their transfers. Execution history defaults to enabled; use limit and pageToken to paginate, or includeExecutionHistory=false for state-only polling. Projections are eventually consistent.
Request
curl --request GET \ \ --url 'https://api.testnet.polyester.com/v1/spot/orders/9876543210123?includeAttachedRisk=false&includeAttachedRiskState=false&includeExecutionHistory=false&limit=100&pageToken=eyJvZmZzZXQiOjEwMH0&subaccountId=6789012345678' \ --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",
"order": {
"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
},
"trades": [
{
"executedAt": "2025-01-01T00:00:00Z",
"fee": "18.446744073709551617",
"feeAsset": "QUOTE",
"feeIsRebate": false,
"isMaker": false,
"lineage": {
"generation": 1,
"id": "2"
},
"matchId": "100001",
"orderId": "5USXJZmk",
"price": "0.005",
"qty": "100000",
"referralShare": "18.446744073709551617",
"side": "BUY",
"symbol": "BTC-USDT"
}
],
"transfers": [
{
"account": "FUNDING",
"asset": "100",
"isDebit": false,
"matchId": "100001",
"symbolId": 1,
"timestamp": "2025-01-01T00:00:00Z",
"transferCode": "DEPOSIT",
"txId": "0xabc123"
}
]
}Order ID (base58)
Include attached-risk policy fields in response.order. Defaults to false when omitted.
Include attached-risk state fields in response.order. Defaults to false when omitted.
Include lineage trades and their transfers. Set false for state-only polling.
Maximum trades on the embedded execution page. Requires execution history.
Cursor from nextPageToken; use the same physical order ID for subsequent pages.
Cursor for the next execution page. Empty when no further rows are visible; this is not a settlement or order-state reconciliation watermark.
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.
1Execution timestamp in nanoseconds since epoch.
2025-01-01T00:00:00ZExact fee magnitude in fixed 18-decimal units of fee_asset.
18.446744073709551617Fee asset charged or credited for this fill.
QUOTEWhether this fill earned a rebate instead of paying a fee.
falseTrue if this fill was maker-side.
falseOne-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.
2Match identifier (monotonic per symbol).
100001Order identifier as fixed64.
5USXJZmkExecution price in quote units scaled by 1e9.
0.005Executed quantity scaled by the pair's base_quantity_scale from GetSpotConfig for symbol_id.
100000Exact referral share magnitude in fixed 18-decimal units of fee_asset.
18.446744073709551617Fill side.
BUYTrading symbol numeric identifier.
BTC-USDTAccount bucket affected by this transfer leg.
FUNDINGAsset identifier for the transferred asset.
100True when the transfer debits the account; false when it credits the account.
falseMatch identifier that linked this transfer to an execution, scoped by symbol_id.
100001Market of the execution; together with match_id identifies its match.
1Transfer timestamp in nanoseconds since epoch (UTC).
2025-01-01T00:00:00ZProduct reason for this transfer leg.
DEPOSITTransfer transaction identifier.
0xabc123| 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. |