# Benefits (https://docs.loybox.com.ar/en/api-reference/beneficios)



This section holds the two halves of a reward's life: **the catalog** the commerce
built, and **the redemption** of a code a member brings in to use.

<Callout title="A benefit and a redeemable benefit are not the same">
  The commerce creates **benefits**, and each one has a `benefit_id`. When a member
  buys one with their points they receive a **redeemable benefit** with its own
  `client_benefit_code`.

  The `benefit_id` is only good for looking up information. The
  `client_benefit_code` is good for looking up **and for redeeming**.
</Callout>

## The redemption flow
This is what it looks like on your system's side when a member shows up with a
code:

<Steps>
  <Step>
    ### The member gives their code
    They have it in their Loybox app. It is the `client_benefit_code`.
  </Step>

  <Step>
    ### You look up what it is
    [`GET /v1/benefits/preview/{client_benefit_code}`](https://docs.loybox.com.ar/api-reference/beneficios/consultar-codigo)
    tells you which reward it is and, where it applies, what discount to give. It does
    not redeem anything yet.
  </Step>

  <Step>
    ### You apply the discount
    At your register, your ecommerce or wherever the sale runs, using the previous
    step's data.
  </Step>

  <Step>
    ### You mark it as used
    [`POST /v1/benefits/redeem`](https://docs.loybox.com.ar/api-reference/beneficios/canjear). From here on the
    code is burned and cannot be used again.
  </Step>
</Steps>

<Callout type="warn" title="Redeem only once the sale went through">
  Looking up is harmless and can be repeated; redeeming is final. If you redeem
  before closing the sale and the sale falls through, the member lost the reward.
</Callout>

## The endpoints
<Cards>
  <Card title="List benefits" icon="Boxes" description="The full catalog the commerce created." href="/api-reference/beneficios/listar" />

  <Card title="Get a benefit" icon="Gift" description="One catalog benefit by its benefit_id." href="/api-reference/beneficios/obtener" />

  <Card title="Look up a code" icon="Tag" description="Which reward a client_benefit_code is, before redeeming it." href="/api-reference/beneficios/consultar-codigo" />

  <Card title="Look up a code (v2)" icon="Sparkles" description="The same, with the title and the discount's value at the top level." href="/api-reference/beneficios/consultar-codigo-v2" />

  <Card title="Redeem a benefit" icon="BadgeCheck" description="Marks the code as used. It is final." href="/api-reference/beneficios/canjear" />
</Cards>

## Credential
The whole section goes from your server, with the
[commerce API key](https://docs.loybox.com.ar/api-reference/credenciales#api-key-del-comercio):

```
Authorization: Bearer {api-key}
```
