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
limitintegerqueryHow many clients to return per page. From 1 to 100. Defaults to 20.
offsetintegerqueryWhich position to start from. Defaults to 0.
Response
itemsarray of clientsrequiredThe clients on this page. See Client.
totalinteger | nullrequiredTotal number of clients at the commerce, unpaginated.
limitinteger | nullrequiredThe limit applied.
offsetinteger | nullrequiredThe 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
| 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. |