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

# List Orders

> Get customer's order history

# List Orders

Returns the authenticated customer's order history.

**Requires customer authentication.**

## Request

<ParamField header="X-API-Key" type="string" required>
  Your API key
</ParamField>

<ParamField header="Authorization" type="string" required>
  Customer token: `Bearer {token}`
</ParamField>

### Query Parameters

<ParamField query="page" type="integer" default="1">
  Page number
</ParamField>

<ParamField query="limit" type="integer" default="20">
  Items per page
</ParamField>

## Response

<ResponseExample>
  ```json theme={null}
  {
    "status": true,
    "message": "Orders retrieved",
    "data": {
      "orders": [
        {
          "id": "txn_abc123",
          "status": "completed",
          "total": 5829,
          "currency": "USD",
          "items": [
            {
              "product_id": 12345,
              "product_title": "Premium T-Shirt",
              "quantity": 2,
              "price": 2999
            }
          ],
          "created_at": "2024-01-15T10:30:00Z"
        }
      ],
      "pagination": {
        "page": 1,
        "limit": 20,
        "total": 5
      }
    }
  }
  ```
</ResponseExample>

## Errors

| Error Code           | Description                |
| -------------------- | -------------------------- |
| `AUTH_TOKEN_EXPIRED` | Customer token has expired |
| `AUTH_TOKEN_INVALID` | Invalid customer token     |

## Example

```bash theme={null}
curl "https://api.khaime.com/api/v1/orders?page=1&limit=10" \
  -H "X-API-Key: pk_live_your_api_key" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
```
