# Fetch hours per department

**Requires scope:** `payroll`.
Returns a list of all hours, allowances, and expenses in the requested locked payroll period, grouped by department.
For the neutral hour types, for example sickness, leave or all the allowances are grouped by the primary department of the employee.
Only days that have hours, allowances, or expenses will be included.

Endpoint: GET /api/payroll/v3/hours-per-department/{officeUrl}/{contractTypeGroupName}/{period}
Security: apiKey

## Path parameters:

  - `officeUrl` (string, required)
    Slug of the office you wish to request the payroll information for.

  - `contractTypeGroupName` (string, required)
    Name of the contract type group for the payroll period.

  - `period` (string, required)
    The label of the payroll period you wish to request the payroll information for.

## Response 200 fields (application/json):

  - `meta` (object)
    Meta information about the request.

  - `meta.id` (integer)
    The unique result id for this period. Note that this will change when a period gets unlocked and locked again.
    Example: 1

  - `meta.office` (object)
    Information about the office for which the period was requested.

  - `meta.office.id` (integer)
    The internal id of the office.
    Example: 1

  - `meta.office.name` (string)
    The name of the office.
    Example: Pier 9 Bistro

  - `meta.office.costCenter` (object | null)
    Information about the cost center associated with the office.

  - `meta.office.costCenter.id` (integer | null)
    The unique cost center id.
    Example: 1

  - `meta.office.costCenter.name` (string | null)
    The name of the cost center.
    Example: Support

  - `meta.office.costCenter.code` (string | null)
    The code of the cost center.
    Example: 123

  - `meta.contractTypeGroupName` (string)
    The unique contract type group id used by Dyflexis. Note that this is not the same as a contract type id.
    Example: Hospitality permanent

  - `meta.period` (object)
    Information about the period itself.

  - `meta.period.startDate` (string)
    The start date (ISO 8601 date) of the payroll period.
    Example: 2026-06-01

  - `meta.period.endDate` (string)
    The end date (ISO 8601 date) of the payroll period.
    Example: 2026-06-30

  - `meta.period.year` (integer)
    The year of the payroll period.

  - `meta.period.name` (string)
    The period identifier as configured for your system.
    Example: M06

  - `meta.period.targetPeriod` (integer)
    The period (month/week/etc) the payroll data needs to be sent to.
    Example: 7

  - `meta.period.targetYear` (integer)
    The year the payroll data needs to be sent to.
    Example: 2026

  - `payroll` (array)
    The payroll hours/allowances/expenses, listed for each employee and grouped by day and department.

  - `payroll.employee` (object)
    The employee to whom the hours belong.

  - `payroll.employee.id` (integer)
    The unique employee id used by Dyflexis.
    Example: 1

  - `payroll.employee.employeeReference` (string | null)
    Unique reference to the employee when connected to an external employee that has been created using the [Create or update an employee](../#tag/Employees/operation/Create%20or%20update%20an%20employee) endpoint.
    Example: P1413B

  - `payroll.employee.personnelNumber` (string)
    The personnel number as known by the connecting party.
    Example: 1413

  - `payroll.employee.firstName` (string | null)
    Example: Gail

  - `payroll.employee.lastName` (string | null)
    Example: Boehm

  - `payroll.employee.lastNamePrefix` (string | null)

  - `payroll.employee.employerReferenceId` (string | null)
    The reference number for the employer.
    Example: 123

  - `payroll.employee.costCenter` (string | null)
    The cost center for the employee.
    Example: tech

  - `payroll.employee.employmentStart` (string | null)
    The employment start date (ISO 8601 date) for the employee.
    Example: 2026-01-01

  - `payroll.employee.employmentEnd` (string | null)
    The employment end date (ISO 8601 date) for the employee.
    Example: 2026-12-31

  - `payroll.hours` (array)
    All the hours for the requested payroll application, grouped by employee and department.

  - `payroll.hours.date` (string)
    Example: 2026-12-31

  - `payroll.hours.department` (object | null)
    Information about the department for which the hours were registered. (Nullable).

  - `payroll.hours.department.id` (integer | null)
    The unique department id.
    Example: 2

  - `payroll.hours.department.name` (string | null)
    The name of the department.
    Example: Support

  - `payroll.hours.department.costCenter` (object | null)
    Information about the cost center associated with the department.

  - `payroll.hours.department.costCenter.id` (integer | null)
    The unique cost center id.
    Example: 1

  - `payroll.hours.department.costCenter.name` (string | null)
    The name of the cost center.
    Example: Support

  - `payroll.hours.department.costCenter.code` (string | null)
    The code of the cost center.
    Example: 123

  - `payroll.hours.office` (object)
    Information about the office where the hours were registered.

  - `payroll.hours.office.id` (integer)
    The unique office id.
    Example: 1

  - `payroll.hours.office.name` (string)
    The name of the office.
    Example: Den-Haag

  - `payroll.hours.office.costCenter` (object)
    Information about the cost center associated with the office.

  - `payroll.hours.office.costCenter.id` (integer | null)
    The unique cost center id.
    Example: 1

  - `payroll.hours.office.costCenter.name` (string | null)
    The name of the cost center.
    Example: Main

  - `payroll.hours.office.costCenter.code` (string | null)
    The code of the cost center.
    Example: 12

## Response 401 fields (application/json):

  - `title` (string, required)
    Short, human-readable summary of the error.
    Example: Unauthorized

  - `status` (integer, required)
    The HTTP status code.
    Example: 401

  - `message` (string, required)
    Human-readable explanation of this occurrence of the error.
    Example: Invalid Token

  - `detail` (string)
    Human-readable explanation of this occurrence. Not returned by all backend versions.
    Example: Invalid Token

  - `code` (integer)
    The HTTP status code (duplicate of `status`). Not returned by all backend versions.
    Example: 401

## Response 403 fields (application/json):

  - `title` (string, required)
    Short, human-readable summary of the error.
    Example: Unauthorized

  - `status` (integer, required)
    The HTTP status code.
    Example: 401

  - `message` (string, required)
    Human-readable explanation of this occurrence of the error.
    Example: Invalid Token

  - `detail` (string)
    Human-readable explanation of this occurrence. Not returned by all backend versions.
    Example: Invalid Token

  - `code` (integer)
    The HTTP status code (duplicate of `status`). Not returned by all backend versions.
    Example: 401

## Response 404 fields (application/json):

  - `title` (string, required)
    Short, human-readable summary of the error.
    Example: Unauthorized

  - `status` (integer, required)
    The HTTP status code.
    Example: 401

  - `message` (string, required)
    Human-readable explanation of this occurrence of the error.
    Example: Invalid Token

  - `detail` (string)
    Human-readable explanation of this occurrence. Not returned by all backend versions.
    Example: Invalid Token

  - `code` (integer)
    The HTTP status code (duplicate of `status`). Not returned by all backend versions.
    Example: 401

