> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galadriel.co/llms.txt
> Use this file to discover all available pages before exploring further.

# List Orders

> List all orders for your account

## Query Parameters

<ParamField query="status" type="string">
  Filter by status: `pending`, `partial`, `filled`, `cancelled`, or `all`
</ParamField>

<ParamField query="side" type="string">
  Filter by side: `buy` or `sell`
</ParamField>

<ParamField query="limit" type="integer" default="20">
  Number of orders to return (max: 100)
</ParamField>

<ParamField query="offset" type="integer" default="0">
  Number of orders to skip
</ParamField>

## Response

<ResponseField name="orders" type="array">
  Array of order objects
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of orders matching the filter
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.galadriel.com/v1/orders?status=pending&limit=10" \
    -H "Authorization: Bearer YOUR_API_TOKEN"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.galadriel.com/v1/orders",
      headers={"Authorization": "Bearer YOUR_API_TOKEN"},
      params={"status": "pending", "limit": 10}
  )

  orders = response.json()["orders"]
  for order in orders:
      print(f"{order['order_id']}: {order['status']}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.galadriel.com/v1/orders?status=pending&limit=10',
    {
      headers: {
        'Authorization': 'Bearer YOUR_API_TOKEN'
      }
    }
  );

  const data = await response.json();
  data.orders.forEach(order => {
    console.log(`${order.order_id}: ${order.status}`);
  });
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "orders": [
      {
        "order_id": "ord_abc123",
        "side": "buy",
        "gpu_type": "h100",
        "gpu_count": 16,
        "zone": "us-west-1",
        "order_type": "limit",
        "limit_price": 1.30,
        "status": "pending",
        "filled_gpus": 0,
        "created_at": "2025-11-11T14:00:00Z",
        "expires_at": "2025-11-11T18:00:00Z"
      },
      {
        "order_id": "ord_def456",
        "side": "buy",
        "gpu_type": "h200",
        "gpu_count": 8,
        "zone": "us-east-1",
        "order_type": "market",
        "status": "filled",
        "filled_gpus": 8,
        "matched_price": 4.50,
        "lease_id": "lse_ghi789",
        "created_at": "2025-11-11T13:00:00Z",
        "filled_at": "2025-11-11T13:00:01Z"
      }
    ],
    "total": 2,
    "limit": 10,
    "offset": 0
  }
  ```
</ResponseExample>
