cURL
curl --request GET \ --url https://api.example.com/api/v1/trading/orders/{order_id}
{ "order_id": "<string>", "token_id": "<string>", "side": "<string>", "shares": 123, "price": 123, "order_type": "<string>", "status": "<string>", "filled_shares": 123, "average_fill_price": 123, "created_at": "<string>", "updated_at": "<string>" }
Get a specific order by ID
order = client.get_order(order_id="ord_abc123")
BUY
SELL
GTC
FOK
FAK
from polyhush import PolyhushClient, PolyhushAPIError client = PolyhushClient(api_key="your-api-key") try: order = client.get_order(order_id="ord_abc123") print(f"Order: {order['order_id']}") print(f"Status: {order['status']}") print(f"Side: {order['side']}") print(f"Size: {order['shares']} @ ${order['price']:.2f}") print(f"Filled: {order['filled_shares']}/{order['shares']}") if order['filled_shares'] > 0: print(f"Avg Fill Price: ${order['average_fill_price']:.4f}") except PolyhushAPIError as e: if e.status_code == 404: print("Order not found") else: print(f"Error: {e.message}")
{ "order_id": "ord_abc123", "token_id": "12345678901234567890", "side": "BUY", "shares": 100, "price": 0.45, "order_type": "GTC", "status": "PLACED", "filled_shares": 25, "average_fill_price": 0.4480, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:35:00Z" }