Xero Payroll UK

PayrollUk

approveTimesheet

Approves a specific timesheet


/Timesheets/{TimesheetID}/Approve

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
timesheet_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.approve_timesheet(xero_tenant_id, timesheet_id, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling approve_timesheet: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'

benefit = { 
  name: "Benefit Name",
  expense_account_id: "00000000-0000-0000-0000-000000000000",
  liability_account_id: "00000000-0000-0000-0000-000000000000",
  is_calculating_on_qualifying_earnings: true
}  

begin
  response = xero_client.accounting_api.create_benefit(xero_tenant_id, benefit, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_benefit: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'

deduction = { 
  deduction_name: "Test Deduction",
  deduction_category:  XeroRuby::PayrollUk::Deduction::deduction_category_enum::STAKEHOLDERPENSION,
  liability_account_id: "00000000-0000-0000-0000-000000000000",
  calculation_type:  XeroRuby::PayrollUk::Deduction::calculation_type_enum::PERCENTAGEOFGROSS
}  

begin
  response = xero_client.accounting_api.create_deduction(xero_tenant_id, deduction, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_deduction: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'

earnings_rate = { 
  earnings_type:  XeroRuby::PayrollUk::EarningsRate::earnings_type_enum::REGULAREARNINGS,
  rate_type:  XeroRuby::PayrollUk::EarningsRate::RateTypeEnum::ACCPAYCREDIT,
  expense_account_id: "00000000-0000-0000-0000-000000000000",
  type_of_units: "Type"
}  

begin
  response = xero_client.accounting_api.create_earnings_rate(xero_tenant_id, earningsRate, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_earnings_rate: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'
date_of_birth = 'YYYY-MM-DD'

address = { 
  address_line_1: "123 Test st",
  city: "Rangiora",
  post_code: "7400",
  country_name: "UNITED KINGDOM"
}  

employee = { 
  first_name: "Adam",
  last_name: "Adamson",
  date_of_birth:  date_of_birth,
  address:  address
}  

begin
  response = xero_client.accounting_api.create_employee(xero_tenant_id, employee, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employee: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'

earnings_template = { 
  pay_template_earning_id: "00000000-0000-0000-0000-000000000000",
  rate_per_unit: 14.25,
  number_of_units: 35.5,
  fixed_amount: 50,
  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
  name: "Overtime Hours"
}    
earnings_templates = []
earnings_templates << earnings_template

begin
  response = xero_client.accounting_api.create_employee_earnings_template(xero_tenant_id, employee_id, earningsTemplate, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employee_earnings_template: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'
start_date = 'YYYY-MM-DD'
end_date = 'YYYY-MM-DD'

employee_leave = { 
  leave_type_id: "00000000-0000-0000-0000-000000000000",
  start_date:  start_date,
  end_date:  end_date
}  

begin
  response = xero_client.accounting_api.create_employee_leave(xero_tenant_id, employee_id, employeeLeave, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employee_leave: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'

employee_leave_type = { 
  leave_type_id: "00000000-0000-0000-0000-000000000000",
  schedule_of_accrual:  XeroRuby::PayrollUk::EmployeeLeaveType::schedule_of_accrual::BEGINNINGOFCALENDARYEAR,
  opening_balance: 5.25
}  

begin
  response = xero_client.accounting_api.create_employee_leave_type(xero_tenant_id, employee_id, employeeLeaveType, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employee_leave_type: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'

employee_opening_balances = { 
  statutory_maternity_pay: 0.0,
  statutory_adoption_pay: 100.0,
  statutory_paternity_pay: 0.0,
  statutory_shared_parental_pay: 0.0,
  statutory_sick_pay: 0.0
}  

begin
  response = xero_client.accounting_api.create_employee_opening_balances(xero_tenant_id, employee_id, employeeOpeningBalances, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employee_opening_balances: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'

bank_account = { 
  account_name: "Charlotte Danes",
  account_number: "123456",
  sort_code: "123411"
}    
bank_accounts = []
bank_accounts << bank_account

payment_method = { 
  bankAccounts: bankAccounts
}  

begin
  response = xero_client.accounting_api.create_employee_payment_method(xero_tenant_id, employee_id, paymentMethod, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employee_payment_method: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'

salary_and_wage = { 
  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
  number_of_units_per_day: 0,
  number_of_units_per_week: 0,
  payment_type:  XeroRuby::PayrollUk::SalaryAndWage::payment_type_enum::SALARY,
  status:  XeroRuby::PayrollUk::SalaryAndWage::status_enum::ACTIVE
}  

begin
  response = xero_client.accounting_api.create_employee_salary_and_wage(xero_tenant_id, employee_id, salaryAndWage, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employee_salary_and_wage: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'
start_date = 'YYYY-MM-DD'
end_date = 'YYYY-MM-DD'

employee_statutory_sick_leave = { 
  is_pregnancy_related: true,
  leave_type_id: "00000000-0000-0000-0000-000000000000",
  start_date:  start_date,
  end_date:  end_date
}  

begin
  response = xero_client.accounting_api.create_employee_statutory_sick_leave(xero_tenant_id, employeeStatutorySickLeave, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employee_statutory_sick_leave: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'
start_date = 'YYYY-MM-DD'

employment = { 
  payroll_calendar_id: "00000000-0000-0000-0000-000000000000",
  start_date:  start_date
}  

begin
  response = xero_client.accounting_api.create_employment(xero_tenant_id, employee_id, employment, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employment: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'

leave_type = { 
  name: "LeaveType",
  is_paid_leave: true,
  show_on_payslip: true
}  

begin
  response = xero_client.accounting_api.create_leave_type(xero_tenant_id, leaveType, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_leave_type: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'

earnings_template = { 
  pay_template_earning_id: "00000000-0000-0000-0000-000000000000",
  rate_per_unit: 14.25,
  number_of_units: 35.5,
  fixed_amount: 50,
  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
  name: "Overtime Hours"
}    
earnings_templates = []
earnings_templates << earnings_template

begin
  response = xero_client.accounting_api.create_multiple_employee_earnings_template(xero_tenant_id, employee_id, earningsTemplate, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_multiple_employee_earnings_template: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'
start_date = 'YYYY-MM-DD'
payment_date = 'YYYY-MM-DD'

pay_run_calendar = { 
  calendar_type:  XeroRuby::PayrollUk::PayRunCalendar::calendar_type_enum::WEEKLY,
  period_start_date:  start_date,
  payment_date:  payment_date
}  

begin
  response = xero_client.accounting_api.create_pay_run_calendar(xero_tenant_id, payRunCalendar, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_pay_run_calendar: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'

reimbursement = { 
  name: "Test Reimbursement",
  account_id: "00000000-0000-0000-0000-000000000000"
}  

begin
  response = xero_client.accounting_api.create_reimbursement(xero_tenant_id, reimbursement, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_reimbursement: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'
start_date = 'YYYY-MM-DD'
end_date = 'YYYY-MM-DD'

timesheet = { 
  payroll_calendar_id: "00000000-0000-0000-0000-000000000000",
  employee_id: "00000000-0000-0000-0000-000000000000",
  start_date:  start_date,
  end_date:  end_date
}  

begin
  response = xero_client.accounting_api.create_timesheet(xero_tenant_id, timesheet, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_timesheet: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
timesheet_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'
date = 'YYYY-MM-DD'

timesheet_line = { 
  timesheet_line_id: "00000000-0000-0000-0000-000000000000",
  date:  date,
  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
  tracking_item_id: "00000000-0000-0000-0000-000000000000",
  number_of_units: 6
}  

begin
  response = xero_client.accounting_api.create_timesheet_line(xero_tenant_id, timesheet_id, timesheetLine, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_timesheet_line: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
pay_template_earning_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6'

begin
  response = xero_client.accounting_api.delete_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_employee_earnings_template: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
leave_id = 'c4be24e5-e840-4c92-9eaa-2d86cd596314'

begin
  response = xero_client.accounting_api.delete_employee_leave(xero_tenant_id, employee_id, leave_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_employee_leave: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6'

begin
  response = xero_client.accounting_api.delete_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_employee_salary_and_wage: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
timesheet_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.delete_timesheet(xero_tenant_id, timesheet_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_timesheet: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
timesheet_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
timesheet_line_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.delete_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_timesheet_line: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_benefit(xero_tenant_id, id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_benefit: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
page = 56

begin
  response = xero_client.accounting_api.get_benefits(xero_tenant_id, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_benefits: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
deduction_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_deduction(xero_tenant_id, deduction_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_deduction: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
page = 56

begin
  response = xero_client.accounting_api.get_deductions(xero_tenant_id, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_deductions: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_earnings_order(xero_tenant_id, id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_earnings_order: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
page = 56

begin
  response = xero_client.accounting_api.get_earnings_orders(xero_tenant_id, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_earnings_orders: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
earnings_rate_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_earnings_rate(xero_tenant_id, earnings_rate_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_earnings_rate: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
page = 56

begin
  response = xero_client.accounting_api.get_earnings_rates(xero_tenant_id, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_earnings_rates: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
  response = xero_client.accounting_api.get_employee(xero_tenant_id, employee_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
leave_id = 'c4be24e5-e840-4c92-9eaa-2d86cd596314'

begin
  response = xero_client.accounting_api.get_employee_leave(xero_tenant_id, employee_id, leave_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_leave: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
  response = xero_client.accounting_api.get_employee_leave_balances(xero_tenant_id, employee_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_leave_balances: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '00000000-0000-0000-0000-000000000000'
start_date = "2013-10-20"
end_date = "2013-10-20"

begin
  response = xero_client.accounting_api.get_employee_leave_periods(xero_tenant_id, employee_id, start_date, end_date)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_leave_periods: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
  response = xero_client.accounting_api.get_employee_leave_types(xero_tenant_id, employee_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_leave_types: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
  response = xero_client.accounting_api.get_employee_leaves(xero_tenant_id, employee_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_leaves: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
  response = xero_client.accounting_api.get_employee_opening_balances(xero_tenant_id, employee_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_opening_balances: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
  response = xero_client.accounting_api.get_employee_pay_template(xero_tenant_id, employee_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_pay_template: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
  response = xero_client.accounting_api.get_employee_payment_method(xero_tenant_id, employee_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_payment_method: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6'

begin
  response = xero_client.accounting_api.get_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_salary_and_wage: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
page = 56

begin
  response = xero_client.accounting_api.get_employee_salary_and_wages(xero_tenant_id, employee_id, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_salary_and_wages: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
leave_type = 'sick'
as_of_date = "2013-10-20"

begin
  response = xero_client.accounting_api.get_employee_statutory_leave_balances(xero_tenant_id, employee_id, leave_type, as_of_date)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_statutory_leave_balances: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
statutory_sick_leave_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
  response = xero_client.accounting_api.get_employee_statutory_sick_leave(xero_tenant_id, statutory_sick_leave_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_statutory_sick_leave: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
  response = xero_client.accounting_api.get_employee_tax(xero_tenant_id, employee_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_tax: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
filter = 'firstName==John,lastName==Smith,isOffPayrollWorker==false'
page = 5

begin
  response = xero_client.accounting_api.get_employees(xero_tenant_id, filter, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employees: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
leave_type_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_leave_type(xero_tenant_id, leave_type_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_leave_type: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
page = 56
active_only = true

begin
  response = xero_client.accounting_api.get_leave_types(xero_tenant_id, page, active_only)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_leave_types: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
pay_run_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_pay_run(xero_tenant_id, pay_run_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_pay_run: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
pay_run_calendar_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_pay_run_calendar(xero_tenant_id, pay_run_calendar_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_pay_run_calendar: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
page = 56

begin
  response = xero_client.accounting_api.get_pay_run_calendars(xero_tenant_id, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_pay_run_calendars: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
page = 56
status = 'status_example'

begin
  response = xero_client.accounting_api.get_pay_runs(xero_tenant_id, page, status)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_pay_runs: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
payslip_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_pay_slip(xero_tenant_id, payslip_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_pay_slip: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
pay_run_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
page = 56

begin
  response = xero_client.accounting_api.get_pay_slips(xero_tenant_id, pay_run_id, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_pay_slips: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
reimbursement_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_reimbursement(xero_tenant_id, reimbursement_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_reimbursement: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
page = 56

begin
  response = xero_client.accounting_api.get_reimbursements(xero_tenant_id, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_reimbursements: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'

begin
  response = xero_client.accounting_api.get_settings(xero_tenant_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_settings: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
active_only = true

begin
  response = xero_client.accounting_api.get_statutory_leave_summary(xero_tenant_id, employee_id, active_only)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_statutory_leave_summary: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
timesheet_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'

begin
  response = xero_client.accounting_api.get_timesheet(xero_tenant_id, timesheet_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_timesheet: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
page = 5
filter = 'employeeId==00000000-0000-0000-0000-000000000000,payrollCalendarId==00000000-0000-0000-0000-000000000000'
status = 'Draft'
start_date = '2019-01-02'
end_date = '2020-01-02'
sort = 'startDate'

begin
  response = xero_client.accounting_api.get_timesheets(xero_tenant_id, page, filter, status, start_date, end_date, sort)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_timesheets: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'

begin
  response = xero_client.accounting_api.get_tracking_categories(xero_tenant_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_tracking_categories: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
timesheet_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.revert_timesheet(xero_tenant_id, timesheet_id, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling revert_timesheet: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'
date_of_birth = 'YYYY-MM-DD'

address = { 
  address_line_1: "123 Test st",
  city: "Rangiora",
  post_code: "7400",
  country_name: "NEW ZEALAND"
}  

employee = { 
  first_name: "Adam",
  last_name: "Adamson",
  date_of_birth:  date_of_birth,
  address:  address
}  

begin
  response = xero_client.accounting_api.update_employee(xero_tenant_id, employee_id, employee, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_employee: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
pay_template_earning_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6'
idempotency_key = 'KEY_VALUE'

earnings_template = { 
  pay_template_earning_id: "00000000-0000-0000-0000-000000000000",
  rate_per_unit: 14.25,
  number_of_units: 35.5,
  fixed_amount: 50,
  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
  name: "Overtime Hours"
}    
earnings_templates = []
earnings_templates << earnings_template

begin
  response = xero_client.accounting_api.update_employee_earnings_template(xero_tenant_id, employee_id, pay_template_earning_id, earningsTemplate, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_employee_earnings_template: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
leave_id = 'c4be24e5-e840-4c92-9eaa-2d86cd596314'
idempotency_key = 'KEY_VALUE'
start_date = 'YYYY-MM-DD'
end_date = 'YYYY-MM-DD'

employee_leave = { 
  leave_type_id: "00000000-0000-0000-0000-000000000000",
  start_date:  start_date,
  end_date:  end_date
}  

begin
  response = xero_client.accounting_api.update_employee_leave(xero_tenant_id, employee_id, leave_id, employeeLeave, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_employee_leave: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'

employee_opening_balances = { 
  statutory_maternity_pay: 0.0,
  statutory_adoption_pay: 100.0,
  statutory_paternity_pay: 0.0,
  statutory_shared_parental_pay: 0.0,
  statutory_sick_pay: 0.0
}  

begin
  response = xero_client.accounting_api.update_employee_opening_balances(xero_tenant_id, employee_id, employeeOpeningBalances, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_employee_opening_balances: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
salary_and_wages_id = '3fa85f64-5717-4562-b3fc-2c963f66afa6'
idempotency_key = 'KEY_VALUE'

salary_and_wage = { 
  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
  number_of_units_per_day: 0,
  number_of_units_per_week: 0,
  payment_type:  XeroRuby::PayrollUk::SalaryAndWage::payment_type_enum::SALARY,
  status:  XeroRuby::PayrollUk::SalaryAndWage::status_enum::ACTIVE
}  

begin
  response = xero_client.accounting_api.update_employee_salary_and_wage(xero_tenant_id, employee_id, salary_and_wages_id, salaryAndWage, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_employee_salary_and_wage: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
pay_run_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'
start_date = 'YYYY-MM-DD'
payment_date = 'YYYY-MM-DD'

pay_run_calendar = { 
  calendar_type:  XeroRuby::PayrollUk::calendar_type::WEEKLY,
  period_start_date:  start_date,
  payment_date:  payment_date
}  

begin
  response = xero_client.accounting_api.update_pay_run(xero_tenant_id, pay_run_id, payRun, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_pay_run: #{e}"
end

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

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
timesheet_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
timesheet_line_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
idempotency_key = 'KEY_VALUE'
date = 'YYYY-MM-DD'

timesheet_line = { 
  timesheet_line_id: "00000000-0000-0000-0000-000000000000",
  date:  date,
  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
  tracking_item_id: "00000000-0000-0000-0000-000000000000",
  number_of_units: 6
}  

begin
  response = xero_client.accounting_api.update_timesheet_line(xero_tenant_id, timesheet_id, timesheet_line_id, timesheetLine, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_timesheet_line: #{e}"
end

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