# List clients (https://docs.loybox.com.ar/en/api-reference/clientes/listar)



<Endpoint method="GET" path="/v1/clients/list" auth="api-key" />

Returns the commerce's client list, paginated with limit and offset.

## Parameters
<Fields>
  <Field name="limit" type="integer" location="query">
    How many clients to return per page. From `1` to `100`. Defaults to `20`.
  </Field>

  <Field name="offset" type="integer" location="query">
    Which position to start from. Defaults to `0`.
  </Field>
</Fields>

## Response
<Fields>
  <Field name="items" type="array of clients" required="true">
    The clients on this page. See [Client](https://docs.loybox.com.ar/api-reference/objetos#cliente).
  </Field>

  <Field name="total" type="integer | null" required="true">
    Total number of clients at the commerce, unpaginated.
  </Field>

  <Field name="limit" type="integer | null" required="true">
    The limit applied.
  </Field>

  <Field name="offset" type="integer | null" required="true">
    The offset applied.
  </Field>
</Fields>

## Example
```bash
curl https://loybox-public-api-752998171300.southamerica-west1.run.app/v1/clients/list?limit=2&offset=0 \
  -H "Authorization: Bearer $LOYBOX_API_KEY"
```

```json
// 200 OK
{
  "items": [
    {
      "code": 12345,
      "username": "Ana Pérez",
      "email": "ana@example.com",
      "points": 340
    },
    {
      "code": 12346,
      "username": "Bruno Díaz",
      "email": "bruno@example.com",
      "points": 0
    }
  ],
  "total": 1875,
  "limit": 2,
  "offset": 0
}
```

To walk the whole list, keep adding `limit` to `offset` until the sum reaches
`total`.

## Errors
| Code  | When                                                            |
| ----- | --------------------------------------------------------------- |
| `401` | The API key is invalid: it has no commerce attached.            |
| `422` | `limit` is outside the 1 to 100 range, or `offset` is negative. |
