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



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

Everything the frontend needs on the first render: the user's data, their points
and subscription in the program of the commerce named in `X-Commerce-Id`, the
commerce's branding data (name, logo, color, category) and the points about to
expire.

It is the call the app starts with. There is no need to fetch the commerce's data
separately: it comes inside.

## 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
A [My account](https://docs.loybox.com.ar/api-reference/objetos#mi-cuenta) object.

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

```json
// 200 OK
{
  "username": "Ana Pérez",
  "email": "ana@example.com",
  "phone": null,
  "points": 340,
  "subscribed": true,
  "commerce": {
    "id": 87,
    "name": "Tienda Central",
    "logo": "https://cdn.loybox.com.ar/logos/87.png",
    "color": "#f1a10d",
    "category_name": "Tienda de comics",
    "currency": "ARS"
  },
  "points_expiration": {
    "points": 120,
    "expiration_date": "2026-09-30T23:59:59Z",
    "days_left": 37,
    "months_left": 1,
    "mode": "accumulated"
  }
}
```

What to do with each piece:

| Field               | What for                                                                                                      |
| ------------------- | ------------------------------------------------------------------------------------------------------------- |
| `points`            | The big balance on the screen. It is what each benefit's `cost` is compared against.                          |
| `subscribed`        | If it comes back `false`, show the call to [join](https://docs.loybox.com.ar/api-reference/mi-cuenta/adherirme) instead of the catalog. |
| `commerce`          | Logo, name and color to paint the program's branding.                                                         |
| `points_expiration` | The "X points expire in Y days" notice.                                                                       |

<Callout type="info" title="When points do not expire">
  `points_expiration` does not come back `null`: it comes with `mode: "none"` and
  `points: 0`. Check the `mode` before showing the expiration notice.
</Callout>

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