# My history (https://docs.loybox.com.ar/en/api-reference/mi-cuenta/historial)



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

The user's activity in the commerce's program: consumptions that earned points,
benefit purchases, redemptions and special rewards.

Cursor paginated: to fetch the next page you pass the previous response's
`next_cursor` in `?cursor=`.

## 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>

## Parameters
<Fields>
  <Field name="cursor" type="string | null" location="query">
    Cursor of the page to fetch. It comes from the previous response's
    `next_cursor`. Left unspecified, it returns the first page.
  </Field>
</Fields>

## Response
<Fields>
  <Field name="results" type="array of activity items" required="true">
    This page's items. See
    [Activity item](https://docs.loybox.com.ar/api-reference/objetos#movimiento).
  </Field>

  <Field name="next_cursor" type="string | null">
    Passed as `?cursor=` to fetch the next page. `null` when there are no more.
  </Field>

  <Field name="previous_cursor" type="string | null">
    The previous page's cursor.
  </Field>
</Fields>

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

```json
// 200 OK
{
  "results": [
    {
      "type": "consumption",
      "date": "2026-08-20T18:42:00Z",
      "points": 17,
      "benefit": null,
      "amount": 1750,
      "event": null,
      "additional_note": null
    },
    {
      "type": "benefit_exchange",
      "date": "2026-08-24T13:05:00Z",
      "points": -250,
      "benefit": {
        "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": null,
        "tiendanube_coupon": null
      },
      "amount": null,
      "event": null,
      "additional_note": null
    }
  ],
  "next_cursor": "eyJkIjoiMjAyNi0wOC0yMCJ9",
  "previous_cursor": null
}
```

## The four activity types
| `type`                  | What happened                           | Fields it carries              |
| ----------------------- | --------------------------------------- | ------------------------------ |
| `consumption`           | A purchase that earned points           | `amount`, `points`             |
| `benefit_exchange`      | They bought a benefit with points       | `benefit`, `points` (negative) |
| `benefit_usage`         | They redeemed a benefit at the commerce | `benefit`                      |
| `points_special_reward` | An automatic reward gave them points    | `event`, `points`              |

Since which fields come filled in depends on the `type`, it is worth building the
history row with a `switch` on `type` instead of always reading every field.

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