Skip to main content
GET
/
api
/
v1
/
trading
/
orders
/
{order_id}
Get Order
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>"
}

Usage

order = client.get_order(order_id="ord_abc123")

Parameters

order_id
string
required
The order ID to retrieve.

Response

order_id
string
Unique order identifier.
token_id
string
Token being traded.
side
string
BUY or SELL.
shares
number
Total number of shares in the order.
price
number
Limit price per share.
order_type
string
Order type (GTC, FOK, FAK).
status
string
Current order status.
filled_shares
number
Number of shares that have been filled.
average_fill_price
number
Average price of filled shares.
created_at
string
Order creation timestamp.
updated_at
string
Last update timestamp.

Example

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}")

Response

{
  "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"
}