API Reference
Trade Intents
Get by ID

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

ParameterTypeRequiredDescription
idstring (UUID)YesInternal Trade Intent UUID

Headers

HeaderValueRequired
AuthorizationBearer your_api_keyYes

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

FieldTypeDescription
idstring (UUID)Internal Trade Intent UUID
intent_idstringYour external intent identifier
symbolstringTrading symbol
sidestring"buy" or "sell"
quantitynumberNumber of shares/units
order_typestring"market", "limit", "stop", or "stop_limit"
limit_pricenumber | nullLimit price (if applicable)
stop_pricenumber | nullStop price (if applicable)
time_in_forcestring"day", "gtc", "ioc", or "fok"
extended_hoursbooleanExtended hours trading enabled
statusstringSee Status Values
broker_idstringConnected broker account ID
ordersarrayList of broker orders (see Order Object)
created_atstring (ISO 8601)Creation timestamp
updated_atstring (ISO 8601)Last update timestamp

Status Values

StatusDescription
pendingOrder submitted to broker, awaiting execution
filledOrder fully executed
partially_filledOrder partially executed
canceledOrder canceled before full execution
rejectedBroker rejected the order
failedRouting or validation failed

Order Object

FieldTypeDescription
idstring (UUID)Internal order UUID
broker_order_idstringBroker's order ID
statusstringOrder status
fillsarrayList of fills (see Fill Object)
created_atstring (ISO 8601)Creation timestamp
updated_atstring (ISO 8601)Last update timestamp

Fill Object

FieldTypeDescription
quantitynumberNumber of shares filled
pricenumberFill price
filled_atstring (ISO 8601)Fill timestamp

Error Codes

Status CodeError CodeDescription
401unauthorizedInvalid or missing API key
404not_foundTrade Intent not found
500internal_server_errorServer 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 second

Recommendation: Use webhooks instead of polling for real-time updates.

Next Steps