# Check-in / Check-out

This guide explains how to track member visits using the MMS API V2.

## Introduction

Tracking member visits is essential for:

- **Trainer Awareness**: Letting trainers know who is currently in the gym.
- **Check-ins History**: Tracking member attendance over time.
- **Challenge/Rewards Programs**: Enabling visit-based gamification and rewards.


The MMS API provides endpoints to register when a member enters (check-in) and leaves (check-out) the gym.

## 1. Check-in

When a member enters the gym (e.g., through a turnstile or at the front desk), send a request to the `checkin` endpoint.

```shell curl
curl -i -X POST \
  'https://mms.api.ed.ts.egym.coffee/api/v2/accounts/{accountId}/checkins' \
  -H 'Content-Type: application/json' \
  -d '{
    "timestamp": 1672531200000
  }'
```

**Note:**

- The `timestamp` is **mandatory**. It represents the time of the event in milliseconds since epoch.
- This endpoint triggers any "Member Entered" webhooks or notifications.


## 2. Check-out

When a member leaves the gym, send a request to the `checkout` endpoint.

```shell curl
curl -i -X POST \
  'https://mms.api.ed.ts.egym.coffee/api/v2/accounts/{accountId}/checkouts' \
  -H 'Content-Type: application/json' \
  -d '{
    "timestamp": 1672534800000
  }'
```

**Note:**

- Similar to check-in, the `timestamp` is **mandatory**.
- This endpoint updates the member's presence status to "not in gym".