Skip to content

Xero: Creates a pay item

Xero payrollAu.createPayItem: arguments, response, policy and SDK examples.

← Payroll au operations · Get started

Operation xero.payroll_au_createpayitem

Provider route: POST /payroll.xro/1.0/PayItems. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/xero with npm, or alter-sdk-xero with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { XeroIntegration } from "@alter-ai/xero";
async function execute(input: Parameters<XeroIntegration["payrollAu"]["createPayItem"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new XeroIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.payrollAu.createPayItem(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_xero import XeroIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = XeroIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.payroll_au.create_pay_item(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
headersobjectRequired within parentAdditional keys: not allowed
headers.xero-tenant-idstringRequired within parent
headers.Idempotency-KeystringOptional
bodyModelRequired within parentExpand Creates a pay item — request body — body

Referenced models: Creates a pay item — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Creates a pay item — response body

Referenced models: Creates a pay item — response body

3 more schemas are linked from the tables above, on the schema pages.

Creates a pay item — response body
FieldTypePresenceDescription and constraints
$objectRoot
PayItemsModelOptionalExpand Creates a pay item — response body — Pay Items

Referenced models: Creates a pay item — response body — Pay Items

Creates a pay item — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
DeductionTypesarrayOptional
DeductionTypes[]ModelEach itemExpand Creates a pay item — request body — body Deduction Types item
EarningsRatesarrayOptional
EarningsRates[]ModelEach itemExpand Creates a pay item — request body — body Earnings Rates item
LeaveTypesarrayOptional
LeaveTypes[]ModelEach itemExpand Creates a pay item — request body — body Leave Types item
ReimbursementTypesarrayOptional
ReimbursementTypes[]ModelEach itemExpand Creates a pay item — request body — body Reimbursement Types item

Referenced models: Creates a pay item — request body — body Deduction Types item, Creates a pay item — request body — body Earnings Rates item, Creates a pay item — request body — body Leave Types item, Creates a pay item — request body — body Reimbursement Types item

Creates a pay item — response body — Pay Items
FieldTypePresenceDescription and constraints
$objectRoot
DeductionTypesarrayOptional
DeductionTypes[]ModelEach itemExpand Creates a pay item — response body — Pay Items Deduction Types item
EarningsRatesarrayOptional
EarningsRates[]ModelEach itemExpand Creates a pay item — response body — Pay Items Earnings Rates item
LeaveTypesarrayOptional
LeaveTypes[]ModelEach itemExpand Creates a pay item — response body — Pay Items Leave Types item
ReimbursementTypesarrayOptional
ReimbursementTypes[]ModelEach itemExpand Creates a pay item — request body — body Reimbursement Types item

Referenced models: Creates a pay item — response body — Pay Items Deduction Types item, Creates a pay item — response body — Pay Items Earnings Rates item, Creates a pay item — response body — Pay Items Leave Types item, Creates a pay item — request body — body Reimbursement Types item

Creates a pay item — request body — body Deduction Types item
FieldTypePresenceDescription and constraints
$objectRoot
AccountCodestringOptionalSee Accounts
CurrentRecordbooleanOptionalIs the current record
DeductionCategorystringOptionalOne of: NONE, UNIONFEES, WORKPLACEGIVING
DeductionTypeIDstringOptionalXero identifier
Format: uuid
IsExemptFromW1booleanOptionalBoolean to determine if the deduction type is reportable or exempt from W1
NamestringOptionalName of the earnings rate (max length = 100)
Maximum length: 100
ReducesSuperbooleanOptionalMost deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this.
ReducesTaxbooleanOptionalIndicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee.
UpdatedDateUTCstringOptionalLast modified timestamp
Read only: true
Creates a pay item — request body — body Earnings Rates item
FieldTypePresenceDescription and constraints
$objectRoot
AccountCodestringOptionalSee Accounts
AccrueLeavebooleanOptionalIndicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE
AllowanceCategorystringOptionalOne of: NONDEDUCTIBLE, UNIFORM, PRIVATEVEHICLE, HOMEOFFICE, TRANSPORT, GENERAL, OTHER
AllowanceContributesToAnnualLeaveRatebooleanOptionalBoolean to determine if the allowance earnings rate contributes towards annual leave rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT
AllowanceContributesToOvertimeRatebooleanOptionalBoolean to determine if the allowance earnings rate contributes towards overtime allowance rate. Only applicable if EarningsType is ALLOWANCE and RateType is RATEPERUNIT
AllowanceTypestringOptionalOne of: CAR, TRANSPORT, LAUNDRY, MEALS, TRAVEL, OTHER, TOOLS, TASKS, QUALIFICATIONS
AmountnumberOptionalOptional Amount for FIXEDAMOUNT RateType EarningsRate
Format: double
CurrentRecordbooleanOptionalIs the current record
EarningsRateIDstringOptionalXero identifier
Format: uuid
EarningsTypestringOptionalOne of: FIXED, ORDINARYTIMEEARNINGS, OVERTIMEEARNINGS, ALLOWANCE, LUMPSUMD, EMPLOYMENTTERMINATIONPAYMENT, LUMPSUMA, LUMPSUMB, BONUSESANDCOMMISSIONS, LUMPSUME, LUMPSUMW, DIRECTORSFEES, PAIDPARENTALLEAVE, WORKERSCOMPENSATION
EmploymentTerminationPaymentTypestringOptionalOne of: O, R
IsExemptFromSuperbooleanOptionalSee the ATO website for details of which payments are exempt from SGC
IsExemptFromTaxbooleanOptionalMost payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding
IsQualifyingEarningsbooleanRequired within parentBoolean to determine if the earnings rate is considered as qualifying earnings for superannuation guarantee calculations
IsReportableAsW1booleanOptionalBoolean to determine if the earnings rate is reportable or exempt from W1
MultipliernumberOptionalThis 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
Format: double
NamestringOptionalName of the earnings rate (max length = 100)
Maximum length: 100
RatePerUnitstringOptionalDefault rate per unit (optional). Only applicable if RateType is RATEPERUNIT.
RateTypestringOptionalOne of: FIXEDAMOUNT, MULTIPLE, RATEPERUNIT
TypeOfUnitsstringOptionalType of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT
Maximum length: 50
UpdatedDateUTCstringOptionalLast modified timestamp
Read only: true
Creates a pay item — request body — body Leave Types item
FieldTypePresenceDescription and constraints
$objectRoot
CurrentRecordbooleanOptionalIs the current record
IsPaidLeavebooleanOptionalSet this to indicate that an employee will be paid when taking this type of leave
IsQualifyingEarningsbooleanRequired within parentBoolean to determine if the leave type is considered as qualifying earnings for superannuation guarantee calculations
LeaveCategoryCodestringOptionalCode used to identify the Leave Category
One of: ANNUALLEAVE, LONGSERVICELEAVE, PERSONALSICKCARERSLEAVE, ROSTEREDDAYOFF, TIMEOFFINLIEU, COMPASSIONATEANDBEREAVEMENTLEAVE, STUDYLEAVE, FAMILYANDDOMESTICVIOLENCELEAVE, SPECIALPAIDLEAVE, COMMUNITYSERVICELEAVE, JURYDUTYLEAVE, DEFENCERESERVELEAVE
LeaveLoadingRatenumberOptionalEnter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%)
Format: double
LeaveTypeIDstringOptionalXero identifier
Format: uuid
NamestringOptionalName of the earnings rate (max length = 100)
Maximum length: 100
NormalEntitlementnumberOptionalThe number of units the employee is entitled to each year
Format: double
SGCExemptbooleanOptionalSet this to indicate that the leave type is exempt from superannuation guarantee contribution
ShowOnPayslipbooleanOptionalSet this if you want a balance for this leave type to be shown on your employee’s payslips
TypeOfUnitsstringOptionalThe type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate
UpdatedDateUTCstringOptionalLast modified timestamp
Read only: true
Creates a pay item — request body — body Reimbursement Types item
FieldTypePresenceDescription and constraints
$objectRoot
AccountCodestringOptionalSee Accounts
CurrentRecordbooleanOptionalIs the current record
NamestringOptionalName of the earnings rate (max length = 100)
Maximum length: 100
ReimbursementTypeIDstringOptionalXero identifier
Format: uuid
UpdatedDateUTCstringOptionalLast modified timestamp
Read only: true

SDK function policy ID: xero.payroll_au_createpayitem. Catalog operation: payroll_au.createPayItem. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.