Xero Payroll NZ

PayrollNz

approveTimesheet

Approves a timesheet


/Timesheets/{TimesheetID}/Approve

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID timesheetID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            TimesheetObject result = apiInstance.approveTimesheet(accessToken, xeroTenantId, timesheetID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#approveTimesheet");
            e.printStackTrace();
        }
    }
}

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

createDeduction

Creates a new deduction for a specific employee


/Deductions

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        
        Deduction deduction = new Deduction();
        deduction.setDeductionName("Deduction test");
        deduction.setDeductionCategory(com.xero.models.payrollnz.Deduction.DeductionCategoryEnum.NZOTHER);
        deduction.setLiabilityAccountId(UUID.fromString("00000000-0000-0000-0000-000000000000"));

        try {
            DeductionObject result = apiInstance.createDeduction(accessToken, xeroTenantId, deduction);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createDeduction");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
deduction *
Deduction
Required

createEarningsRate

Creates a new earnings rate


/EarningsRates

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        
        EarningsRate earningsRate = new EarningsRate();
        earningsRate.setEarningsType(com.xero.models.payrollnz.EarningsRate.EarningsTypeEnum.RegularEarnings);
        earningsRate.setRateType(com.xero.models.payrollnz.EarningsRate.RateTypeEnum.RATEPERUNIT);
        earningsRate.setExpenseAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));

        try {
            EarningsRateObject result = apiInstance.createEarningsRate(accessToken, xeroTenantId, earningsRate);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createEarningsRate");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
earningsRate *
EarningsRate
Required

createEmployee

Creates an employees


/Employees

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        LocalDate dateOfBirth = LocalDate.of(2000, Month.OCTOBER, 28);
        
        Address address = new Address();
        address.setAddressLine1("123 Test st");
        address.setCity("Rangiora");
        address.setPostCode("7400");
        address.setCountryName("NEW ZEALAND");
        
        Employee employee = new Employee();
        employee.setFirstName("Adam");
        employee.setLastName("Adamson");
        employee.setDateOfBirth(dateOfBirth);
        employee.setAddress(address);

        try {
            EmployeeObject result = apiInstance.createEmployee(accessToken, xeroTenantId, employee);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createEmployee");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
employee *
Employee
Required

createEmployeeEarningsTemplate

Creates earnings template records for an employee


/Employees/{EmployeeID}/PayTemplates/earnings

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        
        EarningsTemplate earningsTemplate = new EarningsTemplate();
        earningsTemplate.setPayTemplateEarningID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        earningsTemplate.setRatePerUnit(14.25);
        earningsTemplate.setNumberOfUnits(35.5);
        earningsTemplate.setFixedAmount(50);
        earningsTemplate.setEarningsRateID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        earningsTemplate.setName("Overtime Hours");

        List<EarningsTemplate> earningsTemplates = new ArrayList<EarningsTemplate>();
        earningsTemplates.add(earningsTemplate);

        try {
            EarningsTemplateObject result = apiInstance.createEmployeeEarningsTemplate(accessToken, xeroTenantId, employeeID, earningsTemplate);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createEmployeeEarningsTemplate");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
earningsTemplate *
EarningsTemplate
Required

createEmployeeLeave

Creates leave records for a specific employee


/Employees/{EmployeeID}/Leave

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        LocalDate startDate = LocalDate.of(2020, Month.OCTOBER, 28);
        LocalDate endDate = LocalDate.of(2020, Month.OCTOBER, 30);
        
        EmployeeLeave employeeLeave = new EmployeeLeave();
        employeeLeave.setLeaveTypeID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        employeeLeave.setStartDate(startDate);
        employeeLeave.setEndDate(endDate);

        try {
            EmployeeLeaveObject result = apiInstance.createEmployeeLeave(accessToken, xeroTenantId, employeeID, employeeLeave);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createEmployeeLeave");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        
        EmployeeLeaveSetup employeeLeaveSetup = new EmployeeLeaveSetup();
        employeeLeaveSetup.setIncludeHolidayPay(false);
        employeeLeaveSetup.setHolidayPayOpeningBalance(10.5);
        employeeLeaveSetup.setAnnualLeaveOpeningBalance(25.89);
        employeeLeaveSetup.setSickLeaveHoursToAccrueAnnually(100.0);
        employeeLeaveSetup.setSickLeaveMaximumHoursToAccrue(200.0);
        employeeLeaveSetup.setSickLeaveOpeningBalance(10.5);

        try {
            EmployeeLeaveSetupObject result = apiInstance.createEmployeeLeaveSetup(accessToken, xeroTenantId, employeeID, employeeLeaveSetup);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createEmployeeLeaveSetup");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
employeeLeaveSetup *
EmployeeLeaveSetup
Required

createEmployeeLeaveType

Creates leave type records for a specific employee


/Employees/{EmployeeID}/LeaveTypes

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        
        EmployeeLeaveType employeeLeaveType = new EmployeeLeaveType();
        employeeLeaveType.setLeaveTypeID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        employeeLeaveType.setScheduleOfAccrual(com.xero.models.payrollnz.EmployeeLeaveType.ScheduleOfAccrualEnum.PercentageOfGrossEarnings);
        employeeLeaveType.setOpeningBalance(5.25);

        try {
            EmployeeLeaveTypeObject result = apiInstance.createEmployeeLeaveType(accessToken, xeroTenantId, employeeID, employeeLeaveType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createEmployeeLeaveType");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
employeeLeaveType *
EmployeeLeaveType
Required

createEmployeeOpeningBalances

Creates opening balances for a specific employee


/Employees/{EmployeeID}/openingBalances

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        LocalDate periodEndDate = LocalDate.of(2020, Month.OCTOBER, 30);
        
        EmployeeOpeningBalance employeeOpeningBalance = new EmployeeOpeningBalance();
        employeeOpeningBalance.setPeriodEndDate(periodEndDate);
        employeeOpeningBalance.setDaysPaid(5);
        employeeOpeningBalance.setUnpaidWeeks(0);
        employeeOpeningBalance.setGrossEarnings(1730.77);

        List<EmployeeOpeningBalance> employeeOpeningBalances = new ArrayList<EmployeeOpeningBalance>();
        employeeOpeningBalances.add(employeeOpeningBalance);

        try {
            EmployeeOpeningBalancesObject result = apiInstance.createEmployeeOpeningBalances(accessToken, xeroTenantId, employeeID, employeeOpeningBalance);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createEmployeeOpeningBalances");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
employeeOpeningBalance *
array[EmployeeOpeningBalance]
Required

createEmployeePaymentMethod

Creates a payment method for an employee


/Employees/{EmployeeID}/PaymentMethods

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        
        BankAccount bankAccount = new BankAccount();
        bankAccount.setAccountName("Charlotte Danes");
        bankAccount.setAccountNumber(123456);
        bankAccount.setSortCode("123411");

        List<BankAccount> bankAccounts = new ArrayList<BankAccount>();
        bankAccounts.add(bankAccount);
        
        PaymentMethod paymentMethod = new PaymentMethod();
        paymentMethod.setBankAccounts(bankAccounts);

        try {
            PaymentMethodObject result = apiInstance.createEmployeePaymentMethod(accessToken, xeroTenantId, employeeID, paymentMethod);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createEmployeePaymentMethod");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
paymentMethod *
PaymentMethod
Required

createEmployeeSalaryAndWage

Creates an employee salary and wage record


/Employees/{EmployeeID}/SalaryAndWages

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        
        SalaryAndWage salaryAndWage = new SalaryAndWage();
        salaryAndWage.setEarningsRateID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        salaryAndWage.setNumberOfUnitsPerDay(0);
        salaryAndWage.setDaysPerWeek(0);
        salaryAndWage.setPaymentType(com.xero.models.payrollnz.SalaryAndWage.PaymentTypeEnum.HOURLY);

        try {
            SalaryAndWageObject result = apiInstance.createEmployeeSalaryAndWage(accessToken, xeroTenantId, employeeID, salaryAndWage);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createEmployeeSalaryAndWage");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
salaryAndWage *
SalaryAndWage
Required

createEmployment

Creates an employment detail for a specific employee


/Employees/{EmployeeID}/Employment

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        LocalDate startDate = LocalDate.of(2020, Month.OCTOBER, 28);
        
        Employment employment = new Employment();
        employment.setPayrollCalendarID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        employment.setStartDate(startDate);

        try {
            EmploymentObject result = apiInstance.createEmployment(accessToken, xeroTenantId, employeeID, employment);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createEmployment");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
employment *
Employment
Required

createLeaveType

Creates a new leave type


/LeaveTypes

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        
        LeaveType leaveType = new LeaveType();
        leaveType.setName("LeaveType");
        leaveType.setIsPaidLeave(true);
        leaveType.setShowOnPayslip(true);

        try {
            LeaveTypeObject result = apiInstance.createLeaveType(accessToken, xeroTenantId, leaveType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createLeaveType");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
leaveType *
LeaveType
Required

createMultipleEmployeeEarningsTemplate

Creates multiple employee earnings template records for a specific employee


/Employees/{EmployeeID}/paytemplateearnings

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        
        EarningsTemplate earningsTemplate = new EarningsTemplate();
        earningsTemplate.setPayTemplateEarningID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        earningsTemplate.setRatePerUnit(14.25);
        earningsTemplate.setNumberOfUnits(35.5);
        earningsTemplate.setFixedAmount(50);
        earningsTemplate.setEarningsRateID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        earningsTemplate.setName("Overtime Hours");

        List<EarningsTemplate> earningsTemplates = new ArrayList<EarningsTemplate>();
        earningsTemplates.add(earningsTemplate);

        try {
            EmployeeEarningsTemplates result = apiInstance.createMultipleEmployeeEarningsTemplate(accessToken, xeroTenantId, employeeID, earningsTemplate);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createMultipleEmployeeEarningsTemplate");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
earningsTemplate *
array[EarningsTemplate]
Required

createPayRun

Creates a pay run


/PayRuns

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        
        PayRun payRun = new PayRun();
        payRun.setPayRunType(com.xero.models.payrollnz.PayRun.PayRunTypeEnum.SCHEDULED);
        payRun.setPayrollCalendarID(UUID.fromString("00000000-0000-0000-0000-000000000000"));

        try {
            PayRunObject result = apiInstance.createPayRun(accessToken, xeroTenantId, payRun);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createPayRun");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.payruns Grant read-write access to payroll payruns

Parameters

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

createPayRunCalendar

Creates a new payrun calendar


/PayRunCalendars

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        LocalDate startDate = LocalDate.of(2020, Month.OCTOBER, 28);
        LocalDate paymentDate = LocalDate.of(2020, Month.OCTOBER, 30);
        
        PayRunCalendar payRunCalendar = new PayRunCalendar();
        payRunCalendar.setCalendarType(com.xero.models.payrollnz.CalendarType.WEEKLY);
        payRunCalendar.setPeriodStartDate(startDate);
        payRunCalendar.setPaymentDate(paymentDate);

        try {
            PayRunCalendarObject result = apiInstance.createPayRunCalendar(accessToken, xeroTenantId, payRunCalendar);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createPayRunCalendar");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
payRunCalendar *
PayRunCalendar
Required

createReimbursement

Creates a new reimbursement


/Reimbursements

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        
        Reimbursement reimbursement = new Reimbursement();
        reimbursement.setName("Test Reimbursement");
        reimbursement.setAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        reimbursement.setCalculationType(com.xero.models.payrollnz.Reimbursement.CalculationTypeEnum.FIXEDAMOUNT);
        reimbursement.setReimbursementCategory(com.xero.models.payrollnz.Reimbursement.ReimbursementCategoryEnum.GST);

        try {
            ReimbursementObject result = apiInstance.createReimbursement(accessToken, xeroTenantId, reimbursement);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createReimbursement");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
reimbursement *
Reimbursement
Required

createSuperannuation

Creates a new superannuation


/Superannuations

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        
        Benefit benefit = new Benefit();
        benefit.setCategory(com.xero.models.payrollnz.Benefit.CategoryEnum.ComplyingFund);
        benefit.setCalculationTypeNZ(com.xero.models.payrollnz.Benefit.CalculationTypeNZ.PercentageOfTaxableEarnings);
        benefit.setLiabilityAccountId(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        benefit.setExpenseAccountId(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        benefit.setPercentage(3);
        benefit.setStandardAmount(100);

        try {
            SuperannuationObject result = apiInstance.createSuperannuation(accessToken, xeroTenantId, benefit);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createSuperannuation");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings Grant read-write access to payroll settings

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
benefit *
Benefit
Required

createTimesheet

Creates a new timesheet


/Timesheets

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        LocalDate startDate = LocalDate.of(2020, Month.OCTOBER, 28);
        LocalDate endDate = LocalDate.of(2020, Month.OCTOBER, 30);
        
        Timesheet timesheet = new Timesheet();
        .setPayrollCalendarID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        .setEmployeeID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        timesheet.setStartDate(startDate);
        timesheet.setEndDate(endDate);

        try {
            TimesheetObject result = apiInstance.createTimesheet(accessToken, xeroTenantId, timesheet);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createTimesheet");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.timesheets Grant read-write access to payroll timesheets

Parameters

Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
timesheet *
Timesheet
Required

createTimesheetLine

Create a new timesheet line for a specific time sheet


/Timesheets/{TimesheetID}/Lines

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID timesheetID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");
        LocalDate date = LocalDate.of(2020, Month.OCTOBER, 28);
        
        TimesheetLine timesheetLine = new TimesheetLine();
        timesheetLine.setTimesheetLineID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        timesheetLine.setDate(date);
        timesheetLine.setEarningsRateID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        timesheetLine.setTrackingItemID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        timesheetLine.setNumberOfUnits(6);

        try {
            TimesheetLineObject result = apiInstance.createTimesheetLine(accessToken, xeroTenantId, timesheetID, timesheetLine);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#createTimesheetLine");
            e.printStackTrace();
        }
    }
}

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
Body parameters
Name Description
timesheetLine *
TimesheetLine
Required

deleteEmployeeEarningsTemplate

Deletes an employee's earnings template record


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        UUID payTemplateEarningID = UUID.fromString("3fa85f64-5717-4562-b3fc-2c963f66afa6");

        try {
            EarningsTemplateObject result = apiInstance.deleteEmployeeEarningsTemplate(accessToken, xeroTenantId, employeeID, payTemplateEarningID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#deleteEmployeeEarningsTemplate");
            e.printStackTrace();
        }
    }
}

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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        UUID leaveID = UUID.fromString("c4be24e5-e840-4c92-9eaa-2d86cd596314");

        try {
            EmployeeLeaveObject result = apiInstance.deleteEmployeeLeave(accessToken, xeroTenantId, employeeID, leaveID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#deleteEmployeeLeave");
            e.printStackTrace();
        }
    }
}

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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        UUID salaryAndWagesID = UUID.fromString("3fa85f64-5717-4562-b3fc-2c963f66afa6");

        try {
            SalaryAndWageObject result = apiInstance.deleteEmployeeSalaryAndWage(accessToken, xeroTenantId, employeeID, salaryAndWagesID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#deleteEmployeeSalaryAndWage");
            e.printStackTrace();
        }
    }
}

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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID timesheetID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            TimesheetLine result = apiInstance.deleteTimesheet(accessToken, xeroTenantId, timesheetID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#deleteTimesheet");
            e.printStackTrace();
        }
    }
}

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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID timesheetID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");
        UUID timesheetLineID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            TimesheetLine result = apiInstance.deleteTimesheetLine(accessToken, xeroTenantId, timesheetID, timesheetLineID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#deleteTimesheetLine");
            e.printStackTrace();
        }
    }
}

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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID deductionId = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            DeductionObject result = apiInstance.getDeduction(accessToken, xeroTenantId, deductionId);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getDeduction");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        Integer page = 56;

        try {
            Deductions result = apiInstance.getDeductions(accessToken, xeroTenantId, page);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getDeductions");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID earningsRateID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            EarningsRateObject result = apiInstance.getEarningsRate(accessToken, xeroTenantId, earningsRateID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEarningsRate");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        Integer page = 56;

        try {
            EarningsRates result = apiInstance.getEarningsRates(accessToken, xeroTenantId, page);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEarningsRates");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");

        try {
            EmployeeObject result = apiInstance.getEmployee(accessToken, xeroTenantId, employeeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployee");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
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

getEmployeeLeaveBalances

Retrieves leave balances for a specific employee


/Employees/{EmployeeID}/LeaveBalances

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");

        try {
            EmployeeLeaveBalances result = apiInstance.getEmployeeLeaveBalances(accessToken, xeroTenantId, employeeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployeeLeaveBalances");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
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

getEmployeeLeavePeriods

Retrieves leave periods for a specific employee


/Employees/{EmployeeID}/LeavePeriods

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        date startDate = 2013-10-20;
        date endDate = Johnson;

        try {
            LeavePeriods result = apiInstance.getEmployeeLeavePeriods(accessToken, xeroTenantId, employeeID, startDate, endDate);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployeeLeavePeriods");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
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
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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");

        try {
            EmployeeLeaveTypes result = apiInstance.getEmployeeLeaveTypes(accessToken, xeroTenantId, employeeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployeeLeaveTypes");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
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

getEmployeeLeaves

Retrieves leave records for a specific employee


/Employees/{EmployeeID}/Leave

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");

        try {
            EmployeeLeaves result = apiInstance.getEmployeeLeaves(accessToken, xeroTenantId, employeeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployeeLeaves");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
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

getEmployeeOpeningBalances

Retrieves the opening balance for a specific employee


/Employees/{EmployeeID}/openingBalances

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");

        try {
            EmployeeOpeningBalancesObject result = apiInstance.getEmployeeOpeningBalances(accessToken, xeroTenantId, employeeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployeeOpeningBalances");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
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

getEmployeePayTemplates

Retrieves pay templates for a specific employee


/Employees/{EmployeeID}/PayTemplates

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");

        try {
            EmployeePayTemplates result = apiInstance.getEmployeePayTemplates(accessToken, xeroTenantId, employeeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployeePayTemplates");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
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

getEmployeePaymentMethod

Retrieves available payment methods for a specific employee


/Employees/{EmployeeID}/PaymentMethods

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");

        try {
            PaymentMethodObject result = apiInstance.getEmployeePaymentMethod(accessToken, xeroTenantId, employeeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployeePaymentMethod");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
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

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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        UUID salaryAndWagesID = UUID.fromString("3fa85f64-5717-4562-b3fc-2c963f66afa6");

        try {
            SalaryAndWages result = apiInstance.getEmployeeSalaryAndWage(accessToken, xeroTenantId, employeeID, salaryAndWagesID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployeeSalaryAndWage");
            e.printStackTrace();
        }
    }
}

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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        Integer page = 56;

        try {
            SalaryAndWages result = apiInstance.getEmployeeSalaryAndWages(accessToken, xeroTenantId, employeeID, page);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployeeSalaryAndWages");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
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
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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");

        try {
            EmployeeTaxObject result = apiInstance.getEmployeeTax(accessToken, xeroTenantId, employeeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployeeTax");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
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

getEmployees

Retrieves employees


/Employees

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        String firstName = 'John';
        String lastName = 'Johnson';
        Integer page = 56;

        try {
            Employees result = apiInstance.getEmployees(accessToken, xeroTenantId, firstName, lastName, page);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getEmployees");
            e.printStackTrace();
        }
    }
}

Scopes

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
firstName
String
Filter by first name
lastName
String
Filter by last name
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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID leaveTypeID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            LeaveTypeObject result = apiInstance.getLeaveType(accessToken, xeroTenantId, leaveTypeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getLeaveType");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        Integer page = 56;
        Boolean activeOnly = true;

        try {
            LeaveTypes result = apiInstance.getLeaveTypes(accessToken, xeroTenantId, page, activeOnly);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getLeaveTypes");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID payRunID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            PayRunObject result = apiInstance.getPayRun(accessToken, xeroTenantId, payRunID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getPayRun");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.payruns.read Grant read-only access to payroll payruns
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

getPayRunCalendar

Retrieves a specific payrun calendar by using a unique payroll calendar ID


/PayRunCalendars/{PayrollCalendarID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID payrollCalendarID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            PayRunCalendarObject result = apiInstance.getPayRunCalendar(accessToken, xeroTenantId, payrollCalendarID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getPayRunCalendar");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        Integer page = 56;

        try {
            PayRunCalendars result = apiInstance.getPayRunCalendars(accessToken, xeroTenantId, page);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getPayRunCalendars");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        Integer page = 56;
        String status = 'status_example';

        try {
            PayRuns result = apiInstance.getPayRuns(accessToken, xeroTenantId, page, status);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getPayRuns");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.payruns.read Grant read-only access to payroll payruns
payroll.payruns Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID paySlipID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            PaySlipObject result = apiInstance.getPaySlip(accessToken, xeroTenantId, paySlipID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getPaySlip");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.payslip.read Grant read-only access to payroll payslips
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

getPaySlips

Retrieves payslips


/PaySlips

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID payRunID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");
        Integer page = 56;

        try {
            PaySlips result = apiInstance.getPaySlips(accessToken, xeroTenantId, payRunID, page);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getPaySlips");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.payslip.read Grant read-only access to payroll payslips
payroll.payslip Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID reimbursementID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            ReimbursementObject result = apiInstance.getReimbursement(accessToken, xeroTenantId, reimbursementID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getReimbursement");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        Integer page = 56;

        try {
            Reimbursements result = apiInstance.getReimbursements(accessToken, xeroTenantId, page);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getReimbursements");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';

        try {
            Settings result = apiInstance.getSettings(accessToken, xeroTenantId);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getSettings");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
settings.payslip

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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID id = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            StatutoryDeductionObject result = apiInstance.getStatutoryDeduction(accessToken, xeroTenantId, id);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getStatutoryDeduction");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        Integer page = 56;

        try {
            StatutoryDeductions result = apiInstance.getStatutoryDeductions(accessToken, xeroTenantId, page);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getStatutoryDeductions");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID superannuationID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            SuperannuationObject result = apiInstance.getSuperannuation(accessToken, xeroTenantId, superannuationID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getSuperannuation");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        Integer page = 56;

        try {
            Superannuations result = apiInstance.getSuperannuations(accessToken, xeroTenantId, page);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getSuperannuations");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
payroll.settings Grant read-write 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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID timesheetID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            TimesheetObject result = apiInstance.getTimesheet(accessToken, xeroTenantId, timesheetID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getTimesheet");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.timesheets.read Grant read-only access to payroll timesheets
timesheets.settings

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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        Integer page = 56;
        UUID employeeId = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");
        UUID payrollCalendarId = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            Timesheets result = apiInstance.getTimesheets(accessToken, xeroTenantId, page, employeeId, payrollCalendarId);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getTimesheets");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.timesheets.read Grant read-only access to payroll timesheets
payroll.timesheets Grant read-write 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.
employeeId
UUID (uuid)
By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeID} to get only the timesheets of a particular employee.
payrollCalendarId
UUID (uuid)
By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id

getTrackingCategories

Retrieves tracking categories


/Settings/TrackingCategories

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';

        try {
            TrackingCategories result = apiInstance.getTrackingCategories(accessToken, xeroTenantId);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#getTrackingCategories");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.settings.read Grant read-only access to payroll settings
settings.payslip

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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID timesheetID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");

        try {
            TimesheetObject result = apiInstance.revertTimesheet(accessToken, xeroTenantId, timesheetID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#revertTimesheet");
            e.printStackTrace();
        }
    }
}

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

updateEmployee

Updates an existing employee


/Employees/{EmployeeID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        LocalDate dateOfBirth = LocalDate.of(2000, Month.OCTOBER, 28);
        
        Address address = new Address();
        address.setAddressLine1("123 Test st");
        address.setCity("Rangiora");
        address.setPostCode("7400");
        address.setCountryName("NEW ZEALAND");
        
        Employee employee = new Employee();
        employee.setFirstName("Adam");
        employee.setLastName("Adamson");
        employee.setDateOfBirth(dateOfBirth);
        employee.setAddress(address);

        try {
            EmployeeObject result = apiInstance.updateEmployee(accessToken, xeroTenantId, employeeID, employee);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#updateEmployee");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
employee *
Employee
Required

updateEmployeeEarningsTemplate

Updates an earnings template records for an employee


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        UUID payTemplateEarningID = UUID.fromString("3fa85f64-5717-4562-b3fc-2c963f66afa6");
        
        EarningsTemplate earningsTemplate = new EarningsTemplate();
        earningsTemplate.setPayTemplateEarningID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        earningsTemplate.setRatePerUnit(14.25);
        earningsTemplate.setNumberOfUnits(35.5);
        earningsTemplate.setFixedAmount(50);
        earningsTemplate.setEarningsRateID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        earningsTemplate.setName("Overtime Hours");

        List<EarningsTemplate> earningsTemplates = new ArrayList<EarningsTemplate>();
        earningsTemplates.add(earningsTemplate);

        try {
            EarningsTemplateObject result = apiInstance.updateEmployeeEarningsTemplate(accessToken, xeroTenantId, employeeID, payTemplateEarningID, earningsTemplate);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#updateEmployeeEarningsTemplate");
            e.printStackTrace();
        }
    }
}

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
Body parameters
Name Description
earningsTemplate *
EarningsTemplate
Required

updateEmployeeLeave

Updates leave records for a specific employee


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        UUID leaveID = UUID.fromString("c4be24e5-e840-4c92-9eaa-2d86cd596314");
        LocalDate startDate = LocalDate.of(2020, Month.OCTOBER, 28);
        LocalDate endDate = LocalDate.of(2020, Month.OCTOBER, 30);
        
        EmployeeLeave employeeLeave = new EmployeeLeave();
        employeeLeave.setLeaveTypeID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        employeeLeave.setStartDate(startDate);
        employeeLeave.setEndDate(endDate);

        try {
            EmployeeLeaveObject result = apiInstance.updateEmployeeLeave(accessToken, xeroTenantId, employeeID, leaveID, employeeLeave);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#updateEmployeeLeave");
            e.printStackTrace();
        }
    }
}

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
Body parameters
Name Description
employeeLeave *
EmployeeLeave
Required

updateEmployeeSalaryAndWage

Updates an employee's salary and wages record


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        UUID salaryAndWagesID = UUID.fromString("3fa85f64-5717-4562-b3fc-2c963f66afa6");
        
        SalaryAndWage salaryAndWage = new SalaryAndWage();
        salaryAndWage.setEarningsRateID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        salaryAndWage.setNumberOfUnitsPerDay(0);
        salaryAndWage.setDaysPerWeek(0);
        salaryAndWage.setPaymentType(com.xero.models.payrollnz.SalaryAndWage.PaymentTypeEnum.HOURLY);

        try {
            SalaryAndWageObject result = apiInstance.updateEmployeeSalaryAndWage(accessToken, xeroTenantId, employeeID, salaryAndWagesID, salaryAndWage);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#updateEmployeeSalaryAndWage");
            e.printStackTrace();
        }
    }
}

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
Body parameters
Name Description
salaryAndWage *
SalaryAndWage
Required

updateEmployeeTax

Updates the tax records for a specific employee


/Employees/{EmployeeID}/Tax

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID employeeID = UUID.fromString("4ff1e5cc-9835-40d5-bb18-09fdb118db9c");
        LocalDate studentLoanAsAt = LocalDate.of(2020, Month.OCTOBER, 30);
        
        EmployeeTax employeeTax = new EmployeeTax();
        employeeTax.setIrdNumber("111111111");
        employeeTax.setHasSpecialStudentLoanRate(true);
        employeeTax.setSpecialStudentLoanRatePercentage(2);
        employeeTax.setIsEligibleForKiwiSaver(true);
        employeeTax.setEsctRatePercentage(17.5);
        employeeTax.setKiwiSaverContributions(com.xero.models.payrollnz.EmployeeTax.KiwiSaverContributionsEnum.MakeContributions);
        employeeTax.setKiwiSaverEmployeeContributionRatePercentage(4);
        employeeTax.setKiwiSaverEmployerSalarySacrificeContributionRatePercentage(2);
        employeeTax.setTaxCode(com.xero.models.payrollnz.TaxCode.MSL);
        employeeTax.setHasStudentLoanBalance(true);
        employeeTax.setStudentLoanBalance(30.0);
        employeeTax.setStudentLoanAsAt(studentLoanAsAt);

        try {
            EmployeeTaxObject result = apiInstance.updateEmployeeTax(accessToken, xeroTenantId, employeeID, employeeTax);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#updateEmployeeTax");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees.read Grant read-only access to payroll employees
payroll.employees Grant read-write access to payroll employees

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Employee id for single object
Required
Header parameters
Name Description
Xero-Tenant-Id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
employeeTax *
EmployeeTax
Required

updatePayRun

Updates a pay run


/PayRuns/{PayRunID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID payRunID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");
        LocalDate startDate = LocalDate.of(2020, Month.OCTOBER, 28);
        LocalDate paymentDate = LocalDate.of(2020, Month.OCTOBER, 30);
        
        PayRunCalendar payRunCalendar = new PayRunCalendar();
        payRunCalendar.setCalendarType(com.xero.models.payrollnz.CalendarType.WEEKLY);
        payRunCalendar.setPeriodStartDate(startDate);
        payRunCalendar.setPaymentDate(paymentDate);

        try {
            PayRunObject result = apiInstance.updatePayRun(accessToken, xeroTenantId, payRunID, payRun);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#updatePayRun");
            e.printStackTrace();
        }
    }
}

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
Body parameters
Name Description
payRun *
PayRun
Required

updatePaySlipLineItems

Creates an employee pay slip


/PaySlips/{PaySlipID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID paySlipID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");
        
        EarningsLine earningsLine = new EarningsLine();
        earningsLine.setEarningsLineID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        earningsLine.setEarningsRateID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        earningsLine.setRatePerUnit(14.25);
        earningsLine.setNumberOfUnits(35.5);
        earningsLine.setIsAverageDailyPayRate(true);
        earningsLine.setIsSystemGenerated(true);

        List<EarningsLine> earningsLines = new ArrayList<EarningsLine>();
        earningsLines.add(earningsLine);
        
        PaySlip paySlip = new PaySlip();
        paySlip.setEarningsLines(earningsLines);

        try {
            PaySlipObject result = apiInstance.updatePaySlipLineItems(accessToken, xeroTenantId, paySlipID, paySlip);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#updatePaySlipLineItems");
            e.printStackTrace();
        }
    }
}

Scopes

payroll.employees Grant read-write access to payroll employees

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
Body parameters
Name Description
paySlip *
PaySlip
Required

updateTimesheetLine

Updates a timesheet line for a specific timesheet


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.PayrollNzApi;
import org.openapitools.client.models.payrollNz.*;

import java.io.File;
import java.util.*;

public class PayrollNzApiExample {
    private PayrollNzApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'xeroTenantId_example';
        UUID timesheetID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");
        UUID timesheetLineID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");
        LocalDate date = LocalDate.of(2020, Month.OCTOBER, 28);
        
        TimesheetLine timesheetLine = new TimesheetLine();
        timesheetLine.setTimesheetLineID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        timesheetLine.setDate(date);
        timesheetLine.setEarningsRateID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        timesheetLine.setTrackingItemID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        timesheetLine.setNumberOfUnits(6);

        try {
            TimesheetLineObject result = apiInstance.updateTimesheetLine(accessToken, xeroTenantId, timesheetID, timesheetLineID, timesheetLine);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling PayrollNzApi#updateTimesheetLine");
            e.printStackTrace();
        }
    }
}

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
Body parameters
Name Description
timesheetLine *
TimesheetLine
Required