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.
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 name Name of Employee address Address of Employee city City of Employee address postalNumber Postal Number of Employee address employmentDate Employment date of Employee seniorityDate Seniority date of Employee countryCode Country code, 2 characters companyCvrNumber Company CVR mobilePhone Must match this regex pattern @"^[+]?\d+\s?\d*$" Must match this regex pattern @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" pNumber 10 characters, all digits atpType ATP types employeeLanguage Employee Language salaryType Salary types salaryMode Salary modes incomeType Income types tax Tax cards revenueType Employee types maternityType Maternity types insuranceCategory Insurance category benefitPackageAmountType Pension value types holidayPaymentType Pension value types benefitPackageType Benefit package types benefitPackageTwoType Benefit package types 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 name Name of Employee address Address of Employee city City of Employee address postalNumber Postal Number of Employee address employmentDate Employment date of Employee seniorityDate Seniority date of Employee countryCode Country code, 2 characters companyCvrNumber Company CVR mobilePhone Must match this regex pattern @"^[+]?\d+\s?\d*$" Must match this regex pattern @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$" pNumber 10 characters, all digits atpType ATP types employeeLanguage Employee Language salaryType Salary types salaryMode Salary modes incomeType Income types tax Tax cards revenueType Employee types maternityType Maternity types insuranceCategory Insurance category benefitPackageAmountType Pension value types holidayPaymentType Pension value types benefitPackageType Benefit package types benefitPackageTwoType Benefit package types 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
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
Name | ID |
---|---|
Employee | 1 |
Consultant | 2 |
Salary types
Name | ID | Description |
---|---|---|
Fixed | 1 | Fixed paid |
TimePaidWithHoliday | 2 | Hourly paid with holiday pay |
TimePaidWithoutHoliday | 3 | Hourly paid without holiday pay |
CasualWorker | 4 | Casual worker |
Salary modes
Name | ID | Description |
---|---|---|
Hourly | 0 | Hourly paid employee - normal salary mode |
Fixed | 1 | Hourly paid employee - fixed salary mode |
Combined | 2 | Hourly paid employee - combined mode |
Income types
Name | ID | Description |
---|---|---|
AIncomeReceiver | 0 | A-income recipient/salaried (code 00) |
OtherPersonalIncome | 4 | Other personal income/unsalaried (code 04) |
BIncomeReceiver | 5 | B-income recipient/unsalaried (code 05) |
ScientistIncomeReceiver | 8 | § 48 e (tax scheme for foreign researchers et al.) (code 08) |
TaxFreeIncome | 9 | Tax-free income (code 09) |
OtherPersonalIncomeWithoutWithholding | 24 | A-income recipient/Salaried without wage withholding (code 24) |
Salary payout periods
Name | ID | Description |
---|---|---|
Monthly | 1 | Monthly salary (paid in advance) |
FourteenDays | 2 | Biweekly pay is used for employees who are paid every 14 days |
Backward | 4 | Monthly salary (paid in arrears) |
ATP types
Name | ID | Description |
---|---|---|
A | 0 | Almindelig (A) |
None | 1 | None |
Employee Language
Name | ID | Description |
---|---|---|
da | 0 | Danish |
en | 1 | English |
Maternity types
Name | ID | Description |
---|---|---|
None | 0 | None |
BarselDk | 1 | Barsel.dk (Standard) |
DaBarsel | 2 | DA Maternity |
BarselDkPartial | 3 | Barsel.dk - Partial member |
Other | 4 | Other foundation |
Insurance category
Name | ID | Description |
---|---|---|
Other | 0 | Production staff and all other employee types that can not be placed in the following five job categories |
Office | 1 | Administrative work without physical contact and without driving |
SalesAndService | 2 | Sellers and other employees with physical customer contact, with or without driving |
Management | 3 | Leaders or managers and supervisors without any repercussions or production work |
InternalService | 4 | People who perform internal service in their own business. e.g. canteens, cleaning, storage and maintenance inside and outside |
Driver | 5 | Employees engaged in driving with goods, animals or people |
None | 6 | Empty insurance category |
Pension value types
Name | ID | Description |
---|---|---|
Percentage | 0 | Percentage |
Fixed | 1 | Set amount per payroll |
Benefit package types
Name | ID | Description |
---|---|---|
None | 0 | None |
Saving | 1 | Money is collected in an account |
Payment | 2 | Money is straightforwardly transferred |
Tax cards
Name | ID | Description |
---|---|---|
None | 0 | None |
Main | 1 | Primary tax card |
Secondary | 2 | Secondary tax card |
NoTax | 4 | No tax card (55% is automatically deducted in tax at source) |
Type of tax card response
Name | ID | Description |
---|---|---|
None | 0 | None |
GrossPullCard | 1 | Gross tax card |
Motherboard | 2 | Primary tax card |
Frikort | 3 | Tax exemption card |
Secondary | 4 | Secondary tax card |
MotherboardWithSeparatePercent | 6 | Primary tax card with a separate tax rate |
SecondaryWithSeparatePercent | 7 | Secondary tax card with a separate tax rate |
Employee tax message status
Name | ID |
---|---|
Pending | 0 |
Completed | 1 |
Error | 2 |
Updated 8 months ago