---
title: "Insert or update payroll period data"
method: PATCH
path: "/v2/providers/employers/employees/employments/{employmentId}/payrollperioddata"
tags: ["Payroll period data"]
---

# Insert or update payroll period data

`PATCH /v2/providers/employers/employees/employments/{employmentId}/payrollperioddata`

**This endpoint is the REST alternative to the ImporteerGegevens (Variabele Gegevens) SOAP webservice functionality**  <br/> <br/> __Activity name :__ PatchPayrollPeriodDataByEmploymentId <br/> <br/>         This endpoint is typically used by applications that are considered to be leading in regard to the values for the payroll components they manage. For most (external) applications this will the most viable endpoint to achieve that functionality. Loket considers these parties as not interested in the current state of the payroll period data in the Loket database. This endpoint is provided to make these scenarios easier to implement since no GET call is required to determine whether a POST or PUT call is to be performed to either insert or update payroll period data.
Based on the current state of the database Loket will either insert a new record or update the existing record with the supplied data.
* A new record is created when the combination of `payrollPeriod`, `shift`, `payslipType`, `distributionUnit`, `costCenter` and `costUnit` is valid and _does not_ exist for the employment. Next to that, the objects consisting of `payrollComponent`, `value` and `attribute` are inserted into the database. <br />
* An update is performed when the combination of `payrollPeriod`, `shift`, `payslipType`, `distributionUnit`, `costCenter` and `costUnit` _does_ exist for the employment. In that case the specified objects consisting of `payrollComponent`, `value` and `attribute` are inserted into the database, overwriting existing values. Existing records with a `payrollComponent.key` that is not supplied in the request are not modified. <br/> <br/> __Metadata :__ <br/> Possible values for fields of the type 'metadata' can be acquired (GET) by adding `/metadata` to the PATCH URL <br/> Possible values for fields of the type 'metadata' that are PERIOD-specific can be acquired (GET) by adding `/metadata/year/{year}/period/{periodNumber}` to the PATCH URL     <br/> <br/>   __Default values :__ <br/> Default values may be acquired by adding `/defaults` (GET) to the PATCH url . It is very much (!!!) recommended to acquire the defaults-objects first and use that information when inserting data for this employment. I.e. use the default values for costCenter, shift etcetera and the complement the object with the payroll components you want to provide. <br/> <br/>      __Extra background reading :__ <br/> It may be useful to read more about payroll period data (variabele gegevens, mutaties) on the Loket [helpdesk portal](https://helpdesk.loket.nl/hc/nl/articles/115003667669-Variabele-mutaties-Individuele-vastlegging). Please note that this information is in Dutch and access is required. <br/>

## Path parameters

- `employmentId` string, uuid, required

## Query parameters

- `filter` string
- `orderBy` string
- `pageNumber` integer
- `pageSize` integer

## Headers

- `Authorization` string, required
- `Accept` string, required

## Response `200`

OK

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/loket-acc/apis/loket-api.md) · [All operations](https://skmtc.net/loket-acc/apis/loket-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/loket-acc/loket-api/revisions/b32a42be97f7/schema)
