Xero Payroll AU API

PayrollAu

createEmployee

Creates a payroll employee


/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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$dateOfBirth = new DateTime('2000-10-28');

$homeAddress = new XeroAPI\XeroPHP\Models\PayrollAu\HomeAddress;
$homeAddress->setAddressLine1('123 Test st');
$homeAddress->setRegion('VIC');
$homeAddress->setPostalCode(3000);
$homeAddress->setCity('Melbourne');

$employee = new XeroAPI\XeroPHP\Models\PayrollAu\Employee;
$employee->setFirstName('Adam');
$employee->setLastName('Adamson');
$employee->setDateOfBirth($dateOfBirth);
$employee->setHomeAddress($homeAddress);

try {
  $result = $apiInstance->createEmployee($xeroTenantId, $employee);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->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 *
array[Employee]
Required

createLeaveApplication

Creates a leave application


/LeaveApplications

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$startDate = new DateTime('2020-10-28');
$endDate = new DateTime('2020-10-30');

$leaveApplication = new XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication;
$leaveApplication->setEmployeeId('00000000-0000-0000-0000-000000000000');
$leaveApplication->setLeaveTypeId('00000000-0000-0000-0000-000000000000');
$leaveApplication->setTitle('Annual Leave');
$leaveApplication->setStartDate($startDate);
$leaveApplication->setEndDate($endDate);

try {
  $result = $apiInstance->createLeaveApplication($xeroTenantId, $leaveApplication);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->createLeaveApplication: ', $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
leaveApplication *
array[LeaveApplication]
Required

createPayItem

Creates a pay item


/PayItems

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";

$earningsRate = new XeroAPI\XeroPHP\Models\PayrollAu\EarningsRate;
$earningsRate->setName('Ordinary Hours 123');
$earningsRate->setAccountCode('477');
$earningsRate->setTypeOfUnits('Hours');
$earningsRate->setIsExemptFromTax(true);
$earningsRate->setIsExemptFromSuper(true);
$earningsRate->setEarningsType(XeroAPI\XeroPHP\Models\PayrollAu\EarningsType::OVERTIMEEARNINGS);

$deductionType = new XeroAPI\XeroPHP\Models\PayrollAu\DeductionType;
$deductionType->setName('Union Fees');
$deductionType->setAccountCode('826');
$deductionType->setReducesTax(true);
$deductionType->setReducesSuper(true);

$leaveType = new XeroAPI\XeroPHP\Models\PayrollAu\LeaveType;
$leaveType->setName('Annual Leave');
$leaveType->setTypeOfUnits('Hours');
$leaveType->setIsPaidLeave(true);
$leaveType->setShowOnPayslip(true);

$reimbursementType = new XeroAPI\XeroPHP\Models\PayrollAu\ReimbursementType;
$reimbursementType->setName('Annual Leave');
$reimbursementType->setAccountCode('850');
$earningsRates = [];
array_push($earningsRates, $earningsRate);
$deductionTypes = [];
$leaveTypes = [];
array_push($leaveTypes, $leaveType);
$reimbursementTypes = [];
array_push($reimbursementTypes, $reimbursementType);

$payItem = new XeroAPI\XeroPHP\Models\PayrollAu\PayItem;
$payItem->setEarningsRates($earningsRates);
$payItem->setDeductionTypes($deductionTypes);
$payItem->setLeaveTypes($leaveTypes);
$payItem->setReimbursementTypes($reimbursementTypes);

try {
  $result = $apiInstance->createPayItem($xeroTenantId, $payItem);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->createPayItem: ', $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
payItem *
PayItem
Required

createPayRun

Creates a pay run


/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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";

$payRun = new XeroAPI\XeroPHP\Models\PayrollAu\PayRun;
$payRun->setPayrollCalendarID('00000000-0000-0000-0000-000000000000');

try {
  $result = $apiInstance->createPayRun($xeroTenantId, $payRun);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->createPayRun: ', $e->getMessage(), PHP_EOL;
}
?>

Scopes

payroll.payruns Grant read-write access to payroll payruns

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
payRun *
array[PayRun]
Required

createPayrollCalendar

Creates a Payroll Calendar


/PayrollCalendars

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$startDate = new DateTime('2020-10-28');
$paymentDate = new DateTime('2020-10-30');

$payrollCalendar = new XeroAPI\XeroPHP\Models\PayrollAu\PayrollCalendar;
$payrollCalendar->setName('Weekly');
$payrollCalendar->setCalendarType(XeroAPI\XeroPHP\Models\PayrollAu\CalendarType::WEEKLY);
$payrollCalendar->setStartDate($startDate);
$payrollCalendar->setPaymentDate($paymentDate);
$payrollCalendars = [];
array_push($payrollCalendars, $payrollCalendar);

try {
  $result = $apiInstance->createPayrollCalendar($xeroTenantId, $payrollCalendar);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->createPayrollCalendar: ', $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
payrollCalendar *
array[PayrollCalendar]
Required

createSuperfund

Creates a superfund


/Superfunds

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";

$superFund = new XeroAPI\XeroPHP\Models\PayrollAu\SuperFund;
$superfund->setType(XeroAPI\XeroPHP\Models\PayrollAu\SuperFundType::REGULATED);
$superfund->setUSI('40022701955002');

try {
  $result = $apiInstance->createSuperfund($xeroTenantId, $superFund);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->createSuperfund: ', $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
superFund *
array[SuperFund]
Required

createTimesheet

Creates a 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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$startDate = new DateTime('2020-10-23');
$endDate = new DateTime('2020-10-30');

$timesheet = new XeroAPI\XeroPHP\Models\PayrollAu\Timesheet;
$timesheet->setEmployeeID('00000000-0000-0000-0000-000000000000');
$timesheet->setStartDate($startDate);
$timesheet->setEndDate($endDate);
$timesheet->setStatus(XeroAPI\XeroPHP\Models\PayrollAu\TimesheetStatus::DRAFT);

try {
  $result = $apiInstance->createTimesheet($xeroTenantId, $timesheet);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->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 *
array[Timesheet]
Required

getEmployee

Retrieves an employee's detail by 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\PayrollAuApi(
    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 PayrollAuApi->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

getEmployees

Searches payroll 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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$ifModifiedSince = new DateTime("2020-02-06T12:17:43.202-08:00");
$where = "Status=="ACTIVE"";
$order = "EmailAddress%20DESC";
$page = 56;

try {
  $result = $apiInstance->getEmployees($xeroTenantId, $ifModifiedSince, $where, $order, $page);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 employees will be returned in a single API call

getLeaveApplication

Retrieves a leave application by a unique leave application id


/LeaveApplications/{LeaveApplicationID}

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$leaveApplicationID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";

try {
  $result = $apiInstance->getLeaveApplication($xeroTenantId, $leaveApplicationID);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->getLeaveApplication: ', $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
LeaveApplicationID*
UUID (uuid)
Leave Application id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getLeaveApplications

Retrieves leave applications


/LeaveApplications

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$ifModifiedSince = new DateTime("2020-02-06T12:17:43.202-08:00");
$where = "Status=="ACTIVE"";
$order = "EmailAddress%20DESC";
$page = 56;

try {
  $result = $apiInstance->getLeaveApplications($xeroTenantId, $ifModifiedSince, $where, $order, $page);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->getLeaveApplications: ', $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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 objects will be returned in a single API call

getPayItems

Retrieves pay items


/PayItems

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$ifModifiedSince = new DateTime("2020-02-06T12:17:43.202-08:00");
$where = "Status=="ACTIVE"";
$order = "EmailAddress%20DESC";
$page = 56;

try {
  $result = $apiInstance->getPayItems($xeroTenantId, $ifModifiedSince, $where, $order, $page);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->getPayItems: ', $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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 objects will be returned in a single API call

getPayRun

Retrieves a 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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$payRunID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";

try {
  $result = $apiInstance->getPayRun($xeroTenantId, $payRunID);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->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)
PayRun id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$ifModifiedSince = new DateTime("2020-02-06T12:17:43.202-08:00");
$where = "Status=="ACTIVE"";
$order = "EmailAddress%20DESC";
$page = 56;

try {
  $result = $apiInstance->getPayRuns($xeroTenantId, $ifModifiedSince, $where, $order, $page);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 PayRuns will be returned in a single API call

getPayrollCalendar

Retrieves payroll calendar by using a unique payroll calendar ID


/PayrollCalendars/{PayrollCalendarID}

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$payrollCalendarID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";

try {
  $result = $apiInstance->getPayrollCalendar($xeroTenantId, $payrollCalendarID);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->getPayrollCalendar: ', $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
PayrollCalendarID*
UUID (uuid)
Payroll Calendar id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getPayrollCalendars

Retrieves payroll calendars


/PayrollCalendars

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$ifModifiedSince = new DateTime("2020-02-06T12:17:43.202-08:00");
$where = "Status=="ACTIVE"";
$order = "EmailAddress%20DESC";
$page = 56;

try {
  $result = $apiInstance->getPayrollCalendars($xeroTenantId, $ifModifiedSince, $where, $order, $page);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->getPayrollCalendars: ', $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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 objects will be returned in a single API call

getPayslip

Retrieves for a payslip by a unique payslip id


/Payslip/{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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$payslipID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";

try {
  $result = $apiInstance->getPayslip($xeroTenantId, $payslipID);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->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)
Payslip id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";

try {
  $result = $apiInstance->getSettings($xeroTenantId);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->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

getSuperfund

Retrieves a superfund by using a unique superfund ID


/Superfunds/{SuperFundID}

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$superFundID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";

try {
  $result = $apiInstance->getSuperfund($xeroTenantId, $superFundID);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->getSuperfund: ', $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
SuperFundID*
UUID (uuid)
Superfund id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getSuperfundProducts

Retrieves superfund products


/SuperfundProducts

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$aBN = "40022701955";
$uSI = "OSF0001AU";

try {
  $result = $apiInstance->getSuperfundProducts($xeroTenantId, $aBN, $uSI);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->getSuperfundProducts: ', $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
ABN
String
The ABN of the Regulated SuperFund
USI
String
The USI of the Regulated SuperFund

getSuperfunds

Retrieves superfunds


/Superfunds

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$ifModifiedSince = new DateTime("2020-02-06T12:17:43.202-08:00");
$where = "Status=="ACTIVE"";
$order = "EmailAddress%20DESC";
$page = 56;

try {
  $result = $apiInstance->getSuperfunds($xeroTenantId, $ifModifiedSince, $where, $order, $page);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->getSuperfunds: ', $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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call

getTimesheet

Retrieves a 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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$timesheetID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";

try {
  $result = $apiInstance->getTimesheet($xeroTenantId, $timesheetID);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->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)
Timesheet id for single object
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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$ifModifiedSince = new DateTime("2020-02-06T12:17:43.202-08:00");
$where = "Status=="ACTIVE"";
$order = "EmailAddress%20DESC";
$page = 56;

try {
  $result = $apiInstance->getTimesheets($xeroTenantId, $ifModifiedSince, $where, $order, $page);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 timesheets will be returned in a single API call

updateEmployee

Updates an employee's detail

Update properties on a single employee


/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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$employeeID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$dateOfBirth = new DateTime('2000-10-28');

$homeAddress = new XeroAPI\XeroPHP\Models\PayrollAu\HomeAddress;
$homeAddress->setAddressLine1('123 Test st');
$homeAddress->setRegion('VIC');
$homeAddress->setPostalCode(3000);
$homeAddress->setCity('Melbourne');

$employee = new XeroAPI\XeroPHP\Models\PayrollAu\Employee;
$employee->setFirstName('Adam');
$employee->setLastName('Adamson');
$employee->setDateOfBirth($dateOfBirth);
$employee->setHomeAddress($homeAddress);

try {
  $result = $apiInstance->updateEmployee($xeroTenantId, $employeeID, $employee);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->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
array[Employee]

updateLeaveApplication

Updates a specific leave application


/LeaveApplications/{LeaveApplicationID}

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$leaveApplicationID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$startDate = new DateTime('2020-10-28');
$endDate = new DateTime('2020-10-30');

$leaveApplication = new XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication;
$leaveApplication->setEmployeeId('00000000-0000-0000-0000-000000000000');
$leaveApplication->setLeaveTypeId('00000000-0000-0000-0000-000000000000');
$leaveApplication->setTitle('Annual Leave');
$leaveApplication->setStartDate($startDate);
$leaveApplication->setEndDate($endDate);

try {
  $result = $apiInstance->updateLeaveApplication($xeroTenantId, $leaveApplicationID, $leaveApplication);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->updateLeaveApplication: ', $e->getMessage(), PHP_EOL;
}
?>

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
LeaveApplicationID*
UUID (uuid)
Leave Application id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
leaveApplication *
array[LeaveApplication]
Required

updatePayRun

Updates a pay run

Update properties on a single PayRun


/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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$payRunID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";

$payRun = new XeroAPI\XeroPHP\Models\PayrollAu\PayRun;
$payRun->setPayrollCalendarID('00000000-0000-0000-0000-000000000000');

try {
  $result = $apiInstance->updatePayRun($xeroTenantId, $payRunID, $payRun);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->updatePayRun: ', $e->getMessage(), PHP_EOL;
}
?>

Scopes

payroll.payruns Grant read-write access to payroll payruns

Parameters

Path parameters
Name Description
PayRunID*
UUID (uuid)
PayRun id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
payRun
array[PayRun]

updatePayslip

Updates a payslip

Update lines on a single payslips


/Payslip/{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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$payslipID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";

$earningsLine = new XeroAPI\XeroPHP\Models\PayrollAu\EarningsLine;
$earningsLine->setEarningsRateID('00000000-0000-0000-0000-000000000000');
$earningsLine->setRatePerUnit(20);
$earningsLine->setNumberOfUnits(1);
$earningsLines = [];
array_push($earningsLines, $earningsLine);

$payslipLine = new XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines;
$payslipLine->setEarningsLines(earningsLines);
$payslipLines = [];
array_push($payslipLines, $payslipLine);

try {
  $result = $apiInstance->updatePayslip($xeroTenantId, $payslipID, $payslipLines);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->updatePayslip: ', $e->getMessage(), PHP_EOL;
}
?>

Scopes

payroll.payslip Grant read-write access to payroll payslips

Parameters

Path parameters
Name Description
PayslipID*
UUID (uuid)
Payslip id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
payslipLines
array[PayslipLines]

updateSuperfund

Updates a superfund

Update properties on a single Superfund


/Superfunds/{SuperFundID}

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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$superFundID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";

$superFund = new XeroAPI\XeroPHP\Models\PayrollAu\SuperFund;
$superfund->setType(XeroAPI\XeroPHP\Models\PayrollAu\SuperFundType::REGULATED);
$superfund->setUSI('40022701955002');

try {
  $result = $apiInstance->updateSuperfund($xeroTenantId, $superFundID, $superFund);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->updateSuperfund: ', $e->getMessage(), PHP_EOL;
}
?>

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Path parameters
Name Description
SuperFundID*
UUID (uuid)
Superfund id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
superFund
array[SuperFund]

updateTimesheet

Updates a timesheet

Update properties on a single 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\PayrollAuApi(
    new GuzzleHttp\Client(),
    $config
);
$xeroTenantId = "xeroTenantId_example";
$timesheetID = "4ff1e5cc-9835-40d5-bb18-09fdb118db9c";
$startDate = new DateTime('2020-10-23');
$endDate = new DateTime('2020-10-30');

$timesheet = new XeroAPI\XeroPHP\Models\PayrollAu\Timesheet;
$timesheet->setEmployeeID('00000000-0000-0000-0000-000000000000');
$timesheet->setStartDate($startDate);
$timesheet->setEndDate($endDate);
$timesheet->setStatus(XeroAPI\XeroPHP\Models\PayrollAu\TimesheetStatus::DRAFT);

try {
  $result = $apiInstance->updateTimesheet($xeroTenantId, $timesheetID, $timesheet);
} catch (Exception $e) {
  echo 'Exception when calling PayrollAuApi->updateTimesheet: ', $e->getMessage(), PHP_EOL;
}
?>

Scopes

payroll.timesheets Grant read-write access to payroll timesheets

Parameters

Path parameters
Name Description
TimesheetID*
UUID (uuid)
Timesheet id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
timesheet
array[Timesheet]