Xero Payroll UK

PayrollUk

approveTimesheet

Approves a specific timesheet


/Timesheets/{TimesheetID}/Approve

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const timesheetID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';
const idempotencyKey = 'KEY_VALUE';

try {
  const response = await xero.accountingApi.approveTimesheet(xeroTenantId, timesheetID, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.

createBenefit

Creates a new employee benefit


/Benefits

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const idempotencyKey = 'KEY_VALUE';

const benefit: Benefit = { 
  name: "Benefit Name",
  expenseAccountID: "00000000-0000-0000-0000-000000000000",
  liabilityAccountID: "00000000-0000-0000-0000-000000000000",
  isCalculatingOnQualifyingEarnings: true
}; 

try {
  const response = await xero.accountingApi.createBenefit(xeroTenantId, benefit, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
benefit *
Benefit
Required

createDeduction

Creates a new deduction


/Deductions

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const idempotencyKey = 'KEY_VALUE';

const deduction: Deduction = { 
  deductionName: "Test Deduction",
  deductionCategory: Deduction.DeductionCategoryEnum.StakeholderPension,
  liabilityAccountId: "00000000-0000-0000-0000-000000000000",
  calculationType: Deduction.CalculationTypeEnum.PercentageOfGross
}; 

try {
  const response = await xero.accountingApi.createDeduction(xeroTenantId, deduction, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
deduction *
Deduction
Required

createEarningsRate

Creates a new earnings rate


/EarningsRates

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const idempotencyKey = 'KEY_VALUE';

const earningsRate: EarningsRate = { 
  earningsType: EarningsRate.EarningsTypeEnum.RegularEarnings,
  rateType: EarningsRate.RateTypeEnum.RatePerUnit,
  expenseAccountID: "00000000-0000-0000-0000-000000000000",
  typeOfUnits: "Type"
}; 

try {
  const response = await xero.accountingApi.createEarningsRate(xeroTenantId, earningsRate, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
earningsRate *
EarningsRate
Required

createEmployee

Creates employees


/Employees

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const idempotencyKey = 'KEY_VALUE';
const dateOfBirth = '2000-10-28'

const address: Address = { 
  addressLine1: "123 Test st",
  city: "Rangiora",
  postCode: "7400",
  countryName: "UNITED KINGDOM"
}; 

const employee: Employee = { 
  firstName: "Adam",
  lastName: "Adamson",
  dateOfBirth: dateOfBirth,
  address: address
}; 

try {
  const response = await xero.accountingApi.createEmployee(xeroTenantId, employee, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
employee *
Employee
Required

createEmployeeEarningsTemplate

Creates an earnings template records for a specific employee


/Employees/{EmployeeID}/PayTemplates/earnings

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';

const earningsTemplate: EarningsTemplate = { 
  payTemplateEarningID: "00000000-0000-0000-0000-000000000000",
  ratePerUnit: 14.25,
  numberOfUnits: 35.5,
  fixedAmount: 50,
  earningsRateID: "00000000-0000-0000-0000-000000000000",
  name: "Overtime Hours"
};   
const earningsTemplates = [];
earningsTemplates.push(earningsTemplate)

try {
  const response = await xero.accountingApi.createEmployeeEarningsTemplate(xeroTenantId, employeeID, earningsTemplate, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
earningsTemplate *
EarningsTemplate
Required

createEmployeeLeave

Creates leave records for a specific employee


/Employees/{EmployeeID}/Leave

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';
const startDate = '2020-10-28'
const endDate = '2020-10-30'

const employeeLeave: EmployeeLeave = { 
  leaveTypeID: "00000000-0000-0000-0000-000000000000",
  startDate: startDate,
  endDate: endDate
}; 

try {
  const response = await xero.accountingApi.createEmployeeLeave(xeroTenantId, employeeID, employeeLeave, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
employeeLeave *
EmployeeLeave
Required

createEmployeeLeaveType

Creates employee leave type records


/Employees/{EmployeeID}/LeaveTypes

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';

const employeeLeaveType: EmployeeLeaveType = { 
  leaveTypeID: "00000000-0000-0000-0000-000000000000",
  scheduleOfAccrual: EmployeeLeaveType.ScheduleOfAccrualEnum.BeginningOfCalendarYear,
  openingBalance: 5.25
}; 

try {
  const response = await xero.accountingApi.createEmployeeLeaveType(xeroTenantId, employeeID, employeeLeaveType, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
employeeLeaveType *
EmployeeLeaveType
Required

createEmployeeOpeningBalances

Creates an opening balance for a specific employee


/Employees/{EmployeeID}/ukopeningbalances

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';

const employeeOpeningBalances: EmployeeOpeningBalances = { 
  statutoryMaternityPay: 0.0,
  statutoryAdoptionPay: 100.0,
  statutoryPaternityPay: 0.0,
  statutorySharedParentalPay: 0.0,
  statutorySickPay: 0.0
}; 

try {
  const response = await xero.accountingApi.createEmployeeOpeningBalances(xeroTenantId, employeeID, employeeOpeningBalances, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
employeeOpeningBalances *
EmployeeOpeningBalances
Required

createEmployeePaymentMethod

Creates an employee payment method


/Employees/{EmployeeID}/PaymentMethods

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';

const bankAccount: BankAccount = { 
  accountName: "Charlotte Danes",
  accountNumber: "123456",
  sortCode: "123411"
};   
const bankAccounts = [];
bankAccounts.push(bankAccount)

const paymentMethod: PaymentMethod = { 
  bankAccounts: bankAccounts
}; 

try {
  const response = await xero.accountingApi.createEmployeePaymentMethod(xeroTenantId, employeeID, paymentMethod, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
paymentMethod *
PaymentMethod
Required

createEmployeeSalaryAndWage

Creates a salary and wage record for a specific employee


/Employees/{EmployeeID}/SalaryAndWages

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';

const salaryAndWage: SalaryAndWage = { 
  earningsRateID: "00000000-0000-0000-0000-000000000000",
  numberOfUnitsPerDay: 0,
  numberOfUnitsPerWeek: 0,
  paymentType: SalaryAndWage.PaymentTypeEnum.Salary,
  status: SalaryAndWage.StatusEnum.Active
}; 

try {
  const response = await xero.accountingApi.createEmployeeSalaryAndWage(xeroTenantId, employeeID, salaryAndWage, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
salaryAndWage *
SalaryAndWage
Required

createEmployeeStatutorySickLeave

Creates statutory sick leave records


/StatutoryLeaves/Sick

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const idempotencyKey = 'KEY_VALUE';
const startDate = '2020-10-28'
const endDate = '2020-10-30'

const employeeStatutorySickLeave: EmployeeStatutorySickLeave = { 
  isPregnancyRelated: true,
  leaveTypeID: "00000000-0000-0000-0000-000000000000",
  startDate: startDate,
  endDate: endDate
}; 

try {
  const response = await xero.accountingApi.createEmployeeStatutorySickLeave(xeroTenantId, employeeStatutorySickLeave, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';
const startDate = '2020-10-28'

const employment: Employment = { 
  payrollCalendarID: "00000000-0000-0000-0000-000000000000",
  startDate: startDate
}; 

try {
  const response = await xero.accountingApi.createEmployment(xeroTenantId, employeeID, employment, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
employment *
Employment
Required

createLeaveType

Creates a new leave type


/LeaveTypes

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const idempotencyKey = 'KEY_VALUE';

const leaveType: LeaveType = { 
  name: "LeaveType",
  isPaidLeave: true,
  showOnPayslip: true
}; 

try {
  const response = await xero.accountingApi.createLeaveType(xeroTenantId, leaveType, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
leaveType *
LeaveType
Required

createMultipleEmployeeEarningsTemplate

Creates multiple earnings template records for a specific employee using a unique employee ID


/Employees/{EmployeeID}/paytemplateearnings

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';

const earningsTemplate: EarningsTemplate = { 
  payTemplateEarningID: "00000000-0000-0000-0000-000000000000",
  ratePerUnit: 14.25,
  numberOfUnits: 35.5,
  fixedAmount: 50,
  earningsRateID: "00000000-0000-0000-0000-000000000000",
  name: "Overtime Hours"
};   
const earningsTemplates = [];
earningsTemplates.push(earningsTemplate)

try {
  const response = await xero.accountingApi.createMultipleEmployeeEarningsTemplate(xeroTenantId, employeeID, earningsTemplate, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
earningsTemplate *
array[EarningsTemplate]
Required

createPayRunCalendar

Creates a new payrun calendar


/PayRunCalendars

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const idempotencyKey = 'KEY_VALUE';
const startDate = '2020-10-28'
const paymentDate = '2020-10-30'

const payRunCalendar: PayRunCalendar = { 
  calendarType: PayRunCalendar.CalendarTypeEnum.Weekly,
  periodStartDate: startDate,
  paymentDate: paymentDate
}; 

try {
  const response = await xero.accountingApi.createPayRunCalendar(xeroTenantId, payRunCalendar, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
payRunCalendar *
PayRunCalendar
Required

createReimbursement

Creates a new reimbursement


/Reimbursements

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const idempotencyKey = 'KEY_VALUE';

const reimbursement: Reimbursement = { 
  name: "Test Reimbursement",
  accountID: "00000000-0000-0000-0000-000000000000"
}; 

try {
  const response = await xero.accountingApi.createReimbursement(xeroTenantId, reimbursement, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
reimbursement *
Reimbursement
Required

createTimesheet

Creates a new timesheet


/Timesheets

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const idempotencyKey = 'KEY_VALUE';
const startDate = '2020-10-28'
const endDate = '2020-10-30'

const timesheet: Timesheet = { 
  payrollCalendarID: "00000000-0000-0000-0000-000000000000",
  employeeID: "00000000-0000-0000-0000-000000000000",
  startDate: startDate,
  endDate: endDate
}; 

try {
  const response = await xero.accountingApi.createTimesheet(xeroTenantId, timesheet, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

Scopes

payroll.timesheets Grant read-write access to payroll timesheets

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
timesheet *
Timesheet
Required

createTimesheetLine

Creates a new timesheet line for a specific timesheet using a unique timesheet ID


/Timesheets/{TimesheetID}/Lines

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const timesheetID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';
const idempotencyKey = 'KEY_VALUE';
const date = '2020-10-28'

const timesheetLine: TimesheetLine = { 
  timesheetLineID: "00000000-0000-0000-0000-000000000000",
  date: date,
  earningsRateID: "00000000-0000-0000-0000-000000000000",
  trackingItemID: "00000000-0000-0000-0000-000000000000",
  numberOfUnits: 6
}; 

try {
  const response = await xero.accountingApi.createTimesheetLine(xeroTenantId, timesheetID, timesheetLine, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
timesheetLine *
TimesheetLine
Required

deleteEmployeeEarningsTemplate

Deletes a specific employee's earnings template record


/Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const payTemplateEarningID = '3fa85f64-5717-4562-b3fc-2c963f66afa6';

try {
  const response = await xero.accountingApi.deleteEmployeeEarningsTemplate(xeroTenantId, employeeID, payTemplateEarningID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const leaveID = 'c4be24e5-e840-4c92-9eaa-2d86cd596314';

try {
  const response = await xero.accountingApi.deleteEmployeeLeave(xeroTenantId, employeeID, leaveID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const salaryAndWagesID = '3fa85f64-5717-4562-b3fc-2c963f66afa6';

try {
  const response = await xero.accountingApi.deleteEmployeeSalaryAndWage(xeroTenantId, employeeID, salaryAndWagesID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const timesheetID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.deleteTimesheet(xeroTenantId, timesheetID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const timesheetID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';
const timesheetLineID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.deleteTimesheetLine(xeroTenantId, timesheetID, timesheetLineID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const id = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.getBenefit(xeroTenantId, id);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const page = 56;

try {
  const response = await xero.accountingApi.getBenefits(xeroTenantId,  page);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const deductionId = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.getDeduction(xeroTenantId, deductionId);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const page = 56;

try {
  const response = await xero.accountingApi.getDeductions(xeroTenantId,  page);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const id = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.getEarningsOrder(xeroTenantId, id);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const page = 56;

try {
  const response = await xero.accountingApi.getEarningsOrders(xeroTenantId,  page);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const earningsRateID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.getEarningsRate(xeroTenantId, earningsRateID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const page = 56;

try {
  const response = await xero.accountingApi.getEarningsRates(xeroTenantId,  page);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';

try {
  const response = await xero.accountingApi.getEmployee(xeroTenantId, employeeID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const leaveID = 'c4be24e5-e840-4c92-9eaa-2d86cd596314';

try {
  const response = await xero.accountingApi.getEmployeeLeave(xeroTenantId, employeeID, leaveID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';

try {
  const response = await xero.accountingApi.getEmployeeLeaveBalances(xeroTenantId, employeeID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '00000000-0000-0000-0000-000000000000';
const startDate: Date = new Date("2013-10-20");
const endDate: Date = new Date("2013-10-20");

try {
  const response = await xero.accountingApi.getEmployeeLeavePeriods(xeroTenantId, employeeID,  startDate, endDate);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';

try {
  const response = await xero.accountingApi.getEmployeeLeaveTypes(xeroTenantId, employeeID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';

try {
  const response = await xero.accountingApi.getEmployeeLeaves(xeroTenantId, employeeID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';

try {
  const response = await xero.accountingApi.getEmployeeOpeningBalances(xeroTenantId, employeeID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';

try {
  const response = await xero.accountingApi.getEmployeePayTemplate(xeroTenantId, employeeID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';

try {
  const response = await xero.accountingApi.getEmployeePaymentMethod(xeroTenantId, employeeID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const salaryAndWagesID = '3fa85f64-5717-4562-b3fc-2c963f66afa6';

try {
  const response = await xero.accountingApi.getEmployeeSalaryAndWage(xeroTenantId, employeeID, salaryAndWagesID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const page = 56;

try {
  const response = await xero.accountingApi.getEmployeeSalaryAndWages(xeroTenantId, employeeID,  page);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const leaveType = 'sick';
const asOfDate: Date = new Date("2013-10-20");

try {
  const response = await xero.accountingApi.getEmployeeStatutoryLeaveBalances(xeroTenantId, employeeID,  leaveType, asOfDate);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const statutorySickLeaveID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';

try {
  const response = await xero.accountingApi.getEmployeeStatutorySickLeave(xeroTenantId, statutorySickLeaveID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';

try {
  const response = await xero.accountingApi.getEmployeeTax(xeroTenantId, employeeID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const filter = 'firstName==John,lastName==Smith,isOffPayrollWorker==false';
const page = 5;

try {
  const response = await xero.accountingApi.getEmployees(xeroTenantId,  filter, page);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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, lastname, and/or whether they are an off-payroll worker
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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const leaveTypeID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.getLeaveType(xeroTenantId, leaveTypeID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const page = 56;
const activeOnly = true;

try {
  const response = await xero.accountingApi.getLeaveTypes(xeroTenantId,  page, activeOnly);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const payRunID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.getPayRun(xeroTenantId, payRunID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const payRunCalendarID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.getPayRunCalendar(xeroTenantId, payRunCalendarID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const page = 56;

try {
  const response = await xero.accountingApi.getPayRunCalendars(xeroTenantId,  page);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const page = 56;
const status = 'status_example';

try {
  const response = await xero.accountingApi.getPayRuns(xeroTenantId,  page, status);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const payslipID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.getPaySlip(xeroTenantId, payslipID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const payRunID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';
const page = 56;

try {
  const response = await xero.accountingApi.getPaySlips(xeroTenantId, payRunID,  page);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const reimbursementID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.getReimbursement(xeroTenantId, reimbursementID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const page = 56;

try {
  const response = await xero.accountingApi.getReimbursements(xeroTenantId,  page);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';

try {
  const response = await xero.accountingApi.getSettings(xeroTenantId);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const activeOnly = true;

try {
  const response = await xero.accountingApi.getStatutoryLeaveSummary(xeroTenantId, employeeID,  activeOnly);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const timesheetID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';

try {
  const response = await xero.accountingApi.getTimesheet(xeroTenantId, timesheetID);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const page = 5;
const filter = 'employeeId==00000000-0000-0000-0000-000000000000,payrollCalendarId==00000000-0000-0000-0000-000000000000';
const status = 'Draft';
const startDate = '2019-01-02';
const endDate = '2020-01-02';
const sort = 'startDate';

try {
  const response = await xero.accountingApi.getTimesheets(xeroTenantId,  page, filter, status, startDate, endDate, sort);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';

try {
  const response = await xero.accountingApi.getTrackingCategories(xeroTenantId);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const timesheetID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';
const idempotencyKey = 'KEY_VALUE';

try {
  const response = await xero.accountingApi.revertTimesheet(xeroTenantId, timesheetID, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.

updateEmployee

Updates a specific employee's detail


/Employees/{EmployeeID}

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';
const dateOfBirth = '2000-10-28'

const address: Address = { 
  addressLine1: "123 Test st",
  city: "Rangiora",
  postCode: "7400",
  countryName: "NEW ZEALAND"
}; 

const employee: Employee = { 
  firstName: "Adam",
  lastName: "Adamson",
  dateOfBirth: dateOfBirth,
  address: address
}; 

try {
  const response = await xero.accountingApi.updateEmployee(xeroTenantId, employeeID, employee, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
employee *
Employee
Required

updateEmployeeEarningsTemplate

Updates a specific employee's earnings template records


/Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const payTemplateEarningID = '3fa85f64-5717-4562-b3fc-2c963f66afa6';
const idempotencyKey = 'KEY_VALUE';

const earningsTemplate: EarningsTemplate = { 
  payTemplateEarningID: "00000000-0000-0000-0000-000000000000",
  ratePerUnit: 14.25,
  numberOfUnits: 35.5,
  fixedAmount: 50,
  earningsRateID: "00000000-0000-0000-0000-000000000000",
  name: "Overtime Hours"
};   
const earningsTemplates = [];
earningsTemplates.push(earningsTemplate)

try {
  const response = await xero.accountingApi.updateEmployeeEarningsTemplate(xeroTenantId, employeeID, payTemplateEarningID, earningsTemplate, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
earningsTemplate *
EarningsTemplate
Required

updateEmployeeLeave

Updates a specific employee's leave records


/Employees/{EmployeeID}/Leave/{LeaveID}

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const leaveID = 'c4be24e5-e840-4c92-9eaa-2d86cd596314';
const idempotencyKey = 'KEY_VALUE';
const startDate = '2020-10-28'
const endDate = '2020-10-30'

const employeeLeave: EmployeeLeave = { 
  leaveTypeID: "00000000-0000-0000-0000-000000000000",
  startDate: startDate,
  endDate: endDate
}; 

try {
  const response = await xero.accountingApi.updateEmployeeLeave(xeroTenantId, employeeID, leaveID, employeeLeave, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
employeeLeave *
EmployeeLeave
Required

updateEmployeeOpeningBalances

Updates a specific employee's opening balances


/Employees/{EmployeeID}/ukopeningbalances

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const idempotencyKey = 'KEY_VALUE';

const employeeOpeningBalances: EmployeeOpeningBalances = { 
  statutoryMaternityPay: 0.0,
  statutoryAdoptionPay: 100.0,
  statutoryPaternityPay: 0.0,
  statutorySharedParentalPay: 0.0,
  statutorySickPay: 0.0
}; 

try {
  const response = await xero.accountingApi.updateEmployeeOpeningBalances(xeroTenantId, employeeID, employeeOpeningBalances, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
employeeOpeningBalances *
EmployeeOpeningBalances
Required

updateEmployeeSalaryAndWage

Updates salary and wages record for a specific employee


/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const employeeID = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c';
const salaryAndWagesID = '3fa85f64-5717-4562-b3fc-2c963f66afa6';
const idempotencyKey = 'KEY_VALUE';

const salaryAndWage: SalaryAndWage = { 
  earningsRateID: "00000000-0000-0000-0000-000000000000",
  numberOfUnitsPerDay: 0,
  numberOfUnitsPerWeek: 0,
  paymentType: SalaryAndWage.PaymentTypeEnum.Salary,
  status: SalaryAndWage.StatusEnum.Active
}; 

try {
  const response = await xero.accountingApi.updateEmployeeSalaryAndWage(xeroTenantId, employeeID, salaryAndWagesID, salaryAndWage, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
salaryAndWage *
SalaryAndWage
Required

updatePayRun

Updates a specific pay run


/PayRuns/{PayRunID}

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const payRunID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';
const idempotencyKey = 'KEY_VALUE';
const startDate = '2020-10-28'
const paymentDate = '2020-10-30'

const payRunCalendar: PayRunCalendar = { 
  calendarType: CalendarType.Weekly,
  periodStartDate: startDate,
  paymentDate: paymentDate
}; 

try {
  const response = await xero.accountingApi.updatePayRun(xeroTenantId, payRunID, payRun, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
payRun *
PayRun
Required

updateTimesheetLine

Updates a specific timesheet line for a specific timesheet


/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}

Usage and SDK Samples

await xero.setTokenSet(tokenSet);

const xeroTenantId = 'xeroTenantId_example';
const timesheetID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';
const timesheetLineID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';
const idempotencyKey = 'KEY_VALUE';
const date = '2020-10-28'

const timesheetLine: TimesheetLine = { 
  timesheetLineID: "00000000-0000-0000-0000-000000000000",
  date: date,
  earningsRateID: "00000000-0000-0000-0000-000000000000",
  trackingItemID: "00000000-0000-0000-0000-000000000000",
  numberOfUnits: 6
}; 

try {
  const response = await xero.accountingApi.updateTimesheetLine(xeroTenantId, timesheetID, timesheetLineID, timesheetLine, idempotencyKey);
  console.log(response.body || response.response.statusCode)
} catch (err) {
  const error = JSON.stringify(err.response.body, null, 2)
  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
timesheetLine *
TimesheetLine
Required