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

Usage

# Get all orders
orders = client.get_orders()

# Filter by status
open_orders = client.get_orders(status="PLACED")

Parameters

status
string
Optional filter by order status:
  • PENDING - Order submitted, awaiting placement
  • PLACED - Order active on the order book
  • FILLED - Order completely filled
  • CANCELLED - Order cancelled

Response

Returns a list of order objects.
orders
array

Example

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

Response

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