> For the complete documentation index, see [llms.txt](https://knowledgebase.flaik.com/flaik-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/timekeeping/paid-activities-by-date-range.md).

# Paid Activities by Date Range

## Overview

Returns paid-activity timesheet rows (instructor pay calculations) for a date range and season. Each row represents a single calculated activity for a single employee — with the wage and commission figures already computed against the configured rate cards. Use this to ingest into payroll exports, BI dashboards, or commission audit systems.

The endpoint supports an `updatedAfterLocalDateTime` filter for incremental sync — pass the timestamp of your last successful pull to receive only rows changed since then.

{% hint style="info" %}
**Heads up — local time, not UTC**

`updatedAfterLocalDateTime` is interpreted in the **resort's local timezone**, not UTC. This is different from the Schedule API's `updatedAfterUtcDateTime`. Pull the resort's IANA timezone from the [Resort Details](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/global-settings/resort-details) endpoint and convert your sync timestamp before calling.
{% endhint %}

{% hint style="info" %}
**No range cap and no pagination**

Unlike the Class Management endpoints, this endpoint has no maximum date range and does not paginate. A wide range against a large resort may return many thousands of rows in a single response. Pull narrow windows and rely on `updatedAfterLocalDateTime` for ongoing sync.
{% endhint %}

The intent of this endpoint is to allow you as a resort tot pull the current seasons timekeeping data - it is not intended to enable data collection of previous seasons.

## Authentication

Include your access token in the Authorization header:

```http
Authorization: Bearer {access_token}
```

This endpoint requires the `flaik.connect.api.read` scope. See the [Authentication Guide](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/overview/authentication) for details on obtaining access tokens.

## Endpoint

```http
GET {api-url}/api/timekeeping/paidactivities/paidactivitiesbydaterange
```

**Path Parameters**

None.

**Query Parameters**

All four query parameters are **required**.

| Parameter                   | Type     | Required | Description                                                                                                                                                                    |
| --------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `seasonId`                  | integer  | Yes      | Season identifier — retrieve from the [Seasons](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/global-settings/seasons) endpoint |
| `startDate`                 | date     | Yes      | First day of the timesheet range, inclusive (`YYYY-MM-DD`)                                                                                                                     |
| `endDate`                   | date     | Yes      | Last day of the timesheet range, inclusive (`YYYY-MM-DD`). Must be on or after `startDate`.                                                                                    |
| `updatedAfterLocalDateTime` | datetime | Yes      | Only return rows whose `updatedUtc` (converted to resort-local time) is after this timestamp (`YYYY-MM-DDTHH:mm:ss`, resort-local)                                             |

{% hint style="info" %}
**Tip — full pull on first sync:** To request all rows in the range regardless of update time, pass an `updatedAfterLocalDateTime` far enough in the past to predate any data (e.g. `2000-01-01T00:00:00`).
{% endhint %}

**Example Request**

```http
GET {api-url}/api/timekeeping/paidactivities/paidactivitiesbydaterange
        ?seasonId=17
        &startDate=2025-01-15
        &endDate=2025-01-19
        &updatedAfterLocalDateTime=2000-01-01T00:00:00
Authorization: Bearer {access_token}
```

**Response Format**

```json
[
  {
    "seasonId": 17,
    "seasonName": "Winter 2024–2025",
    "payrollId": "EMP123456",
    "employeeIdentifier": "E15",
    "employeeName": "Sam Smith",
    "flaikEmployeeId": 15,
    "timesheetId": 90211,
    "timesheetStatus": "Approved",
    "timesheetDate": "2025-01-15T00:00:00",
    "paidActivityGroupId": 4,
    "paidActivityGroupName": "Teaching",
    "paidActivityId": 88001,
    "paidActivityName": "Group Lesson AM",
    "startTime": "09:00:00",
    "endTime": "11:00:00",
    "paidActivityType": "GroupLesson",
    "durationMinutes": 120,
    "wageTypeUsedForCalculation": 25.00,
    "calculatedWageValue": 50.00,
    "calculatedCommissionValue": 5.00,
    "totalCalculatedValue": 55.00,
    "businessStructureId": 9,
    "businessStructureName": "Snowsports School",
    "costCentre": "SS-100",
    "exportBusinessStructureName": "Snowsports School",
    "externalId": "EXT-9001",
    "locationName": "Base Lodge",
    "parentPath": "Resort > Snowsports School",
    "payCodeId": 12,
    "payCodeName": "Teaching Hourly",
    "payCodeType": "Hourly",
    "payCodeCostCentre": "SS-100",
    "jobCodeId": 33,
    "jobCodeName": "Instructor Level 2",
    "jobCodeType": "Instructor",
    "jobCodeCostCentre": "SS-100"
  }
]
```

**Response Fields**

### Identity

| Field                | Type    | Description                                |
| -------------------- | ------- | ------------------------------------------ |
| `seasonId`           | integer | Season the activity belongs to             |
| `seasonName`         | string  | Season display name                        |
| `payrollId`          | string  | Employee identifier in your payroll system |
| `employeeIdentifier` | string  | Employee identifier as set in flaik        |
| `employeeName`       | string  | Employee display name                      |
| `flaikEmployeeId`    | integer | flaik employee identifier                  |

### Timesheet

| Field             | Type     | Description                                                                               |
| ----------------- | -------- | ----------------------------------------------------------------------------------------- |
| `timesheetId`     | integer  | Timesheet identifier                                                                      |
| `timesheetStatus` | string   | Lifecycle status (e.g. `"Approved"`, `"Submitted"`)                                       |
| `timesheetDate`   | datetime | The day the timesheet covers (`YYYY-MM-DDTHH:mm:ss`; time component is always `00:00:00`) |

### Activity

| Field                   | Type    | Description                                                                 |
| ----------------------- | ------- | --------------------------------------------------------------------------- |
| `paidActivityGroupId`   | integer | Activity group identifier (nullable)                                        |
| `paidActivityGroupName` | string  | Activity group name                                                         |
| `paidActivityId`        | integer | Paid activity identifier                                                    |
| `paidActivityName`      | string  | Activity display name                                                       |
| `startTime`             | time    | Activity start (`HH:mm:ss`, resort-local, nullable)                         |
| `endTime`               | time    | Activity end (`HH:mm:ss`, resort-local, nullable)                           |
| `paidActivityType`      | string  | Type of activity (e.g. `"GroupLesson"`, `"PrivateLesson"`, `"NonTeaching"`) |
| `durationMinutes`       | integer | Calculated duration in minutes                                              |

### Calculated wage

| Field                        | Type    | Description                                                 |
| ---------------------------- | ------- | ----------------------------------------------------------- |
| `wageTypeUsedForCalculation` | decimal | Hourly rate (or other base rate) used to calculate the wage |
| `calculatedWageValue`        | decimal | Wage portion of the total                                   |
| `calculatedCommissionValue`  | decimal | Commission portion of the total                             |
| `totalCalculatedValue`       | decimal | Sum of wage + commission                                    |

### Business structure

| Field                         | Type    | Description                                                                      |
| ----------------------------- | ------- | -------------------------------------------------------------------------------- |
| `businessStructureId`         | integer | Business structure identifier (nullable)                                         |
| `businessStructureName`       | string  | Business structure display name (nullable)                                       |
| `costCentre`                  | string  | Cost centre code (nullable)                                                      |
| `exportBusinessStructureName` | string  | Name used for payroll export (nullable; may differ from `businessStructureName`) |
| `externalId`                  | string  | External identifier for the business structure (nullable)                        |
| `locationName`                | string  | Activity location name (nullable)                                                |
| `parentPath`                  | string  | Hierarchical path of the business structure (nullable)                           |

### Pay code

| Field               | Type    | Description                      |
| ------------------- | ------- | -------------------------------- |
| `payCodeId`         | integer | Pay code identifier (nullable)   |
| `payCodeName`       | string  | Pay code display name (nullable) |
| `payCodeType`       | string  | Pay code type (nullable)         |
| `payCodeCostCentre` | string  | Pay code cost centre (nullable)  |

### Job code

| Field               | Type    | Description                      |
| ------------------- | ------- | -------------------------------- |
| `jobCodeId`         | integer | Job code identifier (nullable)   |
| `jobCodeName`       | string  | Job code display name (nullable) |
| `jobCodeType`       | string  | Job code type (nullable)         |
| `jobCodeCostCentre` | string  | Job code cost centre (nullable)  |

## Incremental Sync Pattern

This endpoint supports a delta filter via `updatedAfterLocalDateTime`. A typical sync loop:

{% stepper %}
{% step %}

### Record the resort-local timestamp of your sync start.

Record the resort-local timestamp of your sync **start**.
{% endstep %}

{% step %}

### Convert your last successful sync time to resort-local.

Convert your last successful sync time to resort-local using the `timezone` from [Resort Details](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/global-settings/resort-details).
{% endstep %}

{% step %}

### Call the endpoint with the converted timestamp.

Call this endpoint with that timestamp as `updatedAfterLocalDateTime`.
{% endstep %}

{% step %}

### Process all rows.

Process all rows.
{% endstep %}

{% step %}

### Persist the new watermark on success.

On success, persist the timestamp recorded in step 1 as your new watermark.
{% endstep %}
{% endstepper %}

## Error Responses

| HTTP Status | Description                                               |
| ----------- | --------------------------------------------------------- |
| `400`       | A required query parameter is missing or malformed        |
| `400`       | `startDate` is after `endDate`                            |
| `401`       | Missing or invalid access token                           |
| `403`       | Token does not include the `flaik.connect.api.read` scope |

Need help with timekeeping ingest? Contact <resortsupport@flaik.com>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/timekeeping/paid-activities-by-date-range.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
