/home/desid573/public_html/payment/xero-2/docs/v2/payroll_uk
Edit: /home/desid573/public_html/payment/xero-2/docs/v2/payroll_uk/index.html (1019401B)
Xero Payroll UK
xero-php-oauth2 PayrollUk SDK Docs
PayrollUk
approveTimesheet
Approves a specific timesheet
/Timesheets/{TimesheetID}/Approve
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$timesheetID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->approveTimesheet($xeroTenantId, $timesheetID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->approveTimesheet: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.timesheets
Grant read-write access to payroll timesheets
Parameters
Path parameters
Name
Description
TimesheetID*
UUID
(uuid)
Identifier for the timesheet
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
createBenefit
Creates a new employee benefit
/Benefits
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$benefit = new XeroAPI\XeroPHP\Models\PayrollUk\Benefit;
$benefit->setName('Benefit Name');
$benefit->setExpenseAccountID('00000000-0000-0000-0000-000000000000');
$benefit->setLiabilityAccountID('00000000-0000-0000-0000-000000000000');
$benefit->setIsCalculatingOnQualifyingEarnings(true);
try {
$result = $apiInstance->createBenefit($xeroTenantId, $benefit);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createBenefit: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
benefit *
createDeduction
Creates a new deduction
/Deductions
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$deduction = new XeroAPI\XeroPHP\Models\PayrollUk\Deduction;
$deduction->setDeductionName('Test Deduction');
$deduction->setDeductionCategory(XeroAPI\XeroPHP\Models\PayrollUk\Deduction\DeductionCategoryEnum.StakeholderPension);
$deduction->setLiabilityAccountId('00000000-0000-0000-0000-000000000000');
$deduction->setCalculationType(XeroAPI\XeroPHP\Models\PayrolUk\Deduction\CalculationTypeEnum.PercentageOfGross);
try {
$result = $apiInstance->createDeduction($xeroTenantId, $deduction);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createDeduction: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
deduction *
createEarningsRate
Creates a new earnings rate
/EarningsRates
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$earningsRate = new XeroAPI\XeroPHP\Models\PayrollUk\EarningsRate;
$earningsRate->setEarningsType(XeroAPI\XeroPHP\Models\PayrollUk\EarningsRate\EarningsTypeEnum.RegularEarnings);
$earningsRate->setRateType(XeroAPI\XeroPHP\Models\PayrollUk\EarningsRate\RateTypeEnum.RatePerUnit);
$earningsRate->setExpenseAccountID('00000000-0000-0000-0000-000000000000');
$earningsRate->setTypeOfUnits('Type');
try {
$result = $apiInstance->createEarningsRate($xeroTenantId, $earningsRate);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createEarningsRate: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
earningsRate *
createEmployee
Creates employees
/Employees
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$dateOfBirth = new DateTime('2000-10-28');
$address = new XeroAPI\XeroPHP\Models\PayrollUk\Address;
$address->setAddressLine1('123 Test st');
$address->setCity('Rangiora');
$address->setPostCode('7400');
$address->setCountryName('UNITED KINGDOM');
$employee = new XeroAPI\XeroPHP\Models\PayrollUk\Employee;
$employee->setFirstName('Adam');
$employee->setLastName('Adamson');
$employee->setDateOfBirth($dateOfBirth);
$employee->setAddress($address);
try {
$result = $apiInstance->createEmployee($xeroTenantId, $employee);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createEmployee: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
employee *
createEmployeeEarningsTemplate
Creates an earnings template records for a specific employee
/Employees/{EmployeeID}/PayTemplates/earnings
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$earningsTemplate = new XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate;
$earningsTemplate->setPayTemplateEarningID('00000000-0000-0000-0000-000000000000');
$earningsTemplate->setRatePerUnit(14.25);
$earningsTemplate->setNumberOfUnits(35.5);
$earningsTemplate->setFixedAmount(50);
$earningsTemplate->setEarningsRateID('00000000-0000-0000-0000-000000000000');
$earningsTemplate->setName('Overtime Hours');
$earningsTemplates = [];
array_push($earningsTemplates, $earningsTemplate);
try {
$result = $apiInstance->createEmployeeEarningsTemplate($xeroTenantId, $employeeID, $earningsTemplate);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createEmployeeEarningsTemplate: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
earningsTemplate *
createEmployeeLeave
Creates leave records for a specific employee
/Employees/{EmployeeID}/Leave
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$startDate = new DateTime('2020-10-28');
$endDate = new DateTime('2020-10-30');
$employeeLeave = new XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave;
$employeeLeave->setLeaveTypeID('00000000-0000-0000-0000-000000000000');
$employeeLeave->setStartDate($startDate);
$employeeLeave->setEndDate($endDate);
try {
$result = $apiInstance->createEmployeeLeave($xeroTenantId, $employeeID, $employeeLeave);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createEmployeeLeave: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
employeeLeave *
createEmployeeLeaveType
Creates employee leave type records
/Employees/{EmployeeID}/LeaveTypes
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$employeeLeaveType = new XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveType;
$employeeLeaveType->setLeaveTypeID('00000000-0000-0000-0000-000000000000');
$employeeLeaveType->setScheduleOfAccrual(XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveType\ScheduleOfAccrualEnum.BeginningOfCalendarYear);
$employeeLeaveType->setOpeningBalance(5.25);
try {
$result = $apiInstance->createEmployeeLeaveType($xeroTenantId, $employeeID, $employeeLeaveType);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createEmployeeLeaveType: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
employeeLeaveType *
createEmployeeOpeningBalances
Creates an opening balance for a specific employee
/Employees/{EmployeeID}/ukopeningbalances
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$employeeOpeningBalances = new XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances;
$employeeOpeningBalances->setStatutoryMaternityPay(0.0);
$employeeOpeningBalances->setStatutoryAdoptionPay(100.0);
$employeeOpeningBalances->setStatutoryPaternityPay(0.0);
$employeeOpeningBalances->setStatutorySharedParentalPay(0.0);
$employeeOpeningBalances->setStatutorySickPay(0.0);
try {
$result = $apiInstance->createEmployeeOpeningBalances($xeroTenantId, $employeeID, $employeeOpeningBalances);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createEmployeeOpeningBalances: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
employeeOpeningBalances *
createEmployeePaymentMethod
Creates an employee payment method
/Employees/{EmployeeID}/PaymentMethods
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$bankAccount = new XeroAPI\XeroPHP\Models\PayrollUk\BankAccount;
$bankAccount->setAccountName('Charlotte Danes');
$bankAccount->setAccountNumber('123456');
$bankAccount->setSortCode('123411');
$bankAccounts = [];
array_push($bankAccounts, $bankAccount);
$paymentMethod = new XeroAPI\XeroPHP\Models\PayrollUk\PaymentMethod;
$paymentMethod->setBankAccounts($bankAccounts);
try {
$result = $apiInstance->createEmployeePaymentMethod($xeroTenantId, $employeeID, $paymentMethod);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createEmployeePaymentMethod: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
paymentMethod *
createEmployeeSalaryAndWage
Creates a salary and wage record for a specific employee
/Employees/{EmployeeID}/SalaryAndWages
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$salaryAndWage = new XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage;
$salaryAndWage->setEarningsRateID('00000000-0000-0000-0000-000000000000');
$salaryAndWage->setNumberOfUnitsPerDay(0);
$salaryAndWage->setNumberOfUnitsPerWeek(0);
$salaryAndWage->setPaymentType(XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage\PaymentTypeEnum.SALARY);
$salaryAndWage->setStatus(XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage\StatusEnum.ACTIVE);
try {
$result = $apiInstance->createEmployeeSalaryAndWage($xeroTenantId, $employeeID, $salaryAndWage);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createEmployeeSalaryAndWage: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
salaryAndWage *
createEmployeeStatutorySickLeave
Creates statutory sick leave records
/StatutoryLeaves/Sick
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$startDate = new DateTime('2020-10-28');
$endDate = new DateTime('2020-10-30');
$employeeStatutorySickLeave = new XeroAPI\XeroPHP\Models\PayrollUk\EmployeeStatutorySickLeave;
$employeeStatutorySickLeave->setIsPregnancyRelated(true);
$employeeStatutorySickLeave->setLeaveTypeID('00000000-0000-0000-0000-000000000000');
$employeeStatutorySickLeave->setStartDate($startDate);
$employeeStatutorySickLeave->setEndDate($endDate);
try {
$result = $apiInstance->createEmployeeStatutorySickLeave($xeroTenantId, $employeeStatutorySickLeave);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createEmployeeStatutorySickLeave: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
employeeStatutorySickLeave *
EmployeeStatutorySickLeave
Required
createEmployment
Creates employment detail for a specific employee using a unique employee ID
/Employees/{EmployeeID}/Employment
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$startDate = new DateTime('2020-10-28');
$employment = new XeroAPI\XeroPHP\Models\PayrollUk\Employment;
$employment->setPayrollCalendarID('00000000-0000-0000-0000-000000000000');
$employment->setStartDate($startDate);
try {
$result = $apiInstance->createEmployment($xeroTenantId, $employeeID, $employment);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createEmployment: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
employment *
createLeaveType
Creates a new leave type
/LeaveTypes
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$leaveType = new XeroAPI\XeroPHP\Models\PayrollUk\LeaveType;
$leaveType->setName('LeaveType');
$leaveType->setIsPaidLeave(true);
$leaveType->setShowOnPayslip(true);
try {
$result = $apiInstance->createLeaveType($xeroTenantId, $leaveType);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createLeaveType: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
leaveType *
createMultipleEmployeeEarningsTemplate
Creates multiple earnings template records for a specific employee using a unique employee ID
/Employees/{EmployeeID}/paytemplateearnings
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$earningsTemplate = new XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate;
$earningsTemplate->setPayTemplateEarningID('00000000-0000-0000-0000-000000000000');
$earningsTemplate->setRatePerUnit(14.25);
$earningsTemplate->setNumberOfUnits(35.5);
$earningsTemplate->setFixedAmount(50);
$earningsTemplate->setEarningsRateID('00000000-0000-0000-0000-000000000000');
$earningsTemplate->setName('Overtime Hours');
$earningsTemplates = [];
array_push($earningsTemplates, $earningsTemplate);
try {
$result = $apiInstance->createMultipleEmployeeEarningsTemplate($xeroTenantId, $employeeID, $earningsTemplate);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createMultipleEmployeeEarningsTemplate: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
earningsTemplate *
createPayRunCalendar
Creates a new payrun calendar
/PayRunCalendars
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$startDate = new DateTime('2020-10-28');
$paymentDate = new DateTime('2020-10-30');
$payRunCalendar = new XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendar;
$payRunCalendar->setCalendarType(XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendar\CalendarTypeEnum.WEEKLY);
$payRunCalendar->setPeriodStartDate($startDate);
$payRunCalendar->setPaymentDate($paymentDate);
try {
$result = $apiInstance->createPayRunCalendar($xeroTenantId, $payRunCalendar);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createPayRunCalendar: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
payRunCalendar *
createReimbursement
Creates a new reimbursement
/Reimbursements
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$reimbursement = new XeroAPI\XeroPHP\Models\PayrollUk\Reimbursement;
$reimbursement->setName('Test Reimbursement');
$reimbursement->setAccountID('00000000-0000-0000-0000-000000000000');
try {
$result = $apiInstance->createReimbursement($xeroTenantId, $reimbursement);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createReimbursement: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
reimbursement *
createTimesheet
Creates a new timesheet
/Timesheets
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$startDate = new DateTime('2020-10-28');
$endDate = new DateTime('2020-10-30');
$timesheet = new XeroAPI\XeroPHP\Models\PayrollUk\Timesheet;
$timesheet->setPayrollCalendarID('00000000-0000-0000-0000-000000000000');
$timesheet->setEmployeeID('00000000-0000-0000-0000-000000000000');
$timesheet->setStartDate($startDate);
$timesheet->setEndDate($endDate);
try {
$result = $apiInstance->createTimesheet($xeroTenantId, $timesheet);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createTimesheet: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.timesheets
Grant read-write access to payroll timesheets
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
timesheet *
createTimesheetLine
Creates a new timesheet line for a specific timesheet using a unique timesheet ID
/Timesheets/{TimesheetID}/Lines
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$timesheetID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
$date = new DateTime('2020-10-28');
$timesheetLine = new XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine;
$timesheetLine->setTimesheetLineID('00000000-0000-0000-0000-000000000000');
$timesheetLine->setDate($date);
$timesheetLine->setEarningsRateID('00000000-0000-0000-0000-000000000000');
$timesheetLine->setTrackingItemID('00000000-0000-0000-0000-000000000000');
$timesheetLine->setNumberOfUnits(6);
try {
$result = $apiInstance->createTimesheetLine($xeroTenantId, $timesheetID, $timesheetLine);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->createTimesheetLine: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.timesheets
Grant read-write access to payroll timesheets
Parameters
Path parameters
Name
Description
TimesheetID*
UUID
(uuid)
Identifier for the timesheet
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
timesheetLine *
deleteEmployeeEarningsTemplate
Deletes a specific employee's earnings template record
/Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$payTemplateEarningID = "3fa85f64-5717-4562-b3fc-2c963f66afa6";
try {
$apiInstance->deleteEmployeeEarningsTemplate($xeroTenantId, $employeeID, $payTemplateEarningID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->deleteEmployeeEarningsTemplate: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
PayTemplateEarningID*
UUID
(uuid)
Id for single pay template earnings object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
deleteEmployeeLeave
Deletes a specific employee's leave record
/Employees/{EmployeeID}/Leave/{LeaveID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$leaveID = "c4be24e5-e840-4c92-9eaa-2d86cd596314";
try {
$result = $apiInstance->deleteEmployeeLeave($xeroTenantId, $employeeID, $leaveID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->deleteEmployeeLeave: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
LeaveID*
UUID
(uuid)
Leave id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
deleteEmployeeSalaryAndWage
Deletes a salary and wages record for a specific employee
/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$salaryAndWagesID = "3fa85f64-5717-4562-b3fc-2c963f66afa6";
try {
$apiInstance->deleteEmployeeSalaryAndWage($xeroTenantId, $employeeID, $salaryAndWagesID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->deleteEmployeeSalaryAndWage: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
SalaryAndWagesID*
UUID
(uuid)
Id for single salary and wages object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
deleteTimesheet
Deletes a specific timesheet
/Timesheets/{TimesheetID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$timesheetID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->deleteTimesheet($xeroTenantId, $timesheetID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->deleteTimesheet: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.timesheets
Grant read-write access to payroll timesheets
Parameters
Path parameters
Name
Description
TimesheetID*
UUID
(uuid)
Identifier for the timesheet
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
deleteTimesheetLine
Deletes a specific timesheet line
/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$timesheetID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
$timesheetLineID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->deleteTimesheetLine($xeroTenantId, $timesheetID, $timesheetLineID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->deleteTimesheetLine: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.timesheets
Grant read-write access to payroll timesheets
Parameters
Path parameters
Name
Description
TimesheetID*
UUID
(uuid)
Identifier for the timesheet
Required
TimesheetLineID*
UUID
(uuid)
Identifier for the timesheet line
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getBenefit
Retrieves a specific benefit by using a unique benefit ID
/Benefits/{id}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->getBenefit($xeroTenantId, $id);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getBenefit: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Path parameters
Name
Description
id*
UUID
(uuid)
Identifier for the benefit
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getBenefits
Retrieves employee benefits
/Benefits
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$page = 56;
try {
$result = $apiInstance->getBenefits($xeroTenantId, $page);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getBenefits: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
getDeduction
Retrieves a specific deduction by using a unique deduction ID
/Deductions/{deductionId}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$deductionId = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->getDeduction($xeroTenantId, $deductionId);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getDeduction: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Path parameters
Name
Description
deductionId*
UUID
(uuid)
Identifier for the deduction
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getDeductions
Retrieves deductions
/Deductions
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$page = 56;
try {
$result = $apiInstance->getDeductions($xeroTenantId, $page);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getDeductions: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
getEarningsOrder
Retrieves a specific earnings orders by using a unique earnings orders id
/EarningsOrders/{id}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->getEarningsOrder($xeroTenantId, $id);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEarningsOrder: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Path parameters
Name
Description
id*
UUID
(uuid)
Identifier for the deduction
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEarningsOrders
Retrieves earnings orders
/EarningsOrders
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$page = 56;
try {
$result = $apiInstance->getEarningsOrders($xeroTenantId, $page);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEarningsOrders: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
getEarningsRate
Retrieves a specific earnings rates by using a unique earnings rate id
/EarningsRates/{EarningsRateID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$earningsRateID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->getEarningsRate($xeroTenantId, $earningsRateID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEarningsRate: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Path parameters
Name
Description
EarningsRateID*
UUID
(uuid)
Identifier for the earnings rate
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEarningsRates
Retrieves earnings rates
/EarningsRates
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$page = 56;
try {
$result = $apiInstance->getEarningsRates($xeroTenantId, $page);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEarningsRates: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
getEmployee
Retrieves specific employees by using a unique employee ID
/Employees/{EmployeeID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
try {
$result = $apiInstance->getEmployee($xeroTenantId, $employeeID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployee: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployeeLeave
Retrieves a specific employee's leave record using a unique employee ID
/Employees/{EmployeeID}/Leave/{LeaveID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$leaveID = "c4be24e5-e840-4c92-9eaa-2d86cd596314";
try {
$result = $apiInstance->getEmployeeLeave($xeroTenantId, $employeeID, $leaveID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeLeave: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
LeaveID*
UUID
(uuid)
Leave id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployeeLeaveBalances
Retrieves a specific employee's leave balances using a unique employee ID
/Employees/{EmployeeID}/LeaveBalances
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
try {
$result = $apiInstance->getEmployeeLeaveBalances($xeroTenantId, $employeeID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeLeaveBalances: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployeeLeavePeriods
Retrieves a specific employee's leave periods using a unique employee ID
/Employees/{EmployeeID}/LeavePeriods
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "00000000-0000-0000-0000-000000000000";
$startDate = new DateTime("2013-10-20");
$endDate = new DateTime("2013-10-20");
try {
$result = $apiInstance->getEmployeeLeavePeriods($xeroTenantId, $employeeID, $startDate, $endDate);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeLeavePeriods: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
startDate
date
(date)
Filter by start date
endDate
date
(date)
Filter by end date
getEmployeeLeaveTypes
Retrieves a specific employee's leave types using a unique employee ID
/Employees/{EmployeeID}/LeaveTypes
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
try {
$result = $apiInstance->getEmployeeLeaveTypes($xeroTenantId, $employeeID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeLeaveTypes: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployeeLeaves
Retrieves a specific employee's leave records using a unique employee ID
/Employees/{EmployeeID}/Leave
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
try {
$result = $apiInstance->getEmployeeLeaves($xeroTenantId, $employeeID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeLeaves: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployeeOpeningBalances
Retrieves a specific employee's openingbalances using a unique employee ID
/Employees/{EmployeeID}/ukopeningbalances
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
try {
$result = $apiInstance->getEmployeeOpeningBalances($xeroTenantId, $employeeID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeOpeningBalances: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployeePayTemplate
Retrieves a specific employee pay templates using a unique employee ID
/Employees/{EmployeeID}/PayTemplates
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
try {
$result = $apiInstance->getEmployeePayTemplate($xeroTenantId, $employeeID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeePayTemplate: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployeePaymentMethod
Retrieves a specific employee's payment method using a unique employee ID
/Employees/{EmployeeID}/PaymentMethods
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
try {
$result = $apiInstance->getEmployeePaymentMethod($xeroTenantId, $employeeID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeePaymentMethod: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployeeSalaryAndWage
Retrieves a specific salary and wages record for a specific employee using a unique salary and wage id
/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$salaryAndWagesID = "3fa85f64-5717-4562-b3fc-2c963f66afa6";
try {
$result = $apiInstance->getEmployeeSalaryAndWage($xeroTenantId, $employeeID, $salaryAndWagesID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeSalaryAndWage: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
SalaryAndWagesID*
UUID
(uuid)
Id for single pay template earnings object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployeeSalaryAndWages
Retrieves a specific employee's salary and wages by using a unique employee ID
/Employees/{EmployeeID}/SalaryAndWages
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$page = 56;
try {
$result = $apiInstance->getEmployeeSalaryAndWages($xeroTenantId, $employeeID, $page);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeSalaryAndWages: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
getEmployeeStatutoryLeaveBalances
Retrieves a specific employee's leave balances using a unique employee ID
/Employees/{EmployeeID}/StatutoryLeaveBalance
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$leaveType = "sick";
$asOfDate = new DateTime("2013-10-20");
try {
$result = $apiInstance->getEmployeeStatutoryLeaveBalances($xeroTenantId, $employeeID, $leaveType, $asOfDate);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeStatutoryLeaveBalances: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
LeaveType
String
Filter by the type of statutory leave
AsOfDate
date
(date)
The date from which to calculate balance remaining. If not specified, current date UTC is used.
getEmployeeStatutorySickLeave
Retrieves a statutory sick leave for an employee
/StatutoryLeaves/Sick/{StatutorySickLeaveID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$statutorySickLeaveID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
try {
$result = $apiInstance->getEmployeeStatutorySickLeave($xeroTenantId, $statutorySickLeaveID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeStatutorySickLeave: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Path parameters
Name
Description
StatutorySickLeaveID*
UUID
(uuid)
Statutory sick leave id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployeeTax
Retrieves tax records for a specific employee using a unique employee ID
/Employees/{EmployeeID}/Tax
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
try {
$result = $apiInstance->getEmployeeTax($xeroTenantId, $employeeID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployeeTax: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getEmployees
Retrieves employees
/Employees
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$filter = "firstName==John,lastName==Smith";
$page = 5;
try {
$result = $apiInstance->getEmployees($xeroTenantId, $filter, $page);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getEmployees: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
payroll.employees.read
Grant read-only access to payroll employees
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
filter
String
Filter by first name and/or lastname
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
getLeaveType
Retrieves a specific leave type by using a unique leave type ID
/LeaveTypes/{LeaveTypeID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$leaveTypeID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->getLeaveType($xeroTenantId, $leaveTypeID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getLeaveType: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Path parameters
Name
Description
LeaveTypeID*
UUID
(uuid)
Identifier for the leave type
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getLeaveTypes
Retrieves leave types
/LeaveTypes
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$page = 56;
$activeOnly = true;
try {
$result = $apiInstance->getLeaveTypes($xeroTenantId, $page, $activeOnly);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getLeaveTypes: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
ActiveOnly
Boolean
Filters leave types by active status. By default the API returns all leave types.
getPayRun
Retrieves a specific pay run by using a unique pay run ID
/PayRuns/{PayRunID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$payRunID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->getPayRun($xeroTenantId, $payRunID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getPayRun: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.payruns
Grant read-write access to payroll payruns
payroll.payruns.read
Grant read-only access to payroll payruns
Parameters
Path parameters
Name
Description
PayRunID*
UUID
(uuid)
Identifier for the pay run
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getPayRunCalendar
Retrieves a specific payrun calendar by using a unique payrun calendar ID
/PayRunCalendars/{PayRunCalendarID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$payRunCalendarID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->getPayRunCalendar($xeroTenantId, $payRunCalendarID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getPayRunCalendar: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Path parameters
Name
Description
PayRunCalendarID*
UUID
(uuid)
Identifier for the payrun calendars
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getPayRunCalendars
Retrieves payrun calendars
/PayRunCalendars
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$page = 56;
try {
$result = $apiInstance->getPayRunCalendars($xeroTenantId, $page);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getPayRunCalendars: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
getPayRuns
Retrieves pay runs
/PayRuns
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$page = 56;
$status = "status_example";
try {
$result = $apiInstance->getPayRuns($xeroTenantId, $page, $status);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getPayRuns: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.payruns
Grant read-write access to payroll payruns
payroll.payruns.read
Grant read-only access to payroll payruns
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
status
String
By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status.
getPaySlip
Retrieves a specific payslip by using a unique payslip ID
/Payslips/{PayslipID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$payslipID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->getPaySlip($xeroTenantId, $payslipID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getPaySlip: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.payslip
Grant read-write access to payroll payslips
payroll.payslip.read
Grant read-only access to payroll payslips
Parameters
Path parameters
Name
Description
PayslipID*
UUID
(uuid)
Identifier for the payslip
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getPaySlips
Retrieves payslips
/Payslips
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$payRunID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
$page = 56;
try {
$result = $apiInstance->getPaySlips($xeroTenantId, $payRunID, $page);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getPaySlips: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.payslip
Grant read-write access to payroll payslips
payroll.payslip.read
Grant read-only access to payroll payslips
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
PayRunID*
UUID
(uuid)
PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun.
Required
getReimbursement
Retrieves a specific reimbursement by using a unique reimbursement id
/Reimbursements/{ReimbursementID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$reimbursementID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->getReimbursement($xeroTenantId, $reimbursementID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getReimbursement: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Path parameters
Name
Description
ReimbursementID*
UUID
(uuid)
Identifier for the reimbursement
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getReimbursements
Retrieves reimbursements
/Reimbursements
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$page = 56;
try {
$result = $apiInstance->getReimbursements($xeroTenantId, $page);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getReimbursements: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
getSettings
Retrieves payroll settings
/Settings
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
try {
$result = $apiInstance->getSettings($xeroTenantId);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getSettings: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getStatutoryLeaveSummary
Retrieves a specific employee's summary of statutory leaves using a unique employee ID
/StatutoryLeaves/Summary/{EmployeeID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$activeOnly = true;
try {
$result = $apiInstance->getStatutoryLeaveSummary($xeroTenantId, $employeeID, $activeOnly);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getStatutoryLeaveSummary: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
activeOnly
Boolean
Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned
getTimesheet
Retrieve a specific timesheet by using a unique timesheet ID
/Timesheets/{TimesheetID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$timesheetID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->getTimesheet($xeroTenantId, $timesheetID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getTimesheet: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.timesheets
Grant read-write access to payroll timesheets
payroll.timesheets.read
Grant read-only access to payroll timesheets
Parameters
Path parameters
Name
Description
TimesheetID*
UUID
(uuid)
Identifier for the timesheet
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
getTimesheets
Retrieves timesheets
/Timesheets
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$page = 5;
$filter = "employeeId==00000000-0000-0000-0000-000000000000,payrollCalendarId==00000000-0000-0000-0000-000000000000";
$status = "Draft";
$startDate = "2019-01-02";
$endDate = "2020-01-02";
$sort = "startDate";
try {
$result = $apiInstance->getTimesheets($xeroTenantId, $page, $filter, $status, $startDate, $endDate, $sort);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getTimesheets: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.timesheets
Grant read-write access to payroll timesheets
payroll.timesheets.read
Grant read-only access to payroll timesheets
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Query parameters
Name
Description
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.
filter
String
Filter by employeeId and/or payrollCalendarId
status
String
filter results by any timesheets with a matching timesheet status
startDate
String
filter results by any timesheets with a startDate on or after the provided date
endDate
String
filter results by any timesheets with a endDate on or before the provided date
sort
String
sort the order of timesheets returned. The default is based on the timesheets createdDate, sorted oldest to newest. Currently, the only other option is to reverse the order based on the timesheets startDate, sorted newest to oldest.
getTrackingCategories
Retrieves tracking categories
/Settings/trackingCategories
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
try {
$result = $apiInstance->getTrackingCategories($xeroTenantId);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->getTrackingCategories: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.settings
Grant read-write access to payroll settings
payroll.settings.read
Grant read-only access to payroll settings
Parameters
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
revertTimesheet
Reverts a specific timesheet to draft
/Timesheets/{TimesheetID}/RevertToDraft
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$timesheetID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
try {
$result = $apiInstance->revertTimesheet($xeroTenantId, $timesheetID);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->revertTimesheet: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.timesheets
Grant read-write access to payroll timesheets
Parameters
Path parameters
Name
Description
TimesheetID*
UUID
(uuid)
Identifier for the timesheet
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
updateEmployee
Updates a specific employee's detail
/Employees/{EmployeeID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$dateOfBirth = new DateTime('2000-10-28');
$address = new XeroAPI\XeroPHP\Models\PayrollUk\Address;
$address->setAddressLine1('123 Test st');
$address->setCity('Rangiora');
$address->setPostCode('7400');
$address->setCountryName('NEW ZEALAND');
$employee = new XeroAPI\XeroPHP\Models\PayrollUk\Employee;
$employee->setFirstName('Adam');
$employee->setLastName('Adamson');
$employee->setDateOfBirth($dateOfBirth);
$employee->setAddress($address);
try {
$result = $apiInstance->updateEmployee($xeroTenantId, $employeeID, $employee);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->updateEmployee: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
employee *
updateEmployeeEarningsTemplate
Updates a specific employee's earnings template records
/Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$payTemplateEarningID = "3fa85f64-5717-4562-b3fc-2c963f66afa6";
$earningsTemplate = new XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate;
$earningsTemplate->setPayTemplateEarningID('00000000-0000-0000-0000-000000000000');
$earningsTemplate->setRatePerUnit(14.25);
$earningsTemplate->setNumberOfUnits(35.5);
$earningsTemplate->setFixedAmount(50);
$earningsTemplate->setEarningsRateID('00000000-0000-0000-0000-000000000000');
$earningsTemplate->setName('Overtime Hours');
$earningsTemplates = [];
array_push($earningsTemplates, $earningsTemplate);
try {
$result = $apiInstance->updateEmployeeEarningsTemplate($xeroTenantId, $employeeID, $payTemplateEarningID, $earningsTemplate);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->updateEmployeeEarningsTemplate: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
PayTemplateEarningID*
UUID
(uuid)
Id for single pay template earnings object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
earningsTemplate *
updateEmployeeLeave
Updates a specific employee's leave records
/Employees/{EmployeeID}/Leave/{LeaveID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$leaveID = "c4be24e5-e840-4c92-9eaa-2d86cd596314";
$startDate = new DateTime('2020-10-28');
$endDate = new DateTime('2020-10-30');
$employeeLeave = new XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave;
$employeeLeave->setLeaveTypeID('00000000-0000-0000-0000-000000000000');
$employeeLeave->setStartDate($startDate);
$employeeLeave->setEndDate($endDate);
try {
$result = $apiInstance->updateEmployeeLeave($xeroTenantId, $employeeID, $leaveID, $employeeLeave);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->updateEmployeeLeave: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
LeaveID*
UUID
(uuid)
Leave id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
employeeLeave *
updateEmployeeOpeningBalances
Updates a specific employee's opening balances
/Employees/{EmployeeID}/ukopeningbalances
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$employeeOpeningBalances = new XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances;
$employeeOpeningBalances->setStatutoryMaternityPay(0.0);
$employeeOpeningBalances->setStatutoryAdoptionPay(100.0);
$employeeOpeningBalances->setStatutoryPaternityPay(0.0);
$employeeOpeningBalances->setStatutorySharedParentalPay(0.0);
$employeeOpeningBalances->setStatutorySickPay(0.0);
try {
$result = $apiInstance->updateEmployeeOpeningBalances($xeroTenantId, $employeeID, $employeeOpeningBalances);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->updateEmployeeOpeningBalances: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
employeeOpeningBalances *
updateEmployeeSalaryAndWage
Updates salary and wages record for a specific employee
/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$salaryAndWagesID = "3fa85f64-5717-4562-b3fc-2c963f66afa6";
$salaryAndWage = new XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage;
$salaryAndWage->setEarningsRateID('00000000-0000-0000-0000-000000000000');
$salaryAndWage->setNumberOfUnitsPerDay(0);
$salaryAndWage->setNumberOfUnitsPerWeek(0);
$salaryAndWage->setPaymentType(XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage\PaymentTypeEnum.SALARY);
$salaryAndWage->setStatus(XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage\StatusEnum.ACTIVE);
try {
$result = $apiInstance->updateEmployeeSalaryAndWage($xeroTenantId, $employeeID, $salaryAndWagesID, $salaryAndWage);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->updateEmployeeSalaryAndWage: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.employees
Grant read-write access to payroll employees
Parameters
Path parameters
Name
Description
EmployeeID*
UUID
(uuid)
Employee id for single object
Required
SalaryAndWagesID*
UUID
(uuid)
Id for single pay template earnings object
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
salaryAndWage *
updatePayRun
Updates a specific pay run
/PayRuns/{PayRunID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$payRunID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
$startDate = new DateTime('2020-10-28');
$paymentDate = new DateTime('2020-10-30');
$payRunCalendar = new XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendar;
$payRunCalendar->setCalendarType(XeroAPI\XeroPHP\Models\PayrollUk\CalendarType.WEEKLY);
$payRunCalendar->setPeriodStartDate($startDate);
$payRunCalendar->setPaymentDate($paymentDate);
try {
$result = $apiInstance->updatePayRun($xeroTenantId, $payRunID, $payRun);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->updatePayRun: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.payruns
Grant read-write access to payroll payruns
Parameters
Path parameters
Name
Description
PayRunID*
UUID
(uuid)
Identifier for the pay run
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
payRun *
updateTimesheetLine
Updates a specific timesheet line for a specific timesheet
/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}
Usage and SDK Samples
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\PayrollUkApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "xeroTenantId_example";
$timesheetID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
$timesheetLineID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
$date = new DateTime('2020-10-28');
$timesheetLine = new XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine;
$timesheetLine->setTimesheetLineID('00000000-0000-0000-0000-000000000000');
$timesheetLine->setDate($date);
$timesheetLine->setEarningsRateID('00000000-0000-0000-0000-000000000000');
$timesheetLine->setTrackingItemID('00000000-0000-0000-0000-000000000000');
$timesheetLine->setNumberOfUnits(6);
try {
$result = $apiInstance->updateTimesheetLine($xeroTenantId, $timesheetID, $timesheetLineID, $timesheetLine);
} catch (Exception $e) {
echo 'Exception when calling PayrollUkApi->updateTimesheetLine: ', $e->getMessage(), PHP_EOL;
}
?>
Scopes
payroll.timesheets
Grant read-write access to payroll timesheets
Parameters
Path parameters
Name
Description
TimesheetID*
UUID
(uuid)
Identifier for the timesheet
Required
TimesheetLineID*
UUID
(uuid)
Identifier for the timesheet line
Required
Header parameters
Name
Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name
Description
timesheetLine *