# PostInitiatePayrollRunByPayrollAdministrationId
Initiate payroll run (verlonen)
__Activity name :__ PostInitiatePayrollRunByPayrollAdministrationId This is a controller endpoint to perform an action.
In the older Loket GUI this specific action is referred to as respectively 'Verlonen' / 'Verlonen periode zonder personeel' / 'Verlonen voorgaande jaren' . If this action is performed succesfully then the payroll run will be created with status 0 and will be cued for further processing. The further processing depends on the input parameters and the payroll configuration in the given situation. After the initiated run has been picked up and processed by the background process, then the status of the run will be changed accordingly.
This action may be performed for all payroll periods that are *available for the payroll administration* AND that meet one of the following requirements;
If typeOfInitiation = 'regular' (Verlonen);
* The very last payroll period for which an approved payroll run (status = 9) is available. Within the given year of payrolling. (This would functionally be a so-called 'correction' run)
* The very first payroll period in time that does not yet have an approved payroll run (i.e. last payroll period with approved run + 1). Within the given year of payrolling, if available
* The provided year may be a maximum of 7 years in the past (based on current datetime)
If typeOfInitiation = 'withoutEmploymentData' (Verlonen zonder personeel);
* The very first payroll period in time that does not yet have an approved payroll run (i.e. last payroll period with approved run + 1). Within the active year of payrolling
* Please note that if this type is selected then the following fields must ALL be set to null; sendEmailToEmployee, textPaySlip, textTariffPaySlip, textPayment, emailAdressPayrollRunStarted, emailFinishedPayrollRun
In general;
* It is not possible to initiate a new payroll run if there is currently a payroll run with status 0 (to be processed) or 1 (awaiting approval) within the payroll administation.
__Metadata :__ No metadata endpoint available for this controller endpoint.
__Defaults :__ Defaults endpoint is available for this controller endpoint by adding /defaults. Also, an endpoint is available to retrieve initiation values for a specific period.
Select loket.nl (REST) API URL: /providers/employers/payrolladministrations/{payrollAdministrationId}/payrollruns/initiate
Insert loket.nl (REST) API URL: /providers/employers/payrolladministrations/{payrollAdministrationId}/payrollruns/initiate
Update loket.nl (REST) API URL: /providers/employers/payrolladministrations/{payrollAdministrationId}/payrollruns/initiate
Delete loket.nl (REST) API URL: /providers/employers/payrolladministrations/{payrollAdministrationId}/payrollruns/initiate
Select loket.nl (REST) API Operation: post /providers/employers/payrolladministrations/{payrollAdministrationId}/payrollruns/initiate
- Catalog: `LoketNlRest`
- Schema: `InitiatePayrollRun`
- Field Selection Method: NotRequired
This is a read-only table function. The loket.nl (REST) API may not support changing the data or the Invantive SQL driver for loket.nl (REST) does not cover it. In the latter case, please use the table NativePlatformScalarRequests to upload data to the loket.nl (REST) API.
## Parameters of Table Function
| Name | Data Type | Required | Default Value | Documentation |
|---|:---:|:---:|:---:|---|
| `body` | `string` | ☑ | | Initiate Payroll Run Payload. |
| `payrollAdministrationId` | `guid` | ☑ | | The unique identifier of an administration |
## Columns of Table Function
The columns of the table function `PostInitiatePayrollRunByPayrollAdministrationId` are shown below. Each column has an SQL data type.
| Name | Data Type | Label | Required | Documentation |
|---|:---:|---|:---:|---|
| `content_id` | `guid` | | ☐ | The unique identifier (GUID/UUID) of the payroll run. |
| `RESULT` | `string` | | ☐ | Outcome of operation as single plain text column. |