Enrol an employee
Needs permission pension:write.
Associates an employee with a pension group, recording the enrolment date.
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension \
--header 'Content-Type: application/json' \
--data '
{
"employeeId": "<string>",
"pensionGroupId": "<string>",
"enrolmentDate": "2023-12-25",
"acknowledgeBelowAutoEnrolmentMinimum": true,
"effectiveFrom": "2023-12-25",
"sendLetters": true
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension"
payload = {
"employeeId": "<string>",
"pensionGroupId": "<string>",
"enrolmentDate": "2023-12-25",
"acknowledgeBelowAutoEnrolmentMinimum": True,
"effectiveFrom": "2023-12-25",
"sendLetters": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
employeeId: '<string>',
pensionGroupId: '<string>',
enrolmentDate: '2023-12-25',
acknowledgeBelowAutoEnrolmentMinimum: true,
effectiveFrom: '2023-12-25',
sendLetters: true
})
};
fetch('https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'employeeId' => '<string>',
'pensionGroupId' => '<string>',
'enrolmentDate' => '2023-12-25',
'acknowledgeBelowAutoEnrolmentMinimum' => true,
'effectiveFrom' => '2023-12-25',
'sendLetters' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension"
payload := strings.NewReader("{\n \"employeeId\": \"<string>\",\n \"pensionGroupId\": \"<string>\",\n \"enrolmentDate\": \"2023-12-25\",\n \"acknowledgeBelowAutoEnrolmentMinimum\": true,\n \"effectiveFrom\": \"2023-12-25\",\n \"sendLetters\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension")
.header("Content-Type", "application/json")
.body("{\n \"employeeId\": \"<string>\",\n \"pensionGroupId\": \"<string>\",\n \"enrolmentDate\": \"2023-12-25\",\n \"acknowledgeBelowAutoEnrolmentMinimum\": true,\n \"effectiveFrom\": \"2023-12-25\",\n \"sendLetters\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"employeeId\": \"<string>\",\n \"pensionGroupId\": \"<string>\",\n \"enrolmentDate\": \"2023-12-25\",\n \"acknowledgeBelowAutoEnrolmentMinimum\": true,\n \"effectiveFrom\": \"2023-12-25\",\n \"sendLetters\": true\n}"
response = http.request(request)
puts response.read_body{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": {
"organisationId": "<string>",
"employeeId": "<string>",
"pensionGroupId": "<string>",
"enrolmentDate": "2023-12-25",
"createdBy": "<string>",
"createdDate": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"updatedDate": "2023-11-07T05:31:56Z",
"recurringContributionOverride": {
"contributionType": "Percentage",
"employeeFactor": 123,
"employerFactor": 123,
"employeeFixedAmount": 123,
"employerFixedAmount": 123
},
"recurringAdditionalVoluntaryContribution": {
"contributionType": "Percentage",
"value": 123
},
"enrolmentInformationSentDate": "2023-12-25",
"enrolmentInformationSentBy": "<string>",
"enrolmentLetter": {
"lastEmailedAt": "2023-11-07T05:31:56Z",
"lastEmailedBy": "<string>",
"lastEmailedStatus": "Sending",
"lastEmailedTo": "<string>",
"lastEmailError": "<string>"
}
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}Body
When this change takes effect (yyyy-MM-dd). A pay run uses whatever was in force on its pay period end date, so pay runs whose pay period ends before this date keep what they had. Without it, the change takes effect from the latest pay run still open, so an earlier open pay run keeps what it had.
Optional. What brought the employee into the pension. It decides the letter they are sent
and whether they may opt out.
Duty: the law requires you to put them in (the last pay run assessed them as an
eligible jobholder); automatic enrolment done by hand, with the right to opt out. Refused
while their automatic enrolment is postponed, and once 12 months have passed since they left
at their own request (until your next re-enrolment date).
Notice: they asked in writing; their latest assessment decides whether it is an
opt-in or a joining request. Refused when there is no current assessment (never assessed,
postponed or exempt): send OptIn or Join instead. Notice,
OptIn and Join are refused for an employee whose recorded exemption leaves no
right to opt in or join: under notice of termination, a winding-up lump sum in the last 12
months, a director without a contract of employment, or an office holder.
OptIn: they asked in writing and earn more than the lower level of qualifying
earnings for their pay period; they may opt out. Refused when the latest assessment says
otherwise.
Join: they asked in writing and earn no more than that level; no right to opt out.
Refused when the latest assessment says otherwise.
Contract: you are enrolling them under their contract; no right to opt out. Refused
for an employee assessed as an eligible jobholder whose membership starts after that
assessment's date: they are owed automatic enrolment, so send Duty.
PreviousAutomaticEnrolment: they were enrolled automatically before this payroll
assessed them (a member carried over from another payroll); they may opt out. Refused when
a pay run has assessed them on or before the enrolment date.
Sent on an existing membership it corrects how they joined. When omitted, a new membership
is worked out from the assessment and an existing one keeps what is recorded.
Notice, Contract, Duty, OptIn, Join, PreviousAutomaticEnrolment Response
OK
The response envelope every FlowPayroll API answers with: a message, the
content, and any validationIssues. errors and the top-level
metadata are deprecated copies of validationIssues and
content.metadata, and will be removed.
Was this page helpful?
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension \
--header 'Content-Type: application/json' \
--data '
{
"employeeId": "<string>",
"pensionGroupId": "<string>",
"enrolmentDate": "2023-12-25",
"acknowledgeBelowAutoEnrolmentMinimum": true,
"effectiveFrom": "2023-12-25",
"sendLetters": true
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension"
payload = {
"employeeId": "<string>",
"pensionGroupId": "<string>",
"enrolmentDate": "2023-12-25",
"acknowledgeBelowAutoEnrolmentMinimum": True,
"effectiveFrom": "2023-12-25",
"sendLetters": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
employeeId: '<string>',
pensionGroupId: '<string>',
enrolmentDate: '2023-12-25',
acknowledgeBelowAutoEnrolmentMinimum: true,
effectiveFrom: '2023-12-25',
sendLetters: true
})
};
fetch('https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'employeeId' => '<string>',
'pensionGroupId' => '<string>',
'enrolmentDate' => '2023-12-25',
'acknowledgeBelowAutoEnrolmentMinimum' => true,
'effectiveFrom' => '2023-12-25',
'sendLetters' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension"
payload := strings.NewReader("{\n \"employeeId\": \"<string>\",\n \"pensionGroupId\": \"<string>\",\n \"enrolmentDate\": \"2023-12-25\",\n \"acknowledgeBelowAutoEnrolmentMinimum\": true,\n \"effectiveFrom\": \"2023-12-25\",\n \"sendLetters\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension")
.header("Content-Type", "application/json")
.body("{\n \"employeeId\": \"<string>\",\n \"pensionGroupId\": \"<string>\",\n \"enrolmentDate\": \"2023-12-25\",\n \"acknowledgeBelowAutoEnrolmentMinimum\": true,\n \"effectiveFrom\": \"2023-12-25\",\n \"sendLetters\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"employeeId\": \"<string>\",\n \"pensionGroupId\": \"<string>\",\n \"enrolmentDate\": \"2023-12-25\",\n \"acknowledgeBelowAutoEnrolmentMinimum\": true,\n \"effectiveFrom\": \"2023-12-25\",\n \"sendLetters\": true\n}"
response = http.request(request)
puts response.read_body{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": {
"organisationId": "<string>",
"employeeId": "<string>",
"pensionGroupId": "<string>",
"enrolmentDate": "2023-12-25",
"createdBy": "<string>",
"createdDate": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"updatedDate": "2023-11-07T05:31:56Z",
"recurringContributionOverride": {
"contributionType": "Percentage",
"employeeFactor": 123,
"employerFactor": 123,
"employeeFixedAmount": 123,
"employerFixedAmount": 123
},
"recurringAdditionalVoluntaryContribution": {
"contributionType": "Percentage",
"value": 123
},
"enrolmentInformationSentDate": "2023-12-25",
"enrolmentInformationSentBy": "<string>",
"enrolmentLetter": {
"lastEmailedAt": "2023-11-07T05:31:56Z",
"lastEmailedBy": "<string>",
"lastEmailedStatus": "Sending",
"lastEmailedTo": "<string>",
"lastEmailError": "<string>"
}
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}