Employees

Employee related endpoints are used to manage employee data in payroll.

Required query parameters for employees.

  • companyUid - Uid of a platform.
  • employeeUid - Uid of an employee.

Employee

When using the Zenegy API, it is possible to set up CRUD operations for employee profiles.

Each profile consists of three parts: Base, Employment, and Salary Data. The API allows for the management of all three parts.


Retrieve employees

The API provides several endpoints to fetch employee data. For general data retrieval, we advise using the following endpoints:

Get employees array

Get employee bases.
This endpoint can be used to get a list of employee base data as an array.

Filter and sort parameters

Data filtering parameters

Name Description
skip The index(position) from which to start getting records
take Number of records to return
filterPhrase String to search employees by name, employee number or cpr
departmentUids List of department uids to filter only employees that are part of them
salaryPayoutPeriod Salary payout periods
types Employee types
salaryType Salary types
incomeType Income types
employeeSortBy Sorts employees by the system available options
filterBy Filters employees by their status

Sorting parameters

Name ID
EmployeeName 1
EmployeeNumber 2

Status filtering parameters

Name ID
All 0
Active 1
Pending 2
Resigned 3

Retrieve full employee details

Get employee details.
This endpoint can be used to get the full details of an employee.

The returned properties can not be limited and will always return the full details of the employee, if another endpoint in the Payroll API has the needed properties, consider using that endpoint instead.


Create and update employee(s)

🚧

Before you proceed

Many properties on an employee are directly connected to Zenegy's logic for Global value sets and Global values, using create and update methods via the API without knowledge of this logic is not advised.

Read more about Global values and sets.

The API has several endpoints for employee profile creation, making it possible only to create single profiles with simple data, bulk-create, or fully detailed single profiles.

All endpoints have the same required properties for the creation of a profile:

  • CPR number of the employee.
  • Name of employee.
  • Employee's address.
  • Employee's Postal code.
  • Employee's city.
  • Employment date.
  • Seniority date.

Be aware that if an employee number is absent in the request, the system automatically generates one using the CPR number. For example, a CPR of 0101991212 will become an employee number like 01-01-91-xxxx.

Create a single employee

Post employee
This endpoint can be used to create a single employee. Employees can be created as simple or full profiles, depending on the values posted in the request.

📘

Simple or full profile

Depending on the values posted in the request this endpoint can be used to create a simple or a full profile. A simple profile lacks some properties required for a payroll, while a full profile includes all necessary properties.

Full profile properties
Name Description GV/S
cpr CPR number, 10 characters :x:
name Name of Employee :x:
address Address of Employee :x:
city City of Employee address :x:
postalNumber Postal Number of Employee address :x:
employmentDate Employment date of Employee :x:
seniorityDate Seniority date of Employee :x:
countryCode Country code, 2 characters :x:
companyCvrNumber Company CVR :x:
mobilePhone Must match this regex pattern @"^[+]?\d+\s?\d*$" :x:
email Must match this regex pattern @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" :x:
pNumber 10 characters, all digits :x:
atpType ATP types :white-check-mark:
employeeLanguage Employee Language :white-check-mark:
salaryType Salary types :white-check-mark:
salaryMode Salary modes :white-check-mark:
incomeType Income types :white-check-mark:
tax Tax cards :white-check-mark:
revenueType Employee types :white-check-mark:
maternityType Maternity types :white-check-mark:
insuranceCategory Insurance category :white-check-mark:
benefitPackageAmountType Pension value types :white-check-mark:
holidayPaymentType Pension value types :white-check-mark:
benefitPackageType Benefit package types :white-check-mark:
benefitPackageTwoType Benefit package types :white-check-mark:

GV/S properties are directly connected to Global values and sets.
Ensure all parties using the service are aware of the missing properties when creating simple profiles.

Bulk create employees

Post employees
This endpoint can be used to create several employees in a single bulk request.

The response for succesfull requests will contain an array of the UID, employee number and second employee number of the created employees.


Update Employee profile

🚧

Updating simple profiles

When updating a simple profile, it is advised to include all properties required for a full profile.

Full profile properties
Name Description GV/S
cpr CPR number, 10 characters :x:
name Name of Employee :x:
address Address of Employee :x:
city City of Employee address :x:
postalNumber Postal Number of Employee address :x:
employmentDate Employment date of Employee :x:
seniorityDate Seniority date of Employee :x:
countryCode Country code, 2 characters :x:
companyCvrNumber Company CVR :x:
mobilePhone Must match this regex pattern @"^[+]?\d+\s?\d*$" :x:
email Must match this regex pattern @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" :x:
pNumber 10 characters, all digits :x:
atpType ATP types :white-check-mark:
employeeLanguage Employee Language :white-check-mark:
salaryType Salary types :white-check-mark:
salaryMode Salary modes :white-check-mark:
incomeType Income types :white-check-mark:
tax Tax cards :white-check-mark:
revenueType Employee types :white-check-mark:
maternityType Maternity types :white-check-mark:
insuranceCategory Insurance category :white-check-mark:
benefitPackageAmountType Pension value types :white-check-mark:
holidayPaymentType Pension value types :white-check-mark:
benefitPackageType Benefit package types :white-check-mark:
benefitPackageTwoType Benefit package types :white-check-mark:

GV/S properties are directly connected to Global values and sets.

PATCH employee.
Expand the "path values" collapsible to see all possible values for the "path" property.

This endpoint can be used to update single or multiple properties on an employee. Only properties to be updated should be added to the payload, including other properties will cause errors in employee data
The response will not return any information when a patch request is executed. This also includes patching Global value properties.

Patching a global value will not update the data on the profile, and no error will be returned.

[
    {
        "value": "value",
        "path": "/Property",
        "op": "replace",
    }
]

Delete employees

Delete employee.

This endpoint can be used to delete a single employee from a company.
Only employees who have yet to be a part of a payroll run can be deleted. Employees that have been in a payroll run should be handled as a resignation

Deleted data cannot be restored.


Tax cards

All employee tax cards for a company can be read via the endpoint for company tax card messages.
Specific employee profile tax-cards can be read via the endpoint for employee tax card.

The response from the company-wide endpoint is filtered using OData, and the request query can be adjusted using specific filtering parameters.

Filtering parameters
Name Description
Id id
Uid Uid
CreatedOn Created on
ValidFrom Valid from
TaxPercentage Tax percentage
TypeOfCard Type of tax card response
Status Employee Tax message status
FairDeductionMainCard Day deduction
UgefradragMainCard Seven day deduction
FourteenDayDeductionMainCard Fourteen day deduction
MonthlyDeductionMainCard Monthly deduction
FreeCardDeduction Free card deduction

API request example using OData filter

http://localhost:55500/api/companies/0551578b-e0a0-4943-8fa6-8ad6d29c33d0/employees/4aefcbc9-9314-4e3e-b3e7-ea8357173ba1/taxcards?$filter=TypeOfCard eq '1'

Enum definitions

Employee types

NameID
Employee1
Consultant2

Salary types

NameIDDescription
Fixed1Fixed paid
TimePaidWithHoliday2Hourly paid with holiday pay
TimePaidWithoutHoliday3Hourly paid without holiday pay
CasualWorker4Casual worker

Salary modes

NameIDDescription
Hourly0Hourly paid employee - normal salary mode
Fixed1Hourly paid employee - fixed salary mode
Combined2Hourly paid employee - combined mode

Income types

NameIDDescription
AIncomeReceiver0A-income recipient/salaried (code 00)
OtherPersonalIncome4Other personal income/unsalaried (code 04)
BIncomeReceiver5B-income recipient/unsalaried (code 05)
ScientistIncomeReceiver8§ 48 e (tax scheme for foreign researchers et al.) (code 08)
TaxFreeIncome9Tax-free income (code 09)
OtherPersonalIncomeWithoutWithholding24A-income recipient/Salaried without wage withholding (code 24)

Salary payout periods

NameIDDescription
Monthly1Monthly salary (paid in advance)
FourteenDays2Biweekly pay is used for employees who are paid every 14 days
Backward4Monthly salary (paid in arrears)

ATP types

NameIDDescription
A0Almindelig (A)
None1None

Employee Language

NameIDDescription
da0Danish
en1English

Maternity types

NameIDDescription
None0None
BarselDk1Barsel.dk (Standard)
DaBarsel2DA Maternity
BarselDkPartial3Barsel.dk - Partial member
Other4Other foundation

Insurance category

NameIDDescription
Other0Production staff and all other employee types that can not be placed in the following five job categories
Office1Administrative work without physical contact and without driving
SalesAndService2Sellers and other employees with physical customer contact, with or without driving
Management3Leaders or managers and supervisors without any repercussions or production work
InternalService4People who perform internal service in their own business. e.g. canteens, cleaning, storage and maintenance inside and outside
Driver5Employees engaged in driving with goods, animals or people
None6Empty insurance category

Pension value types

NameIDDescription
Percentage0Percentage
Fixed1Set amount per payroll

Benefit package types

NameIDDescription
None0None
Saving1Money is collected in an account
Payment2Money is straightforwardly transferred

Tax cards

NameIDDescription
None0None
Main1Primary tax card
Secondary2Secondary tax card
NoTax4No tax card (55% is automatically deducted in tax at source)

Type of tax card response

NameIDDescription
None0None
GrossPullCard1Gross tax card
Motherboard2Primary tax card
Frikort3Tax exemption card
Secondary4Secondary tax card
MotherboardWithSeparatePercent6Primary tax card with a separate tax rate
SecondaryWithSeparatePercent7Secondary tax card with a separate tax rate

Employee tax message status

NameID
Pending0
Completed1
Error2