Get all payslips by pay run
Retrieves all payslips for a specific pay run identified by payroll config ID, year, and period. The frequency is automatically determined from the payroll configuration. Supports pagination for large result sets. Supports gzip compression — send Accept: application/gzip header to receive compressed responses for better performance with large datasets. Small responses are returned as normal JSON. Clients decompress automatically via the Content-Encoding: gzip header.
curl --request GET \
--url https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period} \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period}"
headers = {
"X-Auth-Token": "<api-key>",
"X-Org-Id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>', 'X-Org-Id': '<api-key>'}};
fetch('https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period}', 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/payslip/payrun/{payrollConfigId}/{year}/{period}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("X-Org-Id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period}")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Auth-Token"] = '<api-key>'
request["X-Org-Id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": {
"text": "Payslips by Pay Run Retrieved",
"token": "getPayslipsByPayRunRetrieved"
},
"content": {
"data": [
{
"employeeDetails": {
"id": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM",
"name": {
"title": "Mr",
"firstName": "John",
"lastName": "Doe",
"initials": "JD"
},
"address": {
"line1": "123 Main Street",
"line2": "Apartment 4B",
"city": "London",
"county": "Greater London",
"postcode": "SW1A 1AA",
"countryCode": "GB"
},
"birthDate": "1980-01-12",
"birthGender": "Male",
"payrollId": "PAY123",
"employeeCode": "EMP001",
"hoursWorkedCategory": "Above30Hours",
"taxCode": {
"code": "1257L",
"effectiveDate": "2024-04-06",
"reason": "Standard tax code",
"issuedBy": "HMRC",
"week1Month1": false
},
"nationalInsuranceCategory": "A",
"nationalInsuranceNumber": "AB123456C",
"passportNumber": "123456789",
"starterDetails": {
"startDate": "2024-01-15",
"starterDeclaration": "ThisIsMyOnlyJob",
"secondedDetails": {
"stayStatus": "Stay183DaysOrMore",
"eEACitizen": true,
"ePM6": false
},
"alreadySentToHmrcFps": false
},
"studentDetails": {
"studentLoanDetails": {
"loanType": "Plan2",
"startDate": "2020-09-01",
"endDate": "2023-06-30"
},
"postgraduateLoanDetails": {
"loanType": "PostgraduateLoan",
"startDate": "2023-09-01",
"endDate": "2024-06-30"
}
},
"directorDetails": {
"directorsNICType": "Annual",
"appointmentDate": "2024-01-15"
},
"leaverDetails": {
"leavingDate": "2024-12-31",
"reason": "Retirement",
"issuedBy": "Employer"
},
"workplaceDetails": {
"workplacePostcode": "SW1A 1AA"
},
"bankAccounts": [
{
"accountNumber": "12345678",
"sortCode": "123456",
"accountHolderName": "John Doe",
"isPrimaryPayrollAccount": true,
"allocationPercentage": 100
}
]
},
"employerDetails": {
"id": "LOAD_TEST",
"organisationInformation": {
"organisationId": "ORG123456789",
"name": {
"legalName": "Acme Corporation Ltd",
"tradingName": "Acme Corp"
},
"organisationType": "LimitedCompany",
"companyRegistrationNumber": "12345678",
"businessType": "LimitedCompany",
"registredOfficeAddress": {
"line1": "456 Business Park",
"line2": "Suite 100",
"city": "Manchester",
"county": "Greater Manchester",
"postcode": "M1 1AA",
"countryCode": "GB"
},
"correspondenceAddress": {
"line1": "456 Business Park",
"line2": "Suite 100",
"city": "Manchester",
"county": "Greater Manchester",
"postcode": "M1 1AA",
"countryCode": "GB"
},
"companyContactDetails": {
"name": "HR Department",
"email": "hr@acme.com",
"phone": "0161 123 4567"
},
"primaryContactDetails": {
"name": "John Smith",
"email": "john.smith@acme.com",
"phone": "0161 123 4568"
},
"createdBy": "System",
"createdDate": "2024-01-01T00:00:00.000Z",
"updatedBy": "System",
"updatedDate": "2024-01-01T00:00:00.000Z"
},
"taxReferenceNumbers": {
"employerPayeReference": {
"officeNumber": "123",
"referenceNumber": "AB12345"
},
"accountsOfficeReference": "123PX00123456",
"selfAssessmentUniqueTaxpayerReference": "1234567890",
"corporationTaxReferenceUniqueTaxpayerReference": "1234567890"
}
},
"year": 2024,
"period": 2,
"payrollConfigId": "01JNR9P81W74HYCN35X1EEFDZE",
"frequency": "Monthly",
"summaryItems": [
{
"id": "PAYLINE-01JPW80Q2B5B76SQ2K56BZ3DHA",
"description": "Regular Hours",
"amount": 306,
"type": "Employee",
"category": "Earnings",
"payElementId": "base_salary"
},
{
"id": "PAYLINE-01JPW80Q2B5B76SQ2K56BZ3DHA2",
"description": "Basic Tax",
"amount": -45.2,
"type": "Employee",
"category": "Deductions",
"payElementId": "tax"
}
],
"forPeriod": {
"gross": 306,
"grossTaxable": 306,
"grossNi": 306,
"tax": 45.2,
"ni": 25.3,
"employerNi": 35.4,
"studentLoan": 0,
"postgraduateLoan": 0,
"net": 235.5
},
"yearToDate": {
"gross": 612,
"grossTaxable": 612,
"grossNi": 612,
"tax": 90.4,
"ni": 50.6,
"employerNi": 70.8,
"studentLoan": 0,
"postgraduateLoan": 0,
"net": 471
},
"createdDate": "2025-03-21T14:17:19.076Z",
"createdBy": "System",
"updatedDate": "2025-03-21T14:17:19.076Z",
"updatedBy": "System",
"status": "Final",
"paymentDate": "2024-02-28",
"payPeriodStartDate": "2024-02-01",
"payPeriodEndDate": "2024-02-29",
"lateReason": null
}
],
"metadata": {
"paginationToken": "eyJvcmdhbmlzYXRpb25JZCI6Ik9SRzEyMzQ1Njc4OSIsInBhZ2VTaXplIjo1MCwibGFzdEV2YWx1YXRlZEtleSI6eyJvcmdhbmlzYXRpb25JZCI6eyJTIjoiT1JHMjEyMzQ1Njc4OSJ9LCJzb3J0S2V5Ijp7IlMiOiJFTVAwMUpQVzhRMnE3UVlHUlJZMjlWR0M4V00jMjAyNC0wMyJ9fX0="
}
}
}{
"message": {
"text": "Payroll Config Not Found",
"token": "payrollConfigNotFound",
"tokenArguments": [
{
"name": "payrollConfigId",
"value": "01JNR9P81W74HYCN35X1EEFDZE"
}
]
}
}{
"message": {
"text": "Internal Server Error for requestId req-123456",
"token": "getPayslipsByPayRunInternalServerError",
"tokenArguments": [
{
"name": "requestId",
"value": "req-123456"
}
]
}
}Authorizations
Access token obtained from OAuth2 client credentials flow
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).
Path Parameters
ID of the payroll configuration
Year of the pay run
Pay period number within the year
Query Parameters
Maximum number of payslips to return per page (default is 50, max 10000). Fewer may be returned when the page would exceed the response size limit; always follow paginationToken rather than treating a short page as the last one.
1 <= x <= 10000Whether to include attachment URLs on payslip summary items. Set to false for faster bulk loading when attachments are not needed.
Response
Payslips by pay run retrieved successfully
The response is of type any.
Was this page helpful?
curl --request GET \
--url https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period} \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period}"
headers = {
"X-Auth-Token": "<api-key>",
"X-Org-Id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>', 'X-Org-Id': '<api-key>'}};
fetch('https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period}', 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/payslip/payrun/{payrollConfigId}/{year}/{period}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("X-Org-Id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period}")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/payslip/payrun/{payrollConfigId}/{year}/{period}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Auth-Token"] = '<api-key>'
request["X-Org-Id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": {
"text": "Payslips by Pay Run Retrieved",
"token": "getPayslipsByPayRunRetrieved"
},
"content": {
"data": [
{
"employeeDetails": {
"id": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM",
"name": {
"title": "Mr",
"firstName": "John",
"lastName": "Doe",
"initials": "JD"
},
"address": {
"line1": "123 Main Street",
"line2": "Apartment 4B",
"city": "London",
"county": "Greater London",
"postcode": "SW1A 1AA",
"countryCode": "GB"
},
"birthDate": "1980-01-12",
"birthGender": "Male",
"payrollId": "PAY123",
"employeeCode": "EMP001",
"hoursWorkedCategory": "Above30Hours",
"taxCode": {
"code": "1257L",
"effectiveDate": "2024-04-06",
"reason": "Standard tax code",
"issuedBy": "HMRC",
"week1Month1": false
},
"nationalInsuranceCategory": "A",
"nationalInsuranceNumber": "AB123456C",
"passportNumber": "123456789",
"starterDetails": {
"startDate": "2024-01-15",
"starterDeclaration": "ThisIsMyOnlyJob",
"secondedDetails": {
"stayStatus": "Stay183DaysOrMore",
"eEACitizen": true,
"ePM6": false
},
"alreadySentToHmrcFps": false
},
"studentDetails": {
"studentLoanDetails": {
"loanType": "Plan2",
"startDate": "2020-09-01",
"endDate": "2023-06-30"
},
"postgraduateLoanDetails": {
"loanType": "PostgraduateLoan",
"startDate": "2023-09-01",
"endDate": "2024-06-30"
}
},
"directorDetails": {
"directorsNICType": "Annual",
"appointmentDate": "2024-01-15"
},
"leaverDetails": {
"leavingDate": "2024-12-31",
"reason": "Retirement",
"issuedBy": "Employer"
},
"workplaceDetails": {
"workplacePostcode": "SW1A 1AA"
},
"bankAccounts": [
{
"accountNumber": "12345678",
"sortCode": "123456",
"accountHolderName": "John Doe",
"isPrimaryPayrollAccount": true,
"allocationPercentage": 100
}
]
},
"employerDetails": {
"id": "LOAD_TEST",
"organisationInformation": {
"organisationId": "ORG123456789",
"name": {
"legalName": "Acme Corporation Ltd",
"tradingName": "Acme Corp"
},
"organisationType": "LimitedCompany",
"companyRegistrationNumber": "12345678",
"businessType": "LimitedCompany",
"registredOfficeAddress": {
"line1": "456 Business Park",
"line2": "Suite 100",
"city": "Manchester",
"county": "Greater Manchester",
"postcode": "M1 1AA",
"countryCode": "GB"
},
"correspondenceAddress": {
"line1": "456 Business Park",
"line2": "Suite 100",
"city": "Manchester",
"county": "Greater Manchester",
"postcode": "M1 1AA",
"countryCode": "GB"
},
"companyContactDetails": {
"name": "HR Department",
"email": "hr@acme.com",
"phone": "0161 123 4567"
},
"primaryContactDetails": {
"name": "John Smith",
"email": "john.smith@acme.com",
"phone": "0161 123 4568"
},
"createdBy": "System",
"createdDate": "2024-01-01T00:00:00.000Z",
"updatedBy": "System",
"updatedDate": "2024-01-01T00:00:00.000Z"
},
"taxReferenceNumbers": {
"employerPayeReference": {
"officeNumber": "123",
"referenceNumber": "AB12345"
},
"accountsOfficeReference": "123PX00123456",
"selfAssessmentUniqueTaxpayerReference": "1234567890",
"corporationTaxReferenceUniqueTaxpayerReference": "1234567890"
}
},
"year": 2024,
"period": 2,
"payrollConfigId": "01JNR9P81W74HYCN35X1EEFDZE",
"frequency": "Monthly",
"summaryItems": [
{
"id": "PAYLINE-01JPW80Q2B5B76SQ2K56BZ3DHA",
"description": "Regular Hours",
"amount": 306,
"type": "Employee",
"category": "Earnings",
"payElementId": "base_salary"
},
{
"id": "PAYLINE-01JPW80Q2B5B76SQ2K56BZ3DHA2",
"description": "Basic Tax",
"amount": -45.2,
"type": "Employee",
"category": "Deductions",
"payElementId": "tax"
}
],
"forPeriod": {
"gross": 306,
"grossTaxable": 306,
"grossNi": 306,
"tax": 45.2,
"ni": 25.3,
"employerNi": 35.4,
"studentLoan": 0,
"postgraduateLoan": 0,
"net": 235.5
},
"yearToDate": {
"gross": 612,
"grossTaxable": 612,
"grossNi": 612,
"tax": 90.4,
"ni": 50.6,
"employerNi": 70.8,
"studentLoan": 0,
"postgraduateLoan": 0,
"net": 471
},
"createdDate": "2025-03-21T14:17:19.076Z",
"createdBy": "System",
"updatedDate": "2025-03-21T14:17:19.076Z",
"updatedBy": "System",
"status": "Final",
"paymentDate": "2024-02-28",
"payPeriodStartDate": "2024-02-01",
"payPeriodEndDate": "2024-02-29",
"lateReason": null
}
],
"metadata": {
"paginationToken": "eyJvcmdhbmlzYXRpb25JZCI6Ik9SRzEyMzQ1Njc4OSIsInBhZ2VTaXplIjo1MCwibGFzdEV2YWx1YXRlZEtleSI6eyJvcmdhbmlzYXRpb25JZCI6eyJTIjoiT1JHMjEyMzQ1Njc4OSJ9LCJzb3J0S2V5Ijp7IlMiOiJFTVAwMUpQVzhRMnE3UVlHUlJZMjlWR0M4V00jMjAyNC0wMyJ9fX0="
}
}
}{
"message": {
"text": "Payroll Config Not Found",
"token": "payrollConfigNotFound",
"tokenArguments": [
{
"name": "payrollConfigId",
"value": "01JNR9P81W74HYCN35X1EEFDZE"
}
]
}
}{
"message": {
"text": "Internal Server Error for requestId req-123456",
"token": "getPayslipsByPayRunInternalServerError",
"tokenArguments": [
{
"name": "requestId",
"value": "req-123456"
}
]
}
}