> ## 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 customers

> The business's customers and what each has spent.

The business's customers and what each has spent. This is personal information, so show it only behind a login.

Call this from your server with a `pk_` key. See [Store data overview](https://docs.khaime.com/api-reference/store-data/overview.md) for keys, errors and how to read empty values.

## Parameters

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | string | No | Match first name, last name or email. |
| `sort` | string | No | `newest` (default) or `top_spend`. |
| `limit` | integer | No | How many rows, 1 to 50. Default 20. |

## Request

```bash theme={null}
curl -H "X-API-Key: $KHAIME_API_KEY" \
  "https://api.khaime.com/api/v1/analytics/customers?sort=top_spend&limit=10"
```

## Response

```json theme={null}
{
  "message": "Customers retrieved",
  "success": true,
  "status": true,
  "data": {
    "environment": "live",
    "items": [
      {
        "id": 771,
        "first_name": "Ada",
        "last_name": "Obi",
        "email": "ada@example.com",
        "created_at": "2026-03-02T09:21:40.000Z",
        "payments": 3,
        "totals": [
          {
            "minor": 24600,
            "currency": "USD"
          }
        ]
      }
    ]
  }
}
```

## Read it correctly

* `totals` has one entry for each currency, in hundredths. Currencies are never added together.
* `top_spend` lists only customers who have paid.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.