# Program rewards (https://docs.loybox.com.ar/en/api-reference/mi-cuenta/recompensas)



<Endpoint method="GET" path="/v1/me/rewards" auth="user-token" />

Rewards the commerce hands out on its own when something happens: the welcome one
on joining, the birthday one, the member-of-the-month one.

Each one says whether it gives a benefit or points. It exists to show the user what
they get **beyond** redeeming points.

## Headers
<Fields>
  <Field name="X-Commerce-Id" type="integer" location="header" required="true">
    Id of the commerce integrating the API. Every response is scoped to this
    commerce.
  </Field>
</Fields>

## Response
An array of
[Automatic reward](https://docs.loybox.com.ar/api-reference/objetos#recompensa-automática).

```bash
curl https://loybox-public-api-752998171300.southamerica-west1.run.app/v1/me/rewards \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Commerce-Id: 87"
```

```json
// 200 OK
[
  {
    "event": "welcome",
    "reward_type": "benefit",
    "benefit": {
      "id": "b_4c81",
      "type": "free_product",
      "description": "Café de regalo",
      "cost": 0,
      "expiration": null,
      "benefit_type": "welcome",
      "color": "#f1a10d",
      "buy_limit": 1,
      "prize": null,
      "tiendanube_coupon": null
    },
    "points": null
  },
  {
    "event": "birthday",
    "reward_type": "points",
    "benefit": null,
    "points": 200
  }
]
```

## The three events
| `event`       | When it is handed out                          |
| ------------- | ---------------------------------------------- |
| `welcome`     | On joining the program                         |
| `birthday`    | On the member's birthday                       |
| `monthly_top` | To the member who bought the most in the month |

The `reward_type` says where to look: if it is `benefit`, the reward is in
`benefit`; if it is `points`, it is in `points`. The other field comes back `null`.

<Callout type="info" title="It is a list of what the program offers">
  It returns the rewards the commerce **configured**, not the ones the user already
  received. For that there is
  [my history](https://docs.loybox.com.ar/api-reference/mi-cuenta/historial), where point rewards show up as
  `points_special_reward` items.
</Callout>

## Errors
| Code  | When                                                                     |
| ----- | ------------------------------------------------------------------------ |
| `401` | The access token is missing, expired, or does not belong to an end user. |
| `404` | The commerce does not exist.                                             |
| `422` | The `X-Commerce-Id` header is missing.                                   |
