Get a client

Looks a client up by their code and returns their data and their point balance.

GET/v1/clients/{client_code}Commerce API key

Looks a client up by their code. The client_code is the number every person registered in Loybox has: the one the member gives at the register and the one used to record a consumption.

Parameters

client_codestringpathrequired

The client's code.

Response

A Client object.

curl https://loybox-public-api-752998171300.southamerica-west1.run.app/v1/clients/12345 \
  -H "Authorization: Bearer $LOYBOX_API_KEY"
// 200 OK
{
  "code": 12345,
  "username": "Ana Pérez",
  "email": "ana@example.com",
  "points": 340
}

The points field is the available balance: live earned points minus redeemed points. Expired points do not count. See Balance.

Errors

CodeWhen
404The client does not exist.
422The code is not a valid format.