curl --request GET \
--url https://api.example.com/api/v1/trading/orders \
--header 'Content-Type: application/json' \
--data '
{
"status": "<string>"
}
'{
"orders": [
{
"order_id": "<string>",
"token_id": "<string>",
"side": "<string>",
"shares": 123,
"price": 123,
"order_type": "<string>",
"status": "<string>",
"filled_shares": 123,
"created_at": "<string>"
}
]
}Get your orders
curl --request GET \
--url https://api.example.com/api/v1/trading/orders \
--header 'Content-Type: application/json' \
--data '
{
"status": "<string>"
}
'{
"orders": [
{
"order_id": "<string>",
"token_id": "<string>",
"side": "<string>",
"shares": 123,
"price": 123,
"order_type": "<string>",
"status": "<string>",
"filled_shares": 123,
"created_at": "<string>"
}
]
}# Get all orders
orders = client.get_orders()
# Filter by status
open_orders = client.get_orders(status="PLACED")
PENDING - Order submitted, awaiting placementPLACED - Order active on the order bookFILLED - Order completely filledCANCELLED - Order cancelledShow Order object
BUY or SELL.GTC, FOK, FAK).from polyhush import PolyhushClient
client = PolyhushClient(api_key="your-api-key")
# Get open orders
open_orders = client.get_orders(status="PLACED")
print(f"Open Orders: {len(open_orders)}")
for order in open_orders:
print(f"\n{order['side']} {order['shares']} @ ${order['price']:.2f}")
print(f" Order ID: {order['order_id']}")
print(f" Type: {order['order_type']}")
print(f" Filled: {order['filled_shares']}/{order['shares']}")
[
{
"order_id": "ord_abc123",
"token_id": "12345678901234567890",
"side": "BUY",
"shares": 100,
"price": 0.45,
"order_type": "GTC",
"status": "PLACED",
"filled_shares": 0,
"created_at": "2024-01-15T10:30:00Z"
}
]