From 6cd1df1f1134b8ed78797bed8572cdda33be2865 Mon Sep 17 00:00:00 2001 From: Sue O'Beirne Date: Wed, 1 Oct 2025 14:10:33 +1000 Subject: [PATCH 1/6] Add earnings rates endpoint to payroll api au --- xero-payroll-au.yaml | 449 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 438 insertions(+), 11 deletions(-) diff --git a/xero-payroll-au.yaml b/xero-payroll-au.yaml index 69b937b7f..243f72e15 100644 --- a/xero-payroll-au.yaml +++ b/xero-payroll-au.yaml @@ -12,9 +12,10 @@ info: name: MIT url: https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE servers: - - description: Xero Payroll AU API + - description: Xero Payroll AU API (v1) url: https://api.xero.com/payroll.xro/1.0 tags: + - name: PayrollAu description: Operations available to regular developers paths: @@ -502,6 +503,275 @@ paths: items: $ref: '#/components/schemas/Employee' example: '[ { "MiddleNames": "Frank" } ]' + /EarningsRates: + parameters: + - $ref: '#/components/parameters/requiredHeader' + get: + security: + - OAuth2: + - payroll.settings + - payroll.settings.read + tags: + - PayrollAu + operationId: getEarningsRates + x-hasPayrollUkProblem: true + servers: + - url: https://api.xero.com/payroll.xro/2.0 + summary: Allows you to retrieve all payroll earnings rates in a Xero organisation + parameters: + - in: query + name: page + description: Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. When page value is not a number or a negative number, by default, the first set of records is returned + example: https://api.xero.com/payroll.xro/2.0/earningsRates?page=2 to get the second set of the records. + schema: + type: integer + responses: + "200": + description: search results matching criteria + content: + application/json: + schema: + $ref: '#/components/schemas/EarningsRateObject' + example: + id: 00000000-0000-0000-0000-000000000000 + providerName: provider-name + dateTimeUTC: 2025-08-28T18:25:57.0647738 + httpStatusCode: OK + pagination: + page: 1 + pageSize: 100 + pageCount: 1 + itemCount: 2 + problem: null + earningsRates: + - earningsRateID: e061a3ee-2f13-4cdb-adb2-f8e50128759b + name: Ordinary Hours + earningsType: OrdinaryTimeEarnings + rateType: RatePerUnit + typeOfUnits: Hours + currentRecord: true + expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 + fixedAmount: null + ratePerUnit: null + multipleOfOrdinaryEarningsRate: null + isSubjectToTax: true + isSubjectToSuper: true + isReportableAsW1: null + accrueLeave: false + employmentTerminationPaymentType: null + allowanceType: null + allowanceCategory: null + allowanceContributesToAnnualLeaveRate: null + allowanceContributesToOvertimeRate: null + - earningsRateID: 69d7bd2a-7a8c-4b86-b1e2-686484f234e6 + name: Salary + earningsType: RegularEarnings + rateType: RatePerUnit + typeOfUnits: hours + currentRecord: true + expenseAccountID: f30eb980-23b1-4e3e-b707-a15fe4be1182 + fixedAmount: null + ratePerUnit: 2500.011 + multipleOfOrdinaryEarningsRate: null + isSubjectToTax: true + isSubjectToSuper: true + isReportableAsW1: true + accrueLeave: false + employmentTerminationPaymentType: null + allowanceType: null + allowanceCategory: null + allowanceContributesToAnnualLeaveRate: null + allowanceContributesToOvertimeRate: null + + "400": + description: validation error for a bad request + content: + application/json: + schema: + $ref: '#/components/schemas/Problem' + post: + security: + - OAuth2: + - payroll.settings + tags: + - PayrollAu + operationId: createEarningsRate + x-hasPayrollUkProblem: true + servers: + - url: https://api.xero.com/payroll.xro/2.0 + x-example: + - earningsRate: + key: earningsRate + keyPascal: EarningsRate + keySnake: earnings_rate + is_object: true + - name: + key: name + keyPascal: Name + keySnake: name + object: earningsRate + - earningsType: + key: earningsType + keyPascal: EarningsType + keySnake: earnings_type + php: XeroAPI\XeroPHP\Models\PayrollNz\EarningsRate\EarningsTypeEnum.RegularEarnings + node: EarningsRate.EarningsTypeEnum.REGULAREARNINGS + ruby: XeroRuby::PayrollNz::EarningsRate::EarningsTypeEnum::REGULAREARNINGS + python_string: REGULAREARNINGS + java: com.xero.models.payrollnz.EarningsRate.EarningsTypeEnum.RegularEarnings + csharp: EarningsRate.EarningsTypeEnum.RegularEarnings + default: RegularEarnings + nonString: true + object: earningsRate + - rateType: + key: rateType + keyPascal: RateType + keySnake: rate_type + php: XeroAPI\XeroPHP\Models\PayrollNz\EarningsRate\RateTypeEnum.RatePerUnit + node: EarningsRate.RateTypeEnum.RatePerUnit + ruby: XeroRuby::PayrollNz::EarningsRate::RateTypeEnum::ACCPAYCREDIT + python_string: RATEPERUNIT + java: com.xero.models.payrollnz.EarningsRate.RateTypeEnum.RATEPERUNIT + csharp: EarningsRate.RateTypeEnum.RatePerUnit + default: RatePerUnit + object: earningsRate + nonString: true + - expenseAccountId: + key: expenseAccountID + keyPascal: ExpenseAccountID + keySnake: expense_account_ID + is_uuid: true + default: 00000000-0000-0000-0000-000000000000 + object: earningsRate + is_last: true + - isSubjectToTax: + key: isSubjectToTax + keyPascal: isSubjectToTax + keySnake: is_subject_to_tax + object: earningsRate + nonString: true + - isSubjectToSuper: + key: isSubjectToSuper + keyPascal: isSubjectToSuper + keySnake: is_subject_to_super + object: earningsRate + nonString: true + + summary: Allows you to add an earnings rate in a Xero organisation + parameters: + - $ref: '#/components/parameters/idempotencyKey' + responses: + "200": + description: search results matching criteria + content: + application/json: + schema: + $ref: '#/components/schemas/EarningsRateObject' + example: + id: 00000000-0000-0000-0000-000000000000 + providerName: provider-name + dateTimeUTC: 2020-08-28T18:25:57.8141393 + httpStatusCode: OK + pagination: null + problem: null + earningsRates: + - earningsRateID: e0f7095a-8522-4d83-88ea-35d5e8953b96 + name: MyRate + earningsType: ORDINARYTIMEEARNINGS + rateType: RatePerUnit + typeOfUnits: Hours + currentRecord: true + expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 + fixedAmount: null + ratePerUnit: null + multipleOfOrdinaryEarningsRate: null + isSubjectToTax: true + isSubjectToSuper: true + isReportableAsW1: null + accrueLeave: false + employmentTerminationPaymentType: null + allowanceType: null + allowanceCategory: null + allowanceContributesToAnnualLeaveRate: null + allowanceContributesToOvertimeRate: null + "400": + description: validation error for a bad request + content: + application/json: + schema: + $ref: '#/components/schemas/Problem' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EarningsRateV2' + example: + - name: MyRate + earningsType: OrdinaryTimeEarnings + rateType: RatePerUnit + typeOfUnits: Hours + expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 + isSubjectToTax: true + isSubjectToSuper: true + /EarningsRates/{EarningsRateID}: + parameters: + - $ref: '#/components/parameters/requiredHeader' + get: + security: + - OAuth2: + - payroll.settings + - payroll.settings.read + tags: + - PayrollAu + operationId: getEarningsRate + servers: + - url: https://api.xero.com/payroll.xro/2.0 + x-hasPayrollUkProblem: true + summary: Allows you to retrieve details of an earnings rate in a Xero organisation by using a unique earnings rate id + parameters: + - in: path + name: EarningsRateID + x-snake: earnings_rate_id + required: true + description: Identifier for the earnings rate + schema: + type: string + format: uuid + responses: + "200": + description: search results matching criteria + content: + application/json: + schema: + $ref: '#/components/schemas/EarningsRateObject' + example: + id: 00000000-0000-0000-0000-000000000000 + providerName: provider-name + dateTimeUTC: 2020-08-28T18:25:57.8191994 + httpStatusCode: OK + pagination: null + problem: null + earningsRate: + earningsRateID: e061a3ee-2f13-4cdb-adb2-f8e50128759b + name: Ordinary Hours + earningsType: OrdinaryTimeEarnings + rateType: RatePerUnit + typeOfUnits: Hours + currentRecord: true + expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 + fixedAmount: null + ratePerUnit: null + multipleOfOrdinaryEarningsRate: null + isSubjectToTax: true + isSubjectToSuper: true + isReportableAsW1: false + accrueLeave: false + employmentTerminationPaymentType: null + allowanceType: null + allowanceCategory: null + allowanceContributesToAnnualLeaveRate: false + allowanceContributesToOvertimeRate: false /LeaveApplications: parameters: - $ref: '#/components/parameters/requiredHeader' @@ -1587,7 +1857,7 @@ paths: - EarningsRateID: 1fa4e226-b711-46ba-a8a7-4344c9c5fb87 Name: MyRate EarningsType: ORDINARYTIMEEARNINGS - RateType: MULTIPLE + RateType: MULTIPLEOFORDINARYEARNINGSRATE AccountCode: "400" Multiplier: 1.5 IsExemptFromTax: true @@ -1644,7 +1914,7 @@ paths: AllowanceContributesToOvertimeRate: false EarningsType: ORDINARYTIMEEARNINGS EarningsRateID: 1fa4e226-b711-46ba-a8a7-4344c9c5fb87 - RateType: MULTIPLE + RateType: MULTIPLEOFORDINARYEARNINGSRATE RatePerUnit: "10.0" Multiplier: 1.5 Amount: 5 @@ -3188,7 +3458,9 @@ components: x-snake: xero_tenant_id description: Xero identifier for Tenant schema: - type: string + type: string + format: uuid + example: 4ff1e5cc-9835-40d5-bb18-09fdb118db9c required: true idempotencyKey: in: header @@ -3478,7 +3750,7 @@ components: EarningsRates: type: array items: - $ref: '#/components/schemas/EarningsRate' + $ref: '#/components/schemas/EarningsRateV1' DeductionTypes: type: array items: @@ -4209,8 +4481,9 @@ components: description: Name of account type: string example: General expenses - EarningsRate: + EarningsRateV1: type: object + description: Earnings Rate for https://api.xero.com/payroll.xro/1.0 Xero Payroll AU API (v1) properties: Name: description: Name of the earnings rate (max length = 100) @@ -4259,14 +4532,14 @@ components: description: Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. type: string example: 10 - Multiplier: - description: This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE + MultipleOfOrdinaryEarningsRate: + description: This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLEOFORDINARYEARNINGSRATE type: number format: double x-is-money: true example: 1.5 AccrueLeave: - description: Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE + description: Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLEOFORDINARYEARNINGSRATE type: boolean example: false Amount: @@ -4291,6 +4564,160 @@ components: $ref: '#/components/schemas/AllowanceType' AllowanceCategory: $ref: '#/components/schemas/AllowanceCategory' + EarningsRates: + type: object + properties: + pagination: + $ref: '#/components/schemas/Pagination' + problem: + $ref: '#/components/schemas/Problem' + earningsRates: + type: array + items: + $ref: '#/components/schemas/EarningsRateV2' + Pagination: + properties: + page: + type: integer + example: 1 + pageSize: + type: integer + example: 10 + pageCount: + type: integer + example: 1 + itemCount: + type: integer + example: 2 + Problem: + description: The object returned for a bad request + type: object + properties: + type: + description: The type of error format + type: string + example: application/problem+json + title: + description: The type of the error + type: string + example: BadRequest + status: + description: The error status code + type: string + example: 400 + detail: + description: A description of the error + type: string + example: Validation error occurred. + instance: + type: string + invalidFields: + type: array + items: + $ref: '#/components/schemas/InvalidField' + InvalidField: + type: object + properties: + name: + description: The name of the field that caused the error + type: string + example: isExemptFromSuper + reason: + description: The reason the error occurred + type: string + example: The property isExemptFromSuper is required. + EarningsRateV2: + type: object + description: Earnings Rate for https://api.xero.com/payroll.xro/2.0 Xero Payroll AU API (v2) + properties: + EarningsRateID: + description: Xero unique identifier for an earnings rate + type: string + format: uuid + example: e0eb6747-7c17-4075-b804-989f8d4e5d39 + Name: + description: Name of the earnings rate (max length = 100) + type: string + example: PTO + maxLength: 100 + EarningsType: + description: Indicates how an employee will be paid when taking this type of earning + $ref: '#/components/schemas/EarningsType' + RateType: + description: Indicates the type of the earnings rate + $ref: '#/components/schemas/RateType' + TypeOfUnits: + description: Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT + type: string + example: Fixed + maxLength: 50 + CurrentRecord: + description: Indicates whether an earnings type is active + type: boolean + example: true + ExpenseAccountID: + description: The account that will be used for the earnings rate + type: string + format: uuid + example: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 + RatePerUnit: + description: Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. + type: string + example: 10 + MultipleOfOrdinaryEarningsRate: + description: This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLEOFORDINARYEARNINGSRATE + type: number + format: double + x-is-money: true + example: 1.5 + FixedAmount: + description: Optional Fixed Rate Amount. Applicable only if RateType is FixedAmount + type: number + format: double + x-is-money: true + example: 50.30 + IsSubjectToTax: + description: Payments of this type are subject to PAYG withholding + type: boolean + example: false + IsSubjectToSuper: + description: Payments of this type are subject to Superannuation Guarantee Contribution + type: boolean + example: false + IsReportableAsW1: + description: Whether the earnings rate is reportable or exempt from W1 + type: boolean + example: false + AccrueLeave: + description: Indicates that this earnings rate should affect accruing of leave. Only applicable if RateType is MULTIPLEOFORDINARYEARNINGSRATE + type: boolean + example: false + EmploymentTerminationPaymentType: + description: How the earnings should be treated for termination payments + $ref: '#/components/schemas/EmploymentTerminationPaymentType' + AllowanceType: + description: For allowances only, determines the type of allowance + $ref: '#/components/schemas/AllowanceType' + AllowanceCategory: + description: For allowances only, determines the category of allowance + $ref: '#/components/schemas/AllowanceCategory' + AllowanceContributesToAnnualLeaveRate: + description: For allowances using RatePerUnit only, whether it contributes towards the annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT + type: boolean + example: false + AllowanceContributesToOvertimeRate: + description: For allowances using RatePerUnit only, whether it contributes towards the overtime rate. + type: boolean + example: false + EarningsRateObject: + type: object + properties: + pagination: + $ref: '#/components/schemas/Pagination' + problem: + $ref: '#/components/schemas/Problem' + earningsRate: + $ref: '#/components/schemas/EarningsRateV2' DeductionType: type: object properties: @@ -4605,7 +5032,7 @@ components: x-is-money: true example: 38.0000 NormalNumberOfUnits: - description: Normal number of units for EarningsLine. Applicable when RateType is "MULTIPLE" + description: Normal number of units for EarningsLine. Applicable when RateType is "MULTIPLEOFORDINARYEARNINGSRATE" type: number format: double x-is-money: true @@ -4884,7 +5311,7 @@ components: type: string enum: - FIXEDAMOUNT - - MULTIPLE #Multiple of Employee’s Ordinary Earnings Rate - an earnings rate which is derived from an employee’s ordinary earnings rate + - MULTIPLEOFORDINARYEARNINGSRATE #Multiple of Employee’s Ordinary Earnings Rate - an earnings rate which is derived from an employee’s ordinary earnings rate - RATEPERUNIT #An earnings rate allowing entry of a rate per unit EarningsType: type: string From fe141718cabaf545789a06b301ac49754faca0f6 Mon Sep 17 00:00:00 2001 From: Sue O'Beirne Date: Fri, 3 Oct 2025 10:05:27 +1000 Subject: [PATCH 2/6] LV-247 update validation message on get earnings rate, update example for pagination query param, remove unnecessary object --- xero-payroll-au.yaml | 56 ++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/xero-payroll-au.yaml b/xero-payroll-au.yaml index 243f72e15..32abcbbc1 100644 --- a/xero-payroll-au.yaml +++ b/xero-payroll-au.yaml @@ -514,7 +514,6 @@ paths: tags: - PayrollAu operationId: getEarningsRates - x-hasPayrollUkProblem: true servers: - url: https://api.xero.com/payroll.xro/2.0 summary: Allows you to retrieve all payroll earnings rates in a Xero organisation @@ -522,7 +521,7 @@ paths: - in: query name: page description: Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. When page value is not a number or a negative number, by default, the first set of records is returned - example: https://api.xero.com/payroll.xro/2.0/earningsRates?page=2 to get the second set of the records. + example: https://api.xero.com/payroll.xro/2.0/earningsRates?page=1 schema: type: integer responses: @@ -531,7 +530,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EarningsRateObject' + $ref: '#/components/schemas/EarningsRates' example: id: 00000000-0000-0000-0000-000000000000 providerName: provider-name @@ -588,7 +587,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Problem' + description: The object returned for a bad request + type: object + properties: + type: + description: The type of error format + type: string + example: application/problem+json + title: + description: The type of the error + type: string + example: InvalidRequest + status: + description: The error status code + type: string + example: 400 + detail: + description: A description of the error + type: string + example: Requested page does not exist. post: security: - OAuth2: @@ -596,7 +613,6 @@ paths: tags: - PayrollAu operationId: createEarningsRate - x-hasPayrollUkProblem: true servers: - url: https://api.xero.com/payroll.xro/2.0 x-example: @@ -614,11 +630,11 @@ paths: key: earningsType keyPascal: EarningsType keySnake: earnings_type - php: XeroAPI\XeroPHP\Models\PayrollNz\EarningsRate\EarningsTypeEnum.RegularEarnings + php: XeroAPI\XeroPHP\Models\PayrollAu\EarningsRate\EarningsTypeEnum.RegularEarnings node: EarningsRate.EarningsTypeEnum.REGULAREARNINGS - ruby: XeroRuby::PayrollNz::EarningsRate::EarningsTypeEnum::REGULAREARNINGS + ruby: XeroRuby::PayrollAu::EarningsRate::EarningsTypeEnum::REGULAREARNINGS python_string: REGULAREARNINGS - java: com.xero.models.payrollnz.EarningsRate.EarningsTypeEnum.RegularEarnings + java: com.xero.models.PayrollAu.EarningsRate.EarningsTypeEnum.RegularEarnings csharp: EarningsRate.EarningsTypeEnum.RegularEarnings default: RegularEarnings nonString: true @@ -627,11 +643,11 @@ paths: key: rateType keyPascal: RateType keySnake: rate_type - php: XeroAPI\XeroPHP\Models\PayrollNz\EarningsRate\RateTypeEnum.RatePerUnit + php: XeroAPI\XeroPHP\Models\PayrollAu\EarningsRate\RateTypeEnum.RatePerUnit node: EarningsRate.RateTypeEnum.RatePerUnit - ruby: XeroRuby::PayrollNz::EarningsRate::RateTypeEnum::ACCPAYCREDIT + ruby: XeroRuby::PayrollAu::EarningsRate::RateTypeEnum::ACCPAYCREDIT python_string: RATEPERUNIT - java: com.xero.models.payrollnz.EarningsRate.RateTypeEnum.RATEPERUNIT + java: com.xero.models.PayrollAu.EarningsRate.RateTypeEnum.RATEPERUNIT csharp: EarningsRate.RateTypeEnum.RatePerUnit default: RatePerUnit object: earningsRate @@ -666,7 +682,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EarningsRateObject' + $ref: '#/components/schemas/EarningsRates' example: id: 00000000-0000-0000-0000-000000000000 providerName: provider-name @@ -727,7 +743,6 @@ paths: operationId: getEarningsRate servers: - url: https://api.xero.com/payroll.xro/2.0 - x-hasPayrollUkProblem: true summary: Allows you to retrieve details of an earnings rate in a Xero organisation by using a unique earnings rate id parameters: - in: path @@ -744,7 +759,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EarningsRateObject' + $ref: '#/components/schemas/EarningsRates' example: id: 00000000-0000-0000-0000-000000000000 providerName: provider-name @@ -4621,11 +4636,11 @@ components: name: description: The name of the field that caused the error type: string - example: isExemptFromSuper + example: isSubjectToSuper reason: description: The reason the error occurred type: string - example: The property isExemptFromSuper is required. + example: The property isSubjectToSuper is required. EarningsRateV2: type: object description: Earnings Rate for https://api.xero.com/payroll.xro/2.0 Xero Payroll AU API (v2) @@ -4709,15 +4724,6 @@ components: description: For allowances using RatePerUnit only, whether it contributes towards the overtime rate. type: boolean example: false - EarningsRateObject: - type: object - properties: - pagination: - $ref: '#/components/schemas/Pagination' - problem: - $ref: '#/components/schemas/Problem' - earningsRate: - $ref: '#/components/schemas/EarningsRateV2' DeductionType: type: object properties: From 7c3a37957767328e4a0f86052ad6334302059077 Mon Sep 17 00:00:00 2001 From: Sue O'Beirne Date: Fri, 3 Oct 2025 10:32:55 +1000 Subject: [PATCH 3/6] LV-247 add in x-path extension for adding java code gen exception handler --- xero-payroll-au.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xero-payroll-au.yaml b/xero-payroll-au.yaml index 32abcbbc1..7fddef607 100644 --- a/xero-payroll-au.yaml +++ b/xero-payroll-au.yaml @@ -514,6 +514,7 @@ paths: tags: - PayrollAu operationId: getEarningsRates + x-hasPayrollAuProblem: true servers: - url: https://api.xero.com/payroll.xro/2.0 summary: Allows you to retrieve all payroll earnings rates in a Xero organisation @@ -613,6 +614,7 @@ paths: tags: - PayrollAu operationId: createEarningsRate + x-hasPayrollAuProblem: true servers: - url: https://api.xero.com/payroll.xro/2.0 x-example: @@ -741,6 +743,7 @@ paths: tags: - PayrollAu operationId: getEarningsRate + x-hasPayrollAuProblem: true servers: - url: https://api.xero.com/payroll.xro/2.0 summary: Allows you to retrieve details of an earnings rate in a Xero organisation by using a unique earnings rate id From fa14cade631fefe6763fe68be5c9db9c0d48df14 Mon Sep 17 00:00:00 2001 From: Sue O'Beirne Date: Mon, 13 Oct 2025 13:01:11 +1100 Subject: [PATCH 4/6] LV-247 - update global server urls --- xero-payroll-au.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xero-payroll-au.yaml b/xero-payroll-au.yaml index 7fddef607..8ecee9a7e 100644 --- a/xero-payroll-au.yaml +++ b/xero-payroll-au.yaml @@ -14,6 +14,8 @@ info: servers: - description: Xero Payroll AU API (v1) url: https://api.xero.com/payroll.xro/1.0 + - description: Xero Payroll AU API (v2) + url: https://api.xero.com/payroll.xro/2.0 tags: - name: PayrollAu @@ -5858,4 +5860,4 @@ components: Message: description: Validation error message type: string - type: object + type: object \ No newline at end of file From e6a7557dbe23743ebb45a5c0168781c86ec48437 Mon Sep 17 00:00:00 2001 From: Sue O'Beirne Date: Mon, 27 Oct 2025 15:24:49 +1100 Subject: [PATCH 5/6] LV-247 split new earnings rate endpoint into v2 spec --- xero-payroll-au-v2.yaml | 548 ++++++++++++++++++++++++++++++++++++++++ xero-payroll-au.yaml | 464 +--------------------------------- 2 files changed, 561 insertions(+), 451 deletions(-) create mode 100644 xero-payroll-au-v2.yaml diff --git a/xero-payroll-au-v2.yaml b/xero-payroll-au-v2.yaml new file mode 100644 index 000000000..b88786bc3 --- /dev/null +++ b/xero-payroll-au-v2.yaml @@ -0,0 +1,548 @@ +openapi: 3.0.0 +info: + version: 9.1.1 + title: Xero Payroll AU API (v2) + description: This is the v2 for the Xero Payroll API for orgs in Australia region. + termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/" + contact: + name: Xero Platform Team + email: api@xero.com + url: https://developer.xero.com + license: + name: MIT + url: https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE +servers: + - description: Xero Payroll AU API (v2) + url: https://api.xero.com/payroll.xro/2.0 +tags: + + - name: PayrollAu + description: Operations available to regular developers +paths: + /EarningsRates: + parameters: + - $ref: '#/components/parameters/requiredHeader' + get: + security: + - OAuth2: + - payroll.settings + - payroll.settings.read + tags: + - PayrollAu + operationId: getEarningsRates + x-hasPayrollAuProblem: true + servers: + - url: https://api.xero.com/payroll.xro/2.0 + summary: Allows you to retrieve all payroll earnings rates in a Xero organisation + parameters: + - in: query + name: page + description: Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. When page value is not a number or a negative number, by default, the first set of records is returned + example: https://api.xero.com/payroll.xro/2.0/earningsRates?page=1 + schema: + type: integer + responses: + "200": + description: search results matching criteria + content: + application/json: + schema: + $ref: '#/components/schemas/EarningsRates' + example: + id: 00000000-0000-0000-0000-000000000000 + providerName: provider-name + dateTimeUTC: 2025-08-28T18:25:57.0647738 + httpStatusCode: OK + pagination: + page: 1 + pageSize: 100 + pageCount: 1 + itemCount: 2 + problem: null + earningsRates: + - earningsRateID: e061a3ee-2f13-4cdb-adb2-f8e50128759b + name: Ordinary Hours + earningsType: OrdinaryTimeEarnings + rateType: RatePerUnit + typeOfUnits: Hours + currentRecord: true + expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 + fixedAmount: null + ratePerUnit: null + multipleOfOrdinaryEarningsRate: null + isSubjectToTax: true + isSubjectToSuper: true + isReportableAsW1: null + accrueLeave: false + employmentTerminationPaymentType: null + allowanceType: null + allowanceCategory: null + allowanceContributesToAnnualLeaveRate: null + allowanceContributesToOvertimeRate: null + - earningsRateID: 69d7bd2a-7a8c-4b86-b1e2-686484f234e6 + name: Salary + earningsType: RegularEarnings + rateType: RatePerUnit + typeOfUnits: hours + currentRecord: true + expenseAccountID: f30eb980-23b1-4e3e-b707-a15fe4be1182 + fixedAmount: null + ratePerUnit: 2500.011 + multipleOfOrdinaryEarningsRate: null + isSubjectToTax: true + isSubjectToSuper: true + isReportableAsW1: true + accrueLeave: false + employmentTerminationPaymentType: null + allowanceType: null + allowanceCategory: null + allowanceContributesToAnnualLeaveRate: null + allowanceContributesToOvertimeRate: null + + "400": + description: validation error for a bad request + content: + application/json: + schema: + description: The object returned for a bad request + type: object + properties: + type: + description: The type of error format + type: string + example: application/problem+json + title: + description: The type of the error + type: string + example: InvalidRequest + status: + description: The error status code + type: string + example: 400 + detail: + description: A description of the error + type: string + example: Requested page does not exist. + post: + security: + - OAuth2: + - payroll.settings + tags: + - PayrollAu + operationId: createEarningsRate + x-hasPayrollAuProblem: true + servers: + - url: https://api.xero.com/payroll.xro/2.0 + x-example: + - earningsRate: + key: earningsRate + keyPascal: EarningsRate + keySnake: earnings_rate + is_object: true + - name: + key: name + keyPascal: Name + keySnake: name + object: earningsRate + - earningsType: + key: earningsType + keyPascal: EarningsType + keySnake: earnings_type + php: XeroAPI\XeroPHP\Models\PayrollAu\EarningsRate\EarningsTypeEnum.RegularEarnings + node: EarningsRate.EarningsTypeEnum.REGULAREARNINGS + ruby: XeroRuby::PayrollAu::EarningsRate::EarningsTypeEnum::REGULAREARNINGS + python_string: REGULAREARNINGS + java: com.xero.models.PayrollAu.EarningsRate.EarningsTypeEnum.RegularEarnings + csharp: EarningsRate.EarningsTypeEnum.RegularEarnings + default: RegularEarnings + nonString: true + object: earningsRate + - rateType: + key: rateType + keyPascal: RateType + keySnake: rate_type + php: XeroAPI\XeroPHP\Models\PayrollAu\EarningsRate\RateTypeEnum.RatePerUnit + node: EarningsRate.RateTypeEnum.RatePerUnit + ruby: XeroRuby::PayrollAu::EarningsRate::RateTypeEnum::ACCPAYCREDIT + python_string: RATEPERUNIT + java: com.xero.models.PayrollAu.EarningsRate.RateTypeEnum.RATEPERUNIT + csharp: EarningsRate.RateTypeEnum.RatePerUnit + default: RatePerUnit + object: earningsRate + nonString: true + - expenseAccountId: + key: expenseAccountID + keyPascal: ExpenseAccountID + keySnake: expense_account_ID + is_uuid: true + default: 00000000-0000-0000-0000-000000000000 + object: earningsRate + is_last: true + - isSubjectToTax: + key: isSubjectToTax + keyPascal: isSubjectToTax + keySnake: is_subject_to_tax + object: earningsRate + nonString: true + - isSubjectToSuper: + key: isSubjectToSuper + keyPascal: isSubjectToSuper + keySnake: is_subject_to_super + object: earningsRate + nonString: true + + summary: Allows you to add an earnings rate in a Xero organisation + parameters: + - $ref: '#/components/parameters/idempotencyKey' + responses: + "200": + description: search results matching criteria + content: + application/json: + schema: + $ref: '#/components/schemas/EarningsRates' + example: + id: 00000000-0000-0000-0000-000000000000 + providerName: provider-name + dateTimeUTC: 2020-08-28T18:25:57.8141393 + httpStatusCode: OK + pagination: null + problem: null + earningsRates: + - earningsRateID: e0f7095a-8522-4d83-88ea-35d5e8953b96 + name: MyRate + earningsType: ORDINARYTIMEEARNINGS + rateType: RatePerUnit + typeOfUnits: Hours + currentRecord: true + expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 + fixedAmount: null + ratePerUnit: null + multipleOfOrdinaryEarningsRate: null + isSubjectToTax: true + isSubjectToSuper: true + isReportableAsW1: null + accrueLeave: false + employmentTerminationPaymentType: null + allowanceType: null + allowanceCategory: null + allowanceContributesToAnnualLeaveRate: null + allowanceContributesToOvertimeRate: null + "400": + description: validation error for a bad request + content: + application/json: + schema: + $ref: '#/components/schemas/Problem' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EarningsRate' + example: + - name: MyRate + earningsType: OrdinaryTimeEarnings + rateType: RatePerUnit + typeOfUnits: Hours + expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 + isSubjectToTax: true + isSubjectToSuper: true + /EarningsRates/{EarningsRateID}: + parameters: + - $ref: '#/components/parameters/requiredHeader' + get: + security: + - OAuth2: + - payroll.settings + - payroll.settings.read + tags: + - PayrollAu + operationId: getEarningsRate + x-hasPayrollAuProblem: true + servers: + - url: https://api.xero.com/payroll.xro/2.0 + summary: Allows you to retrieve details of an earnings rate in a Xero organisation by using a unique earnings rate id + parameters: + - in: path + name: EarningsRateID + x-snake: earnings_rate_id + required: true + description: Identifier for the earnings rate + schema: + type: string + format: uuid + responses: + "200": + description: search results matching criteria + content: + application/json: + schema: + $ref: '#/components/schemas/EarningsRates' + example: + id: 00000000-0000-0000-0000-000000000000 + providerName: provider-name + dateTimeUTC: 2020-08-28T18:25:57.8191994 + httpStatusCode: OK + pagination: null + problem: null + earningsRate: + earningsRateID: e061a3ee-2f13-4cdb-adb2-f8e50128759b + name: Ordinary Hours + earningsType: OrdinaryTimeEarnings + rateType: RatePerUnit + typeOfUnits: Hours + currentRecord: true + expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 + fixedAmount: null + ratePerUnit: null + multipleOfOrdinaryEarningsRate: null + isSubjectToTax: true + isSubjectToSuper: true + isReportableAsW1: false + accrueLeave: false + employmentTerminationPaymentType: null + allowanceType: null + allowanceCategory: null + allowanceContributesToAnnualLeaveRate: false + allowanceContributesToOvertimeRate: false +components: + securitySchemes: + OAuth2: + type: oauth2 + description: For more information visit https://developer.xero.com/documentation/oauth2/overview + flows: + authorizationCode: + authorizationUrl: https://login.xero.com/identity/connect/authorize + tokenUrl: https://identity.xero.com/connect/token + scopes: + email: Grant read-only access to your email + openid: Grant read-only access to your open id + profile: your profile information + payroll.employees: Grant read-write access to payroll employees + payroll.employees.read: Grant read-only access to payroll employees + payroll.payruns: Grant read-write access to payroll payruns + payroll.payruns.read: Grant read-only access to payroll payruns + payroll.payslip: Grant read-write access to payroll payslips + payroll.payslip.read: Grant read-only access to payroll payslips + payroll.settings: Grant read-write access to payroll settings + payroll.settings.read: Grant read-only access to payroll settings + payroll.timesheets: Grant read-write access to payroll timesheets + payroll.timesheets.read: Grant read-only access to payroll timesheets + parameters: + requiredHeader: + in: header + name: Xero-Tenant-Id + x-snake: xero_tenant_id + description: Xero identifier for Tenant + schema: + type: string + format: uuid + example: 4ff1e5cc-9835-40d5-bb18-09fdb118db9c + required: true + idempotencyKey: + in: header + name: Idempotency-Key + x-snake: idempotency_key + description: This allows you to safely retry requests without the risk of duplicate processing. 128 character max. + example: KEY_VALUE + schema: + type: string + schemas: + + + EarningsRates: + type: object + properties: + pagination: + $ref: '#/components/schemas/Pagination' + problem: + $ref: '#/components/schemas/Problem' + earningsRates: + type: array + items: + $ref: '#/components/schemas/EarningsRate' + Pagination: + properties: + page: + type: integer + example: 1 + pageSize: + type: integer + example: 10 + pageCount: + type: integer + example: 1 + itemCount: + type: integer + example: 2 + Problem: + description: The object returned for a bad request + type: object + properties: + type: + description: The type of error format + type: string + example: application/problem+json + title: + description: The type of the error + type: string + example: BadRequest + status: + description: The error status code + type: string + example: 400 + detail: + description: A description of the error + type: string + example: Validation error occurred. + instance: + type: string + invalidFields: + type: array + items: + $ref: '#/components/schemas/InvalidField' + InvalidField: + type: object + properties: + name: + description: The name of the field that caused the error + type: string + example: isSubjectToSuper + reason: + description: The reason the error occurred + type: string + example: The property isSubjectToSuper is required. + EarningsRate: + type: object + description: Earnings Rate for https://api.xero.com/payroll.xro/2.0 Xero Payroll AU API (v2) + properties: + EarningsRateID: + description: Xero unique identifier for an earnings rate + type: string + format: uuid + example: e0eb6747-7c17-4075-b804-989f8d4e5d39 + Name: + description: Name of the earnings rate (max length = 100) + type: string + example: PTO + maxLength: 100 + EarningsType: + description: Indicates how an employee will be paid when taking this type of earning + $ref: '#/components/schemas/EarningsType' + RateType: + description: Indicates the type of the earnings rate + $ref: '#/components/schemas/RateType' + TypeOfUnits: + description: Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT + type: string + example: Fixed + maxLength: 50 + CurrentRecord: + description: Indicates whether an earnings type is active + type: boolean + example: true + ExpenseAccountID: + description: The account that will be used for the earnings rate + type: string + format: uuid + example: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 + RatePerUnit: + description: Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. + type: string + example: 10 + MultipleOfOrdinaryEarningsRate: + description: This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLEOFORDINARYEARNINGSRATE + type: number + format: double + x-is-money: true + example: 1.5 + FixedAmount: + description: Optional Fixed Rate Amount. Applicable only if RateType is FixedAmount + type: number + format: double + x-is-money: true + example: 50.30 + IsSubjectToTax: + description: Payments of this type are subject to PAYG withholding + type: boolean + example: false + IsSubjectToSuper: + description: Payments of this type are subject to Superannuation Guarantee Contribution + type: boolean + example: false + IsReportableAsW1: + description: Whether the earnings rate is reportable or exempt from W1 + type: boolean + example: false + AccrueLeave: + description: Indicates that this earnings rate should affect accruing of leave. Only applicable if RateType is MULTIPLEOFORDINARYEARNINGSRATE + type: boolean + example: false + EmploymentTerminationPaymentType: + description: How the earnings should be treated for termination payments + $ref: '#/components/schemas/EmploymentTerminationPaymentType' + AllowanceType: + description: For allowances only, determines the type of allowance + $ref: '#/components/schemas/AllowanceType' + AllowanceCategory: + description: For allowances only, determines the category of allowance + $ref: '#/components/schemas/AllowanceCategory' + AllowanceContributesToAnnualLeaveRate: + description: For allowances using RatePerUnit only, whether it contributes towards the annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT + type: boolean + example: false + AllowanceContributesToOvertimeRate: + description: For allowances using RatePerUnit only, whether it contributes towards the overtime rate. + type: boolean + example: false + RateType: + type: string + enum: + - FIXEDAMOUNT + - MULTIPLEOFORDINARYEARNINGSRATE #Multiple of Employee’s Ordinary Earnings Rate - an earnings rate which is derived from an employee’s ordinary earnings rate + - RATEPERUNIT #An earnings rate allowing entry of a rate per unit + EarningsType: + type: string + enum: + - FIXED + - ORDINARYTIMEEARNINGS + - OVERTIMEEARNINGS + - ALLOWANCE + - LUMPSUMD + - EMPLOYMENTTERMINATIONPAYMENT + - LUMPSUMA + - LUMPSUMB + - BONUSESANDCOMMISSIONS + - LUMPSUME + - LUMPSUMW + - DIRECTORSFEES + - PAIDPARENTALLEAVE + - WORKERSCOMPENSATION + EmploymentTerminationPaymentType: + type: string + enum: + - O + - R + AllowanceType: + type: string + enum: + - CAR + - TRANSPORT + - LAUNDRY + - MEALS + - TRAVEL + - OTHER + - TOOLS + - TASKS + - QUALIFICATIONS + AllowanceCategory: + type: string + enum: + - NONDEDUCTIBLE + - UNIFORM + - PRIVATEVEHICLE + - HOMEOFFICE + - TRANSPORT + - GENERAL + - OTHER \ No newline at end of file diff --git a/xero-payroll-au.yaml b/xero-payroll-au.yaml index 8ecee9a7e..c270c7259 100644 --- a/xero-payroll-au.yaml +++ b/xero-payroll-au.yaml @@ -1,8 +1,8 @@ openapi: 3.0.0 info: version: 9.1.1 - title: Xero Payroll AU API - description: This is the Xero Payroll API for orgs in Australia region. + title: Xero Payroll AU API (v1) + description: This is the v1 Xero Payroll API for orgs in Australia region. termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/" contact: name: Xero Platform Team @@ -12,12 +12,9 @@ info: name: MIT url: https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE servers: - - description: Xero Payroll AU API (v1) + - description: Xero Payroll AU API (v1) url: https://api.xero.com/payroll.xro/1.0 - - description: Xero Payroll AU API (v2) - url: https://api.xero.com/payroll.xro/2.0 tags: - - name: PayrollAu description: Operations available to regular developers paths: @@ -505,293 +502,6 @@ paths: items: $ref: '#/components/schemas/Employee' example: '[ { "MiddleNames": "Frank" } ]' - /EarningsRates: - parameters: - - $ref: '#/components/parameters/requiredHeader' - get: - security: - - OAuth2: - - payroll.settings - - payroll.settings.read - tags: - - PayrollAu - operationId: getEarningsRates - x-hasPayrollAuProblem: true - servers: - - url: https://api.xero.com/payroll.xro/2.0 - summary: Allows you to retrieve all payroll earnings rates in a Xero organisation - parameters: - - in: query - name: page - description: Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. When page value is not a number or a negative number, by default, the first set of records is returned - example: https://api.xero.com/payroll.xro/2.0/earningsRates?page=1 - schema: - type: integer - responses: - "200": - description: search results matching criteria - content: - application/json: - schema: - $ref: '#/components/schemas/EarningsRates' - example: - id: 00000000-0000-0000-0000-000000000000 - providerName: provider-name - dateTimeUTC: 2025-08-28T18:25:57.0647738 - httpStatusCode: OK - pagination: - page: 1 - pageSize: 100 - pageCount: 1 - itemCount: 2 - problem: null - earningsRates: - - earningsRateID: e061a3ee-2f13-4cdb-adb2-f8e50128759b - name: Ordinary Hours - earningsType: OrdinaryTimeEarnings - rateType: RatePerUnit - typeOfUnits: Hours - currentRecord: true - expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 - fixedAmount: null - ratePerUnit: null - multipleOfOrdinaryEarningsRate: null - isSubjectToTax: true - isSubjectToSuper: true - isReportableAsW1: null - accrueLeave: false - employmentTerminationPaymentType: null - allowanceType: null - allowanceCategory: null - allowanceContributesToAnnualLeaveRate: null - allowanceContributesToOvertimeRate: null - - earningsRateID: 69d7bd2a-7a8c-4b86-b1e2-686484f234e6 - name: Salary - earningsType: RegularEarnings - rateType: RatePerUnit - typeOfUnits: hours - currentRecord: true - expenseAccountID: f30eb980-23b1-4e3e-b707-a15fe4be1182 - fixedAmount: null - ratePerUnit: 2500.011 - multipleOfOrdinaryEarningsRate: null - isSubjectToTax: true - isSubjectToSuper: true - isReportableAsW1: true - accrueLeave: false - employmentTerminationPaymentType: null - allowanceType: null - allowanceCategory: null - allowanceContributesToAnnualLeaveRate: null - allowanceContributesToOvertimeRate: null - - "400": - description: validation error for a bad request - content: - application/json: - schema: - description: The object returned for a bad request - type: object - properties: - type: - description: The type of error format - type: string - example: application/problem+json - title: - description: The type of the error - type: string - example: InvalidRequest - status: - description: The error status code - type: string - example: 400 - detail: - description: A description of the error - type: string - example: Requested page does not exist. - post: - security: - - OAuth2: - - payroll.settings - tags: - - PayrollAu - operationId: createEarningsRate - x-hasPayrollAuProblem: true - servers: - - url: https://api.xero.com/payroll.xro/2.0 - x-example: - - earningsRate: - key: earningsRate - keyPascal: EarningsRate - keySnake: earnings_rate - is_object: true - - name: - key: name - keyPascal: Name - keySnake: name - object: earningsRate - - earningsType: - key: earningsType - keyPascal: EarningsType - keySnake: earnings_type - php: XeroAPI\XeroPHP\Models\PayrollAu\EarningsRate\EarningsTypeEnum.RegularEarnings - node: EarningsRate.EarningsTypeEnum.REGULAREARNINGS - ruby: XeroRuby::PayrollAu::EarningsRate::EarningsTypeEnum::REGULAREARNINGS - python_string: REGULAREARNINGS - java: com.xero.models.PayrollAu.EarningsRate.EarningsTypeEnum.RegularEarnings - csharp: EarningsRate.EarningsTypeEnum.RegularEarnings - default: RegularEarnings - nonString: true - object: earningsRate - - rateType: - key: rateType - keyPascal: RateType - keySnake: rate_type - php: XeroAPI\XeroPHP\Models\PayrollAu\EarningsRate\RateTypeEnum.RatePerUnit - node: EarningsRate.RateTypeEnum.RatePerUnit - ruby: XeroRuby::PayrollAu::EarningsRate::RateTypeEnum::ACCPAYCREDIT - python_string: RATEPERUNIT - java: com.xero.models.PayrollAu.EarningsRate.RateTypeEnum.RATEPERUNIT - csharp: EarningsRate.RateTypeEnum.RatePerUnit - default: RatePerUnit - object: earningsRate - nonString: true - - expenseAccountId: - key: expenseAccountID - keyPascal: ExpenseAccountID - keySnake: expense_account_ID - is_uuid: true - default: 00000000-0000-0000-0000-000000000000 - object: earningsRate - is_last: true - - isSubjectToTax: - key: isSubjectToTax - keyPascal: isSubjectToTax - keySnake: is_subject_to_tax - object: earningsRate - nonString: true - - isSubjectToSuper: - key: isSubjectToSuper - keyPascal: isSubjectToSuper - keySnake: is_subject_to_super - object: earningsRate - nonString: true - - summary: Allows you to add an earnings rate in a Xero organisation - parameters: - - $ref: '#/components/parameters/idempotencyKey' - responses: - "200": - description: search results matching criteria - content: - application/json: - schema: - $ref: '#/components/schemas/EarningsRates' - example: - id: 00000000-0000-0000-0000-000000000000 - providerName: provider-name - dateTimeUTC: 2020-08-28T18:25:57.8141393 - httpStatusCode: OK - pagination: null - problem: null - earningsRates: - - earningsRateID: e0f7095a-8522-4d83-88ea-35d5e8953b96 - name: MyRate - earningsType: ORDINARYTIMEEARNINGS - rateType: RatePerUnit - typeOfUnits: Hours - currentRecord: true - expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 - fixedAmount: null - ratePerUnit: null - multipleOfOrdinaryEarningsRate: null - isSubjectToTax: true - isSubjectToSuper: true - isReportableAsW1: null - accrueLeave: false - employmentTerminationPaymentType: null - allowanceType: null - allowanceCategory: null - allowanceContributesToAnnualLeaveRate: null - allowanceContributesToOvertimeRate: null - "400": - description: validation error for a bad request - content: - application/json: - schema: - $ref: '#/components/schemas/Problem' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/EarningsRateV2' - example: - - name: MyRate - earningsType: OrdinaryTimeEarnings - rateType: RatePerUnit - typeOfUnits: Hours - expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 - isSubjectToTax: true - isSubjectToSuper: true - /EarningsRates/{EarningsRateID}: - parameters: - - $ref: '#/components/parameters/requiredHeader' - get: - security: - - OAuth2: - - payroll.settings - - payroll.settings.read - tags: - - PayrollAu - operationId: getEarningsRate - x-hasPayrollAuProblem: true - servers: - - url: https://api.xero.com/payroll.xro/2.0 - summary: Allows you to retrieve details of an earnings rate in a Xero organisation by using a unique earnings rate id - parameters: - - in: path - name: EarningsRateID - x-snake: earnings_rate_id - required: true - description: Identifier for the earnings rate - schema: - type: string - format: uuid - responses: - "200": - description: search results matching criteria - content: - application/json: - schema: - $ref: '#/components/schemas/EarningsRates' - example: - id: 00000000-0000-0000-0000-000000000000 - providerName: provider-name - dateTimeUTC: 2020-08-28T18:25:57.8191994 - httpStatusCode: OK - pagination: null - problem: null - earningsRate: - earningsRateID: e061a3ee-2f13-4cdb-adb2-f8e50128759b - name: Ordinary Hours - earningsType: OrdinaryTimeEarnings - rateType: RatePerUnit - typeOfUnits: Hours - currentRecord: true - expenseAccountID: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 - fixedAmount: null - ratePerUnit: null - multipleOfOrdinaryEarningsRate: null - isSubjectToTax: true - isSubjectToSuper: true - isReportableAsW1: false - accrueLeave: false - employmentTerminationPaymentType: null - allowanceType: null - allowanceCategory: null - allowanceContributesToAnnualLeaveRate: false - allowanceContributesToOvertimeRate: false /LeaveApplications: parameters: - $ref: '#/components/parameters/requiredHeader' @@ -1877,7 +1587,7 @@ paths: - EarningsRateID: 1fa4e226-b711-46ba-a8a7-4344c9c5fb87 Name: MyRate EarningsType: ORDINARYTIMEEARNINGS - RateType: MULTIPLEOFORDINARYEARNINGSRATE + RateType: MULTIPLE AccountCode: "400" Multiplier: 1.5 IsExemptFromTax: true @@ -1934,7 +1644,7 @@ paths: AllowanceContributesToOvertimeRate: false EarningsType: ORDINARYTIMEEARNINGS EarningsRateID: 1fa4e226-b711-46ba-a8a7-4344c9c5fb87 - RateType: MULTIPLEOFORDINARYEARNINGSRATE + RateType: MULTIPLE RatePerUnit: "10.0" Multiplier: 1.5 Amount: 5 @@ -3478,9 +3188,7 @@ components: x-snake: xero_tenant_id description: Xero identifier for Tenant schema: - type: string - format: uuid - example: 4ff1e5cc-9835-40d5-bb18-09fdb118db9c + type: string required: true idempotencyKey: in: header @@ -3770,7 +3478,7 @@ components: EarningsRates: type: array items: - $ref: '#/components/schemas/EarningsRateV1' + $ref: '#/components/schemas/EarningsRate' DeductionTypes: type: array items: @@ -4501,9 +4209,8 @@ components: description: Name of account type: string example: General expenses - EarningsRateV1: + EarningsRate: type: object - description: Earnings Rate for https://api.xero.com/payroll.xro/1.0 Xero Payroll AU API (v1) properties: Name: description: Name of the earnings rate (max length = 100) @@ -4552,14 +4259,14 @@ components: description: Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. type: string example: 10 - MultipleOfOrdinaryEarningsRate: - description: This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLEOFORDINARYEARNINGSRATE + Multiplier: + description: This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE type: number format: double x-is-money: true example: 1.5 AccrueLeave: - description: Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLEOFORDINARYEARNINGSRATE + description: Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE type: boolean example: false Amount: @@ -4584,151 +4291,6 @@ components: $ref: '#/components/schemas/AllowanceType' AllowanceCategory: $ref: '#/components/schemas/AllowanceCategory' - EarningsRates: - type: object - properties: - pagination: - $ref: '#/components/schemas/Pagination' - problem: - $ref: '#/components/schemas/Problem' - earningsRates: - type: array - items: - $ref: '#/components/schemas/EarningsRateV2' - Pagination: - properties: - page: - type: integer - example: 1 - pageSize: - type: integer - example: 10 - pageCount: - type: integer - example: 1 - itemCount: - type: integer - example: 2 - Problem: - description: The object returned for a bad request - type: object - properties: - type: - description: The type of error format - type: string - example: application/problem+json - title: - description: The type of the error - type: string - example: BadRequest - status: - description: The error status code - type: string - example: 400 - detail: - description: A description of the error - type: string - example: Validation error occurred. - instance: - type: string - invalidFields: - type: array - items: - $ref: '#/components/schemas/InvalidField' - InvalidField: - type: object - properties: - name: - description: The name of the field that caused the error - type: string - example: isSubjectToSuper - reason: - description: The reason the error occurred - type: string - example: The property isSubjectToSuper is required. - EarningsRateV2: - type: object - description: Earnings Rate for https://api.xero.com/payroll.xro/2.0 Xero Payroll AU API (v2) - properties: - EarningsRateID: - description: Xero unique identifier for an earnings rate - type: string - format: uuid - example: e0eb6747-7c17-4075-b804-989f8d4e5d39 - Name: - description: Name of the earnings rate (max length = 100) - type: string - example: PTO - maxLength: 100 - EarningsType: - description: Indicates how an employee will be paid when taking this type of earning - $ref: '#/components/schemas/EarningsType' - RateType: - description: Indicates the type of the earnings rate - $ref: '#/components/schemas/RateType' - TypeOfUnits: - description: Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT - type: string - example: Fixed - maxLength: 50 - CurrentRecord: - description: Indicates whether an earnings type is active - type: boolean - example: true - ExpenseAccountID: - description: The account that will be used for the earnings rate - type: string - format: uuid - example: 2c01577b-d2d7-42b6-a7a3-1a38f5c8c454 - RatePerUnit: - description: Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. - type: string - example: 10 - MultipleOfOrdinaryEarningsRate: - description: This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLEOFORDINARYEARNINGSRATE - type: number - format: double - x-is-money: true - example: 1.5 - FixedAmount: - description: Optional Fixed Rate Amount. Applicable only if RateType is FixedAmount - type: number - format: double - x-is-money: true - example: 50.30 - IsSubjectToTax: - description: Payments of this type are subject to PAYG withholding - type: boolean - example: false - IsSubjectToSuper: - description: Payments of this type are subject to Superannuation Guarantee Contribution - type: boolean - example: false - IsReportableAsW1: - description: Whether the earnings rate is reportable or exempt from W1 - type: boolean - example: false - AccrueLeave: - description: Indicates that this earnings rate should affect accruing of leave. Only applicable if RateType is MULTIPLEOFORDINARYEARNINGSRATE - type: boolean - example: false - EmploymentTerminationPaymentType: - description: How the earnings should be treated for termination payments - $ref: '#/components/schemas/EmploymentTerminationPaymentType' - AllowanceType: - description: For allowances only, determines the type of allowance - $ref: '#/components/schemas/AllowanceType' - AllowanceCategory: - description: For allowances only, determines the category of allowance - $ref: '#/components/schemas/AllowanceCategory' - AllowanceContributesToAnnualLeaveRate: - description: For allowances using RatePerUnit only, whether it contributes towards the annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT - type: boolean - example: false - AllowanceContributesToOvertimeRate: - description: For allowances using RatePerUnit only, whether it contributes towards the overtime rate. - type: boolean - example: false DeductionType: type: object properties: @@ -5043,7 +4605,7 @@ components: x-is-money: true example: 38.0000 NormalNumberOfUnits: - description: Normal number of units for EarningsLine. Applicable when RateType is "MULTIPLEOFORDINARYEARNINGSRATE" + description: Normal number of units for EarningsLine. Applicable when RateType is "MULTIPLE" type: number format: double x-is-money: true @@ -5322,7 +4884,7 @@ components: type: string enum: - FIXEDAMOUNT - - MULTIPLEOFORDINARYEARNINGSRATE #Multiple of Employee’s Ordinary Earnings Rate - an earnings rate which is derived from an employee’s ordinary earnings rate + - MULTIPLE #Multiple of Employee’s Ordinary Earnings Rate - an earnings rate which is derived from an employee’s ordinary earnings rate - RATEPERUNIT #An earnings rate allowing entry of a rate per unit EarningsType: type: string From 25d2776cf49ffacfb0427f16cc58a0a7372908fc Mon Sep 17 00:00:00 2001 From: Sue O'Beirne Date: Wed, 29 Oct 2025 13:56:37 +1100 Subject: [PATCH 6/6] LV-247 update manifest.json, readme, github workflow --- .github/workflows/create-github-pr.yml | 2 +- README.md | 1 + manifest.json | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-github-pr.yml b/.github/workflows/create-github-pr.yml index 749be16ba..200185429 100644 --- a/.github/workflows/create-github-pr.yml +++ b/.github/workflows/create-github-pr.yml @@ -59,7 +59,7 @@ jobs: - name: Update OAS version of the spec yaml files run: | - for file in xero_accounting.yaml xero_assets.yaml xero_bankfeeds.yaml xero_files.yaml xero-app-store.yaml xero-finance.yaml xero-identity.yaml xero-payroll-au.yaml xero-payroll-nz.yaml xero-payroll-uk.yaml xero-projects.yaml; do + for file in xero_accounting.yaml xero_assets.yaml xero_bankfeeds.yaml xero_files.yaml xero-app-store.yaml xero-finance.yaml xero-identity.yaml xero-payroll-au.yaml xero-payroll-au-v2.yaml xero-payroll-nz.yaml xero-payroll-uk.yaml xero-projects.yaml; do yq eval --no-colors --prettyPrint ".info.version = \"${{steps.get_latest_release_number.outputs.releaseVersion}}\"" -i "$file" echo "updated version in $file" done diff --git a/README.md b/README.md index 0da92c739..6290638f6 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ In Release (used for one or more SDKs) * [Fixed Assets](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero_assets.yaml) * [Project](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero-projects.yaml) * [Payroll AU](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero-payroll-au.yaml) +* [Payroll AU V2](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero-payroll-au-v2.yaml) * [Payroll UK](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero-payroll-uk.yaml) * [Payroll NZ](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero-payroll-nz.yaml) * [Files](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero_files.yaml) diff --git a/manifest.json b/manifest.json index d5897c8e6..b5034a216 100644 --- a/manifest.json +++ b/manifest.json @@ -27,6 +27,10 @@ "path": "/xero-payroll-au.yaml", "canPreview": true }, + "payrollAuV2": { + "path": "/xero-payroll-au-v2.yaml", + "canPreview": true + }, "payrollNz": { "path": "/xero-payroll-nz.yaml", "canPreview": true