# Get Points to expire

## Description

This service retrieves information about upcoming points expirations for the logged-in user's account within a specific mileage activity.

***

## Request

### Restrictions

This service requires an authenticated user and can only be called after a successful login.

### Endpoint

```
GET https://<server-url>/api/v4/mileage/{activity_code}/account/pointsexpiration
```

### Path Parameters

| Parameter       | Type   | Description                                                               |
| --------------- | ------ | ------------------------------------------------------------------------- |
| `activity_code` | String | The unique code for the mileage activity (e.g., "activityMileagePoints"). |

### Parameters

| Parameter    | Location       | Description                                                                        |
| ------------ | -------------- | ---------------------------------------------------------------------------------- |
| `touchpoint` | Query / Header | The identifier for the touchpoint. Use `Thalamus-Touchpoint` for the header.       |
| `token`      | Query / Header | The authentication token for the API session. Use `Thalamus-Token` for the header. |
| `date`       | Query          | Required. The reference date for calculating expirations, in `yyyy-mm-dd` format.  |

### Full URL Example

```
https://<server-url>/api/v4/mileage/activityMileagePoints/account/pointsexpiration?date=2021-12-12&touchpoint=test&token=...
```

### Request Body

This request does not have a body.

***

## Response

### ✅ Successful Response: `200 OK`

A JSON object is returned containing an array of `pointsToExpireElements`. Each element represents a batch of points and its corresponding expiration date.

| Field            | Type      | Description                               |
| ---------------- | --------- | ----------------------------------------- |
| `pointsToExpire` | Number    | The number of points that will expire.    |
| `expirationDate` | Timestamp | The date on which the points will expire. |

JSON

```
{
  "pointsToExpireElements": [
    {
      "pointsToExpire": 75.0,
      "expirationDate": 1632452400000
    }
  ]
}
```

### ❌ Unsuccessful Response: `404 Not Found`

Returned if the specified `activity_code` does not exist.

JSON

```
{
  "errors": {
    "error.message": "NOT_FOUND"
  }
}
```
