Xero Payroll NZ

PayrollNz

approveTimesheet

Approves a 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.

createDeduction

Creates a new deduction for a specific employee


/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: "Deduction test",
  deduction_category:  XeroRuby::PayrollNz::Deduction::deduction_category::NZ_OTHER,
  liability_account_id: "00000000-0000-0000-0000-000000000000"
}  

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::PayrollNz::EarningsRate::EarningsTypeEnum::REGULAREARNINGS,
  rate_type:  XeroRuby::PayrollNz::EarningsRate::RateTypeEnum::ACCPAYCREDIT,
  expense_account_ID: "00000000-0000-0000-0000-000000000000"
}  

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 an 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: "NEW ZEALAND"
}  

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 earnings template records for an 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

createEmployeeLeaveSetup

Creates a leave set-up for a specific employee. This is required before viewing, configuring and requesting leave for an employee


/Employees/{EmployeeID}/leaveSetup

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_setup = { 
  include_holiday_pay: false,
  holiday_pay_opening_balance: 10.5,
  annual_leave_opening_balance: 25.89,
  sick_leave_hours_to_accrue_annually: 100.0,
  sick_leave_maximum_hours_to_accrue: 200.0,
  sick_leave_opening_balance: 10.5
}  

begin
  response = xero_client.accounting_api.create_employee_leave_setup(xero_tenant_id, employee_id, employeeLeaveSetup, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employee_leave_setup: #{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
employeeLeaveSetup *
EmployeeLeaveSetup
Required

createEmployeeLeaveType

Creates leave type records for a specific employee


/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::PayrollNz::EmployeeLeaveType::schedule_of_accrual::PERCENTAGEOFGROSSEARNINGS,
  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 opening balances for a specific employee


/Employees/{EmployeeID}/openingBalances

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'
period_end_date = 'YYYY-MM-DD'

employee_opening_balance = { 
  period_end_date:  period_end_date,
  days_paid: 5,
  unpaid_weeks: 0,
  gross_earnings: 1730.77
}    
employee_opening_balances = []
employee_opening_balances << employee_opening_balance

begin
  response = xero_client.accounting_api.create_employee_opening_balances(xero_tenant_id, employee_id, employeeOpeningBalance, 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
employeeOpeningBalance *
array[EmployeeOpeningBalance]
Required

createEmployeePaymentMethod

Creates a payment method for an employee


/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 an employee salary and wage record


/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,
  days_per_week: 0,
  payment_type:  XeroRuby::PayrollNz::SalaryAndWage::payment_type_enum::HOURLY
}  

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

createEmployment

Creates an employment detail for a specific employee


/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 employee earnings template records for a specific employee


/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

createPayRun

Creates a pay run


/PayRuns

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'

pay_run = { 
  pay_run_type:  XeroRuby::PayrollNz::PayRun::pay_run_type_enum::SCHEDULED,
  payroll_calendar_id: "00000000-0000-0000-0000-000000000000"
}  

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

Scopes

payroll.payruns Grant read-write access to payroll payruns

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
payRun *
PayRun
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::PayrollNz::calendar_type::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"
}  
  calculation_type:  XeroRuby::PayrollNz::Reimbursement::calculation_type_enum::FIXEDAMOUNT,
  reimbursement_category:  XeroRuby::PayrollNz::Reimbursement::reimbursement_category_enum::GST
}  

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

createSuperannuation

Creates a new superannuation


/Superannuations

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'

benefit = { 
  category:  XeroRuby::PayrollNz::Benefit::CategoryEnum::COMPLYINGFUND,
  calculation_type_nz:  XeroRuby::PayrollNz::Benefit::CalculationTypeNZ::PERCENTAGEOFTAXABLEEARNINGS,
  liability_account_id: "00000000-0000-0000-0000-000000000000",
  expense_account_id: "00000000-0000-0000-0000-000000000000",
  percentage: 3,
  standard_amount: 100
}  

begin
  response = xero_client.accounting_api.create_superannuation(xero_tenant_id, benefit, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_superannuation: #{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

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

Create a new timesheet line for a specific time sheet


/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 an 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 leave record for a specific employee


/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 an employee's salary and wages record


/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 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 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'

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

getDeduction

Retrieves a single 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 for a specific employee


/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.

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 an employees 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

getEmployeeLeaveBalances

Retrieves leave balances for a specific employee


/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 leave periods for a specific employee


/Employees/{EmployeeID}/LeavePeriods

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
start_date = "2013-10-20"
end_date = "Johnson"

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 leave types for a specific employee


/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 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'

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 the opening balance for a specific employee


/Employees/{EmployeeID}/openingBalances

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

getEmployeePayTemplates

Retrieves pay templates for a specific employee


/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_templates(xero_tenant_id, employee_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee_pay_templates: #{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 available payment methods for a specific employee


/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 an employee's salary and wages record by 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 an employee's salary and wages


/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.

getEmployeeTax

Retrieves tax records for a specific employee


/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'
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 and/or lastname
page
Integer
Page number which specifies the set of records to retrieve. By default the number of the records per set is 100.

getLeaveType

Retrieves a specific leave type by using a unique leave type ID


/LeaveTypes/{LeaveTypeID}

Usage and SDK Samples

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 payroll calendar ID


/PayRunCalendars/{PayrollCalendarID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

begin
  response = xero_client.accounting_api.get_pay_run_calendar(xero_tenant_id, payroll_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
PayrollCalendarID*
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 a unique pay slip ID


/PaySlips/{PaySlipID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

begin
  response = xero_client.accounting_api.get_pay_slip(xero_tenant_id, pay_slip_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 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

getStatutoryDeduction

Retrieves a specific statutory deduction by using a unique statutory deductions id


/StatutoryDeductions/{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_statutory_deduction(xero_tenant_id, id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_statutory_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
id*
UUID (uuid)
Identifier for the statutory deduction
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getStatutoryDeductions

Retrieves statutory deductions


/StatutoryDeductions

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_statutory_deductions(xero_tenant_id, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_statutory_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.

getSuperannuation

Retrieves a specific superannuation using a unique superannuation ID


/Superannuations/{SuperannuationID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

begin
  response = xero_client.accounting_api.get_superannuation(xero_tenant_id, superannuation_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_superannuation: #{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
SuperannuationID*
UUID (uuid)
Identifier for the superannuation
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getSuperannuations

Retrieves superannuations


/Superannuations

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_superannuations(xero_tenant_id, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_superannuations: #{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.

getTimesheet

Retrieves 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 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 an existing employee


/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 an earnings template records for an employee


/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 leave records for a specific employee


/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

updateEmployeeSalaryAndWage

Updates an employee's salary and wages record


/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,
  days_per_week: 0,
  payment_type:  XeroRuby::PayrollNz::SalaryAndWage::payment_type_enum::HOURLY
}  

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

updateEmployeeTax

Updates the tax records for a specific employee


/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'
idempotency_key = 'KEY_VALUE'
student_loan_as_at = 'YYYY-MM-DD'

employee_tax = { 
  ird_number: "111111111",
  has_special_student_loan_rate: true,
  special_student_loan_rate_percentage: 2,
  is_eligible_for_kiwi_saver: true,
  esct_rate_percentage: 17.5,
  kiwi_saver_contributions:  XeroRuby::PayrollNz::EmployeeTax::kiwi_saver_contributions_enum::MAKECONTRIBUTIONS,
  kiwi_saver_employee_contribution_rate_percentage: 4,
  kiwi_saver_employer_salary_sacrifice_contribution_rate_percentage: 2,
  tax_code:  XeroRuby::PayrollNz::TaxCode::MSL,
  has_student_loan_balance: true,
  student_loan_balance: 30.0,
  student_loan_as_at:  student_loan_as_at
}  

begin
  response = xero_client.accounting_api.update_employee_tax(xero_tenant_id, employee_id, employeeTax, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_employee_tax: #{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
employeeTax *
EmployeeTax
Required

updatePayRun

Updates a 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::PayrollNz::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

updatePaySlipLineItems

Creates an employee pay slip


/PaySlips/{PaySlipID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

earnings_line = { 
  earnings_line_id: "00000000-0000-0000-0000-000000000000",
  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
  rate_per_unit: 14.25,
  number_of_units: 35.5,
  is_average_daily_pay_rate: true,
  is_system_generated: true
}    
earnings_lines = []
earnings_lines << earnings_line

pay_slip = { 
  earningsLines:  earnings_lines
}  

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

Scopes

payroll.payslip Grant read-write 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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
paySlip *
PaySlip
Required

updateTimesheetLine

Updates a 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