List clients

The commerce's client list, paginated by limit and offset.

GET/v1/clients/listCommerce API key

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

Parameters

limitintegerquery

How many clients to return per page. From 1 to 100. Defaults to 20.

offsetintegerquery

Which position to start from. Defaults to 0.

Response

itemsarray of clientsrequired

The clients on this page. See Client.

totalinteger | nullrequired

Total number of clients at the commerce, unpaginated.

limitinteger | nullrequired

The limit applied.

offsetinteger | nullrequired

The offset applied.

Example

curl https://loybox-public-api-752998171300.southamerica-west1.run.app/v1/clients/list?limit=2&offset=0 \
  -H "Authorization: Bearer $LOYBOX_API_KEY"
// 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

CodeWhen
401The API key is invalid: it has no commerce attached.
422limit is outside the 1 to 100 range, or offset is negative.