@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Xero Payroll AU API
@base https://api.xero.com/payroll.xro/1.0
@version 12.0.0
@auth OAuth2
@endpoints 32
@hint download_for_search
@toc Employees(4), LeaveApplications(7), PayItems(2), PayrollCalendars(3), PayRuns(4), Payslip(2), Settings(1), Superfunds(4), SuperfundProducts(1), Timesheets(4)

@group Employees
@endpoint GET /Employees
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int}
@returns(200) {Employees: [map]}
@errors {400}

@endpoint POST /Employees
@optional {Idempotency-Key: str}
@returns(200) {Employees: [map]}
@errors {400}

@endpoint GET /Employees/{EmployeeID}
@required {EmployeeID: str(uuid)}
@returns(200) {Employees: [map]}

@endpoint POST /Employees/{EmployeeID}
@required {EmployeeID: str(uuid)}
@optional {Idempotency-Key: str}
@returns(200) {Employees: [map]}

@endgroup

@group LeaveApplications
@endpoint GET /LeaveApplications
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int}
@returns(200) {LeaveApplications: [map]}
@errors {400}

@endpoint POST /LeaveApplications
@optional {Idempotency-Key: str}
@returns(200) {LeaveApplications: [map]}
@errors {400}

@endpoint GET /LeaveApplications/v2
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int}
@returns(200) {LeaveApplications: [map]}
@errors {400}

@endpoint GET /LeaveApplications/{LeaveApplicationID}
@required {LeaveApplicationID: str(uuid)}
@returns(200) {LeaveApplications: [map]}

@endpoint POST /LeaveApplications/{LeaveApplicationID}
@required {LeaveApplicationID: str(uuid)}
@optional {Idempotency-Key: str}
@returns(200) {LeaveApplications: [map]}
@errors {400}

@endpoint POST /LeaveApplications/{LeaveApplicationID}/approve
@required {LeaveApplicationID: str(uuid)}
@optional {Idempotency-Key: str}
@returns(200) {LeaveApplications: [map]}
@errors {400}

@endpoint POST /LeaveApplications/{LeaveApplicationID}/reject
@required {LeaveApplicationID: str(uuid)}
@optional {Idempotency-Key: str}
@returns(200) {LeaveApplications: [map]}
@errors {400}

@endgroup

@group PayItems
@endpoint GET /PayItems
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int}
@returns(200) {PayItems: map{EarningsRates: [map], DeductionTypes: [map], LeaveTypes: [map], ReimbursementTypes: [map]}}
@errors {400}

@endpoint POST /PayItems
@optional {Idempotency-Key: str, EarningsRates: [map{Name: str, AccountCode: str, TypeOfUnits: str, IsExemptFromTax: bool, IsExemptFromSuper: bool, IsReportableAsW1: bool, IsQualifyingEarnings: bool, AllowanceContributesToAnnualLeaveRate: bool, AllowanceContributesToOvertimeRate: bool, EarningsType: str, EarningsRateID: str(uuid), RateType: str, RatePerUnit: str, Multiplier: num(double), AccrueLeave: bool, Amount: num(double), EmploymentTerminationPaymentType: str, UpdatedDateUTC: str, CurrentRecord: bool, AllowanceType: str, AllowanceCategory: str}], DeductionTypes: [map{Name: str, AccountCode: str, ReducesTax: bool, ReducesSuper: bool, IsExemptFromW1: bool, DeductionTypeID: str(uuid), UpdatedDateUTC: str, DeductionCategory: str, CurrentRecord: bool}], LeaveTypes: [map{Name: str, TypeOfUnits: str, LeaveTypeID: str(uuid), NormalEntitlement: num(double), LeaveLoadingRate: num(double), UpdatedDateUTC: str, IsPaidLeave: bool, ShowOnPayslip: bool, CurrentRecord: bool, LeaveCategoryCode: str, SGCExempt: bool, IsQualifyingEarnings: bool}], ReimbursementTypes: [map{Name: str, AccountCode: str, ReimbursementTypeID: str(uuid), UpdatedDateUTC: str, CurrentRecord: bool}]}
@returns(200) {PayItems: map{EarningsRates: [map], DeductionTypes: [map], LeaveTypes: [map], ReimbursementTypes: [map]}}
@errors {400}

@endgroup

@group PayrollCalendars
@endpoint GET /PayrollCalendars
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int}
@returns(200) {PayrollCalendars: [map]}
@errors {400}

@endpoint POST /PayrollCalendars
@optional {Idempotency-Key: str}
@returns(200) {PayrollCalendars: [map]}
@errors {400}

@endpoint GET /PayrollCalendars/{PayrollCalendarID}
@required {PayrollCalendarID: str(uuid)}
@returns(200) {PayrollCalendars: [map]}
@errors {400}

@endgroup

@group PayRuns
@endpoint GET /PayRuns
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int}
@returns(200) {PayRuns: [map]}
@errors {400}

@endpoint POST /PayRuns
@optional {Idempotency-Key: str}
@returns(200) {PayRuns: [map]}
@errors {400}

@endpoint GET /PayRuns/{PayRunID}
@required {PayRunID: str(uuid)}
@returns(200) {PayRuns: [map]}

@endpoint POST /PayRuns/{PayRunID}
@required {PayRunID: str(uuid)}
@optional {Idempotency-Key: str}
@returns(200) {PayRuns: [map]}

@endgroup

@group Payslip
@endpoint GET /Payslip/{PayslipID}
@required {PayslipID: str(uuid)}
@returns(200) {Payslip: map{EmployeeID: str(uuid), PayslipID: str(uuid), FirstName: str, LastName: str, Wages: num(double), Deductions: num(double), Tax: num(double), Super: num(double), Reimbursements: num(double), NetPay: num(double), EarningsLines: [map], LeaveEarningsLines: [map], TimesheetEarningsLines: [map], DeductionLines: [map], LeaveAccrualLines: [map], ReimbursementLines: [map], SuperannuationLines: [map], TaxLines: [map], UpdatedDateUTC: str}}

@endpoint POST /Payslip/{PayslipID}
@required {PayslipID: str(uuid)}
@optional {Idempotency-Key: str}
@returns(200) {Payslips: [map]}

@endgroup

@group Settings
@endpoint GET /Settings
@returns(200) {Settings: map{Accounts: [map], TrackingCategories: map{EmployeeGroups: map{TrackingCategoryID: str(uuid), TrackingCategoryName: str}, TimesheetCategories: map{TrackingCategoryID: str(uuid), TrackingCategoryName: str}}, DaysInPayrollYear: int(int32), EmployeesAreSTP2: bool}}

@endgroup

@group Superfunds
@endpoint GET /Superfunds
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int}
@returns(200) {SuperFunds: [map]}
@errors {400}

@endpoint POST /Superfunds
@optional {Idempotency-Key: str}
@returns(200) {SuperFunds: [map]}
@errors {400}

@endpoint GET /Superfunds/{SuperFundID}
@required {SuperFundID: str(uuid)}
@returns(200) {SuperFunds: [map]}

@endpoint POST /Superfunds/{SuperFundID}
@required {SuperFundID: str(uuid)}
@optional {Idempotency-Key: str}
@returns(200) {SuperFunds: [map]}

@endgroup

@group SuperfundProducts
@endpoint GET /SuperfundProducts
@optional {ABN: str, USI: str}
@returns(200) {SuperFundProducts: [map]}
@errors {400}

@endgroup

@group Timesheets
@endpoint GET /Timesheets
@optional {If-Modified-Since: str(date-time), where: str, order: str, page: int}
@returns(200) {Timesheets: [map]}
@errors {400}

@endpoint POST /Timesheets
@optional {Idempotency-Key: str}
@returns(200) {Timesheets: [map]}
@errors {400}

@endpoint GET /Timesheets/{TimesheetID}
@required {TimesheetID: str(uuid)}
@returns(200) {Timesheet: map{EmployeeID: str(uuid), StartDate: str, EndDate: str, Status: str, Hours: num(double), TimesheetID: str(uuid), TimesheetLines: [map], UpdatedDateUTC: str, ValidationErrors: [map]}}

@endpoint POST /Timesheets/{TimesheetID}
@required {TimesheetID: str(uuid)}
@optional {Idempotency-Key: str}
@returns(200) {Timesheets: [map]}

@endgroup

@end
