Benefits they can buy

The benefits a client can buy with the points they hold.

GET/v1/clients/{client_code}/available-benefitsCommerce API key

Looks up the benefits available to a client: the ones shown on their benefits screen, that is, the ones they can buy with their points.

It is the flip side of purchased benefits, which returns the ones they already traded points for.

Parameters

client_codestringpathrequired

The client's code.

Response

An array of Benefit.

curl https://loybox-public-api-752998171300.southamerica-west1.run.app/v1/clients/12345/available-benefits \
  -H "Authorization: Bearer $LOYBOX_API_KEY"
// 200 OK
[
  {
    "id": "b_9f2a",
    "type": "percentage_discount",
    "description": "20% de descuento en toda la tienda",
    "cost": 250,
    "expiration": "2026-12-31T23:59:59Z",
    "benefit_type": "normal",
    "color": "#f1a10d",
    "buy_limit": 0,
    "prize": {
      "type": "percentage_discount",
      "title": "20% off",
      "description": "Válido en toda la tienda",
      "value": 20,
      "product": null,
      "expiration": "2026-12-31T23:59:59Z",
      "image": null
    },
    "tiendanube_coupon": null
  }
]

The example's text values come back in the language the commerce wrote them in. They are data, not interface: Loybox does not translate what the brand typed.

Each benefit's cost is what it costs in points. To know which ones they can afford, compare it with the points from getting a client.

Errors

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