Get Trade Intent by ID
Retrieve a Trade Intent by its internal UUID
API: GET https://api.sniperoute.io/api/v1/intents/{id}
Request
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Yes | Internal Trade Intent UUID |
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer your_api_key | Yes |
Response
Success (200 OK)
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"intent_id": "trade_001",
"symbol": "AAPL",
"side": "buy",
"quantity": 10,
"order_type": "market",
"status": "filled",
"broker_id": "alpaca_abc123",
"orders": [
{
"id": "660e8400-e29b-41d4-a716-446655440000",
"broker_order_id": "order_123",
"status": "filled",
"fills": [
{
"quantity": 10,
"price": 175.50,
"filled_at": "2025-11-30T10:30:00Z"
}
],
"created_at": "2025-11-30T10:29:59Z",
"updated_at": "2025-11-30T10:30:00Z"
}
],
"created_at": "2025-11-30T10:29:59Z",
"updated_at": "2025-11-30T10:30:00Z"
}Error (4xx/5xx)
{
"detail": "Trade Intent not found",
"error_code": "not_found",
"request_id": "req_abc123"
}Examples
curl https://api.sniperoute.io/api/v1/intents/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer sk_live_abc123..."Response Fields
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Internal Trade Intent UUID |
intent_id | string | Your external intent identifier |
symbol | string | Trading symbol |
side | string | "buy" or "sell" |
quantity | number | Number of shares/units |
order_type | string | "market", "limit", "stop", or "stop_limit" |
limit_price | number | null | Limit price (if applicable) |
stop_price | number | null | Stop price (if applicable) |
time_in_force | string | "day", "gtc", "ioc", or "fok" |
extended_hours | boolean | Extended hours trading enabled |
status | string | See Status Values |
broker_id | string | Connected broker account ID |
orders | array | List of broker orders (see Order Object) |
created_at | string (ISO 8601) | Creation timestamp |
updated_at | string (ISO 8601) | Last update timestamp |
Status Values
| Status | Description |
|---|---|
pending | Order submitted to broker, awaiting execution |
filled | Order fully executed |
partially_filled | Order partially executed |
canceled | Order canceled before full execution |
rejected | Broker rejected the order |
failed | Routing or validation failed |
Order Object
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Internal order UUID |
broker_order_id | string | Broker's order ID |
status | string | Order status |
fills | array | List of fills (see Fill Object) |
created_at | string (ISO 8601) | Creation timestamp |
updated_at | string (ISO 8601) | Last update timestamp |
Fill Object
| Field | Type | Description |
|---|---|---|
quantity | number | Number of shares filled |
price | number | Fill price |
filled_at | string (ISO 8601) | Fill timestamp |
Error Codes
| Status Code | Error Code | Description |
|---|---|---|
401 | unauthorized | Invalid or missing API key |
404 | not_found | Trade Intent not found |
500 | internal_server_error | Server error |
Use Cases
Check Order Status
import asyncio
async def check_status(client, uuid):
intent = await client.get_intent_by_id(uuid)
if intent.status == "filled":
print("Order filled!")
for order in intent.orders:
for fill in order.fills:
print(f" {fill.quantity} @ ${fill.price}")
elif intent.status == "pending":
print("Order pending...")
elif intent.status == "rejected":
print("Order rejected")
asyncio.run(check_status(client, "550e8400-..."))Poll for Completion
import asyncio
async def wait_for_fill(client, uuid, timeout=60):
"""Wait for order to fill (or fail)."""
start_time = asyncio.get_event_loop().time()
while True:
intent = await client.get_intent_by_id(uuid)
if intent.status in ["filled", "rejected", "failed"]:
return intent
if asyncio.get_event_loop().time() - start_time > timeout:
raise TimeoutError("Order did not fill within timeout")
await asyncio.sleep(1) # Poll every secondRecommendation: Use webhooks instead of polling for real-time updates.