Xero Payroll AU API

PayrollAu

approveLeaveApplication

Approve a requested leave application by a unique leave application id


/LeaveApplications/{LeaveApplicationID}/approve

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

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

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
LeaveApplicationID*
UUID (uuid)
Leave Application id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.

createEmployee

Creates a payroll employee


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

home_address = { 
  address_line_1: "123 Test st",
  region: "VIC",
  postal_code: 3000,
  city: "Melbourne"
}  

employee = { 
  first_name: "Adam",
  last_name: "Adamson",
  date_of_birth:  date_of_birth,
  homeAddress:  home_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 *
array[Employee]
Required

createLeaveApplication

Creates a leave application


/LeaveApplications

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'

leaveApplication = { 
  employee_id: "00000000-0000-0000-0000-000000000000",
  leave_type_id: "00000000-0000-0000-0000-000000000000",
  title: "Annual Leave",
  start_date:  start_date,
  end_date:  end_date
}  

begin
  response = xero_client.accounting_api.create_leave_application(xero_tenant_id, leaveApplication, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_leave_application: #{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
leaveApplication *
array[LeaveApplication]
Required

createPayItem

Creates a pay item


/PayItems

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'

earnings_rate = { 
  name: "Ordinary Hours 123",
  account_code: "477",
  type_of_units: "Hours",
  is_exempt_from_tax: true,
  is_exempt_from_super: true,
  earningsType:  XeroRuby::PayrollAu::EarningsType::OVERTIMEEARNINGS
}  

deduction_type = { 
  name: "Union Fees",
  account_code: "826",
  reduces_tax: true,
  reduces_super: true
}  

leave_type = { 
  name: "Annual Leave",
  type_of_units: "Hours",
  is_paid_leave: true,
  show_on_payslip: true
}  

reimbursement_type = { 
  name: "Annual Leave",
  account_code: "850"
}    
earnings_rates = []
earnings_rates << earnings_rate,  
deduction_types = []  
leave_types = []
leave_types << leave_type  
reimbursement_types = []
reimbursement_types << reimbursement_type

pay_item = { 
  earningsRates:  earnings_rates,
  deductionTypes:  deduction_types,
  leaveTypes:  leave_types,
  reimbursementTypes:  reimbursement_types
}  

begin
  response = xero_client.accounting_api.create_pay_item(xero_tenant_id, payItem, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_pay_item: #{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
payItem *
PayItem
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 = { 
  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 *
array[PayRun]
Required

createPayrollCalendar

Creates a Payroll Calendar


/PayrollCalendars

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'

payroll_calendar = { 
  name: "Weekly",
  calendar_type:  XeroRuby::PayrollAu::CalendarType::WEEKLY,
  start_date:  start_date,
  payment_date:  payment_date
}    
payroll_calendars = []
payroll_calendars << payroll_calendar

begin
  response = xero_client.accounting_api.create_payroll_calendar(xero_tenant_id, payrollCalendar, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_payroll_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
payrollCalendar *
array[PayrollCalendar]
Required

createSuperfund

Creates a superfund


/Superfunds

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
idempotency_key = 'KEY_VALUE'

super_fund = { 
  type:  XeroRuby::PayrollAu::SuperFundType::REGULATED,
  USI: "40022701955002"
}  

begin
  response = xero_client.accounting_api.create_superfund(xero_tenant_id, superFund, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_superfund: #{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
superFund *
array[SuperFund]
Required

createTimesheet

Creates a 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 = { 
  employee_id: "00000000-0000-0000-0000-000000000000",
  start_date:  start_date,
  end_date:  end_date,
  status:  XeroRuby::PayrollAu::TimesheetStatus::DRAFT
}  

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 *
array[Timesheet]
Required

getEmployee

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

getEmployees

Searches payroll employees


/Employees

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status=="ACTIVE"'
order = 'EmailAddress%20DESC'
page = 56

begin
  response = xero_client.accounting_api.get_employees(xero_tenant_id, if_modified_since, where, order, 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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 employees will be returned in a single API call

getLeaveApplication

Retrieves a leave application by a unique leave application id


/LeaveApplications/{LeaveApplicationID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

begin
  response = xero_client.accounting_api.get_leave_application(xero_tenant_id, leave_application_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_leave_application: #{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
LeaveApplicationID*
UUID (uuid)
Leave Application id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getLeaveApplications

Retrieves leave applications


/LeaveApplications

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status=="ACTIVE"'
order = 'EmailAddress%20DESC'
page = 56

begin
  response = xero_client.accounting_api.get_leave_applications(xero_tenant_id, if_modified_since, where, order, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_leave_applications: #{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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 objects will be returned in a single API call

getLeaveApplicationsV2

Retrieves leave applications including leave requests


/LeaveApplications/v2

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status=="ACTIVE"'
order = 'EmailAddress%20DESC'
page = 56

begin
  response = xero_client.accounting_api.get_leave_applications_v2(xero_tenant_id, if_modified_since, where, order, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_leave_applications_v2: #{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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 objects will be returned in a single API call

getPayItems

Retrieves pay items


/PayItems

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status=="ACTIVE"'
order = 'EmailAddress%20DESC'
page = 56

begin
  response = xero_client.accounting_api.get_pay_items(xero_tenant_id, if_modified_since, where, order, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_pay_items: #{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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 objects will be returned in a single API call

getPayRun

Retrieves a pay run by using a unique pay run id


/PayRuns/{PayRunID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

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)
PayRun id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getPayRuns

Retrieves pay runs


/PayRuns

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status=="ACTIVE"'
order = 'EmailAddress%20DESC'
page = 56

begin
  response = xero_client.accounting_api.get_pay_runs(xero_tenant_id, if_modified_since, where, order, page)
  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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 PayRuns will be returned in a single API call

getPayrollCalendar

Retrieves payroll calendar by using a unique payroll calendar ID


/PayrollCalendars/{PayrollCalendarID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

begin
  response = xero_client.accounting_api.get_payroll_calendar(xero_tenant_id, payroll_calendar_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_payroll_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)
Payroll Calendar id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getPayrollCalendars

Retrieves payroll calendars


/PayrollCalendars

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status=="ACTIVE"'
order = 'EmailAddress%20DESC'
page = 56

begin
  response = xero_client.accounting_api.get_payroll_calendars(xero_tenant_id, if_modified_since, where, order, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_payroll_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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 objects will be returned in a single API call

getPayslip

Retrieves for a payslip by a unique payslip id


/Payslip/{PayslipID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

begin
  response = xero_client.accounting_api.get_payslip(xero_tenant_id, payslip_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_payslip: #{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)
Payslip id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getSettings

Retrieves payroll settings


/Settings

Usage and SDK Samples

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

getSuperfund

Retrieves a superfund by using a unique superfund ID


/Superfunds/{SuperFundID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

begin
  response = xero_client.accounting_api.get_superfund(xero_tenant_id, super_fund_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_superfund: #{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
SuperFundID*
UUID (uuid)
Superfund id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getSuperfundProducts

Retrieves superfund products


/SuperfundProducts

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
aBN = '40022701955'
uSI = 'OSF0001AU'

begin
  response = xero_client.accounting_api.get_superfund_products(xero_tenant_id, aBN, uSI)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_superfund_products: #{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
ABN
String
The ABN of the Regulated SuperFund
USI
String
The USI of the Regulated SuperFund

getSuperfunds

Retrieves superfunds


/Superfunds

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status=="ACTIVE"'
order = 'EmailAddress%20DESC'
page = 56

begin
  response = xero_client.accounting_api.get_superfunds(xero_tenant_id, if_modified_since, where, order, page)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_superfunds: #{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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call

getTimesheet

Retrieves a timesheet by using a unique timesheet id


/Timesheets/{TimesheetID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

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)
Timesheet id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required

getTimesheets

Retrieves timesheets


/Timesheets

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'xeroTenantId_example'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status=="ACTIVE"'
order = 'EmailAddress%20DESC'
page = 56

begin
  response = xero_client.accounting_api.get_timesheets(xero_tenant_id, if_modified_since, where, order, page)
  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
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 timesheets will be returned in a single API call

rejectLeaveApplication

Reject a leave application by a unique leave application id


/LeaveApplications/{LeaveApplicationID}/reject

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

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

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
LeaveApplicationID*
UUID (uuid)
Leave Application id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.

updateEmployee

Updates an employee's detail

Update properties on a single 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'

home_address = { 
  address_line_1: "123 Test st",
  region: "VIC",
  postal_code: 3000,
  city: "Melbourne"
}  

employee = { 
  first_name: "Adam",
  last_name: "Adamson",
  date_of_birth:  date_of_birth,
  homeAddress:  home_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 *
array[Employee]
Required

updateLeaveApplication

Updates a specific leave application


/LeaveApplications/{LeaveApplicationID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

leaveApplication = { 
  employee_id: "00000000-0000-0000-0000-000000000000",
  leave_type_id: "00000000-0000-0000-0000-000000000000",
  title: "Annual Leave",
  start_date:  start_date,
  end_date:  end_date
}  

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

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
LeaveApplicationID*
UUID (uuid)
Leave Application id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
leaveApplication *
array[LeaveApplication]
Required

updatePayRun

Updates a pay run

Update properties on a single PayRun


/PayRuns/{PayRunID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

pay_run = { 
  payroll_calendar_id: "00000000-0000-0000-0000-000000000000"
}  

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)
PayRun 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
payRun *
array[PayRun]
Required

updatePayslip

Updates a payslip

Update lines on a single payslips


/Payslip/{PayslipID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

earnings_line = { 
  earnings_rate_id: "00000000-0000-0000-0000-000000000000",
  rate_per_unit: 20,
  number_of_units: 1
}    
earnings_lines = []
earnings_lines << earnings_line

payslip_lines = { 
  earnings_lines: earningsLines
}    
payslip_lines = []
payslip_lines << payslip_line

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

Scopes

payroll.payslip Grant read-write access to payroll payslips

Parameters

Path parameters
Name Description
PayslipID*
UUID (uuid)
Payslip id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
payslipLines *
array[PayslipLines]
Required

updateSuperfund

Updates a superfund

Update properties on a single Superfund


/Superfunds/{SuperFundID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

super_fund = { 
  type:  XeroRuby::PayrollAu::SuperFundType::REGULATED,
  USI: "40022701955002"
}  

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

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Path parameters
Name Description
SuperFundID*
UUID (uuid)
Superfund id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
superFund *
array[SuperFund]
Required

updateTimesheet

Updates a timesheet

Update properties on a single timesheet


/Timesheets/{TimesheetID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

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

timesheet = { 
  employee_id: "00000000-0000-0000-0000-000000000000",
  start_date:  start_date,
  end_date:  end_date,
  status:  XeroRuby::PayrollAu::TimesheetStatus::DRAFT
}  

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

Scopes

payroll.timesheets Grant read-write access to payroll timesheets

Parameters

Path parameters
Name Description
TimesheetID*
UUID (uuid)
Timesheet id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
timesheet *
array[Timesheet]
Required