Replace the organisation's statutory leave policies
sickness covers statutory sick pay, familyLeave every family-leave payment, and byType overrides either for one statutory type. A policy’s salaryTreatment is DeductAbsentDays (the salary for the days on leave is taken back with a separate line; optional topUp.tiers pay a share of salary, statutory pay included, for a duration from the start of the leave such as { "value": 6, "unit": "Week" }) or FullPay (the days on leave are taken back and topped up to 100% for the whole leave). Every employee is re-previewed on any open pay run.
curl --request PUT \
--url https://api.sandbox.flowpayroll.ai/v1/salary/organisation/leave \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>' \
--data '
{
"sickness": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"familyLeave": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"byType": {
"StatutoryMaternityPay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryPaternityPay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryAdoptionPay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutorySharedParentalPay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryParentalBereavementPay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryNeoNatalCarePay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
}
}
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/salary/organisation/leave"
payload = {
"sickness": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"familyLeave": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"byType": {
"StatutoryMaternityPay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"StatutoryPaternityPay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"StatutoryAdoptionPay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"StatutorySharedParentalPay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"StatutoryParentalBereavementPay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"StatutoryNeoNatalCarePay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } }
}
}
headers = {
"X-Auth-Token": "<api-key>",
"X-Org-Id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Auth-Token': '<api-key>',
'X-Org-Id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sickness: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
familyLeave: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
byType: {
StatutoryMaternityPay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
StatutoryPaternityPay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
StatutoryAdoptionPay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
StatutorySharedParentalPay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
StatutoryParentalBereavementPay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
StatutoryNeoNatalCarePay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}}
}
})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/salary/organisation/leave', 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/v1/salary/organisation/leave",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sickness' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'familyLeave' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'byType' => [
'StatutoryMaternityPay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'StatutoryPaternityPay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'StatutoryAdoptionPay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'StatutorySharedParentalPay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'StatutoryParentalBereavementPay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'StatutoryNeoNatalCarePay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>",
"X-Org-Id: <api-key>"
],
]);
$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/v1/salary/organisation/leave"
payload := strings.NewReader("{\n \"sickness\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"familyLeave\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"byType\": {\n \"StatutoryMaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryPaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryAdoptionPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutorySharedParentalPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryParentalBereavementPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryNeoNatalCarePay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("X-Org-Id", "<api-key>")
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.put("https://api.sandbox.flowpayroll.ai/v1/salary/organisation/leave")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sickness\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"familyLeave\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"byType\": {\n \"StatutoryMaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryPaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryAdoptionPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutorySharedParentalPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryParentalBereavementPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryNeoNatalCarePay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/salary/organisation/leave")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Auth-Token"] = '<api-key>'
request["X-Org-Id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sickness\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"familyLeave\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"byType\": {\n \"StatutoryMaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryPaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryAdoptionPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutorySharedParentalPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryParentalBereavementPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryNeoNatalCarePay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": {
"policies": {
"sickness": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"familyLeave": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"byType": {
"StatutoryMaternityPay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryPaternityPay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryAdoptionPay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutorySharedParentalPay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryParentalBereavementPay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryNeoNatalCarePay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
}
}
},
"isDefault": true,
"effective": {
"StatutorySickPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutoryMaternityPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutoryPaternityPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutoryAdoptionPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutorySharedParentalPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutoryParentalBereavementPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutoryNeoNatalCarePay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
}
},
"createdBy": "<string>",
"createdDate": "<string>",
"updatedBy": "<string>",
"updatedDate": "<string>"
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}Authorizations
FlowPayroll JWT (raw token, no Bearer prefix)
Organisation to scope the request to. Required when the principal can access more than one organisation; optional for single-organisation principals (the authorizer resolves it automatically).
Body
What happens to a salaried employee's salary on the days they are paid statutory pay, for an organisation or as one employee's override. sickness covers StatutorySickPay. familyLeave covers StatutoryMaternityPay, StatutoryPaternityPay, StatutoryAdoptionPay, StatutorySharedParentalPay, StatutoryParentalBereavementPay and StatutoryNeoNatalCarePay. byType sets an exception for one of those six. Every part is optional; for each type the first that is set applies: the employee's byType entry, the employee's family, the organisation's byType entry, the organisation's family, then the default (the salary for the days on leave is deducted and nothing is topped up).
What happens to the salary on the days a statutory type pays for.
Show child attributes
Show child attributes
What happens to the salary on the days a statutory type pays for.
Show child attributes
Show child attributes
One optional policy per family-leave type. Keyed by the statutory type's own name, as the statutory service spells it, so a generated client gets one typed field per type rather than an open map a typo can slip into.
Show child attributes
Show child attributes
Was this page helpful?
curl --request PUT \
--url https://api.sandbox.flowpayroll.ai/v1/salary/organisation/leave \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>' \
--data '
{
"sickness": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"familyLeave": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"byType": {
"StatutoryMaternityPay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryPaternityPay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryAdoptionPay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutorySharedParentalPay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryParentalBereavementPay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryNeoNatalCarePay": {
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
}
}
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/salary/organisation/leave"
payload = {
"sickness": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"familyLeave": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"byType": {
"StatutoryMaternityPay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"StatutoryPaternityPay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"StatutoryAdoptionPay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"StatutorySharedParentalPay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"StatutoryParentalBereavementPay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } },
"StatutoryNeoNatalCarePay": { "topUp": { "tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
] } }
}
}
headers = {
"X-Auth-Token": "<api-key>",
"X-Org-Id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Auth-Token': '<api-key>',
'X-Org-Id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sickness: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
familyLeave: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
byType: {
StatutoryMaternityPay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
StatutoryPaternityPay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
StatutoryAdoptionPay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
StatutorySharedParentalPay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
StatutoryParentalBereavementPay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}},
StatutoryNeoNatalCarePay: {topUp: {tiers: [{duration: {value: 123, unit: 'Week'}, percentOfSalary: 123}]}}
}
})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/salary/organisation/leave', 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/v1/salary/organisation/leave",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sickness' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'familyLeave' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'byType' => [
'StatutoryMaternityPay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'StatutoryPaternityPay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'StatutoryAdoptionPay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'StatutorySharedParentalPay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'StatutoryParentalBereavementPay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
],
'StatutoryNeoNatalCarePay' => [
'topUp' => [
'tiers' => [
[
'duration' => [
'value' => 123,
'unit' => 'Week'
],
'percentOfSalary' => 123
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>",
"X-Org-Id: <api-key>"
],
]);
$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/v1/salary/organisation/leave"
payload := strings.NewReader("{\n \"sickness\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"familyLeave\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"byType\": {\n \"StatutoryMaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryPaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryAdoptionPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutorySharedParentalPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryParentalBereavementPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryNeoNatalCarePay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("X-Org-Id", "<api-key>")
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.put("https://api.sandbox.flowpayroll.ai/v1/salary/organisation/leave")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sickness\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"familyLeave\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"byType\": {\n \"StatutoryMaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryPaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryAdoptionPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutorySharedParentalPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryParentalBereavementPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryNeoNatalCarePay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/salary/organisation/leave")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Auth-Token"] = '<api-key>'
request["X-Org-Id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sickness\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"familyLeave\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"byType\": {\n \"StatutoryMaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryPaternityPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryAdoptionPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutorySharedParentalPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryParentalBereavementPay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n },\n \"StatutoryNeoNatalCarePay\": {\n \"topUp\": {\n \"tiers\": [\n {\n \"duration\": {\n \"value\": 123,\n \"unit\": \"Week\"\n },\n \"percentOfSalary\": 123\n }\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": {
"policies": {
"sickness": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"familyLeave": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"byType": {
"StatutoryMaternityPay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryPaternityPay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryAdoptionPay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutorySharedParentalPay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryParentalBereavementPay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"StatutoryNeoNatalCarePay": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
}
}
},
"isDefault": true,
"effective": {
"StatutorySickPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutoryMaternityPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutoryPaternityPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutoryAdoptionPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutorySharedParentalPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutoryParentalBereavementPay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
},
"StatutoryNeoNatalCarePay": {
"policy": {
"salaryTreatment": "DeductAbsentDays",
"topUp": {
"tiers": [
{
"duration": {
"value": 123,
"unit": "Week"
},
"percentOfSalary": 123
}
]
}
},
"source": "Default"
}
},
"createdBy": "<string>",
"createdDate": "<string>",
"updatedBy": "<string>",
"updatedDate": "<string>"
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}