ml-connector
XeroPaylocity

Xero and Paylocity integration

Xero handles your general ledger and accounts. Paylocity runs payroll and HR. Connecting them keeps your employee data synchronized and ensures payroll costs flow into Xero without manual entry. Each pay cycle, Paylocity generates earnings and deductions that need to post into Xero as journal entries allocated to the correct GL accounts. ml-connector watches Paylocity for payroll changes, maps employees to contacts in Xero, and writes payroll journals to your GL.

How Xero works

Xero Accounting API exposes contacts, invoices, accounts, manual journals, bank transactions, and tracking categories over REST with JSON or XML responses. Authentication uses OAuth2 Authorization Code flow with access tokens valid for 30 minutes; refresh tokens last 60 days. All API calls require the Xero-tenant-id header to target the correct organization. Xero publishes webhook events for invoice, payment, contact, and manual journal changes, though the events contain only metadata and require a follow-up GET to fetch the full record. Rate limits are 5 concurrent calls and 60 per minute per tenant.

How Paylocity works

Paylocity HCM and payroll API exposes employees, pay statements, earnings, deductions, positions, and company data via REST with JSON payloads. Authentication uses OAuth2 client credentials, with tokens lasting 3600 seconds. The API base URL is https://api.paylocity.com/api/v2 for production. Paylocity publishes webhook events for new hires, employee changes, terminations, and payroll completion, with 30-minute retries up to 24 hours on failure. Webhook payloads carry identifiers only; full record data must be fetched with follow-up calls. Client secrets must be rotated annually, and TLS 1.2 is the minimum required.

What moves between them

The main flow runs from Paylocity into Xero on a schedule tied to your pay calendar. After each payroll cycle, ml-connector reads employee records and pay statement details from Paylocity and ensures each employee exists as a contact in Xero. Payroll earnings and deductions are posted into Xero as manual journal entries, mapped to GL accounts you configure for each earning and deduction type. Employee terminations in Paylocity update the corresponding contact status in Xero. Xero's GL accounts are reference data and do not flow back to Paylocity.

How ml-connector handles it

ml-connector stores both credential sets encrypted and uses Paylocity's OAuth2 client credentials flow to obtain fresh bearer tokens before each sync, rotating credentials annually per Paylocity policy. On the Xero side, it includes the Xero-tenant-id header on every request so the API targets the correct organization. Employees are synced as contacts with their work location and job title stored in Xero's contact fields. Pay statement lines are read from Paylocity and split by earning and deduction type, then posted as manual journal line items in Xero, with debits to the earning GL account and credits to payroll liability accounts. Because Paylocity webhooks deliver only metadata, ml-connector polls the pay statement API on a fixed schedule to reliably capture completed pay cycles. Rate-limit backoff is applied when Xero returns 429. Every record carries an audit ID and can be replayed if a journal post fails.

A real-world example

A mid-sized professional services firm uses Xero to manage their general ledger and Paylocity for payroll across multiple office locations. Before the integration, the accounting team received a payroll summary email from HR after each pay run and manually entered the gross pay and tax totals into Xero as journal entries, then reconciled employee counts by hand against Xero's contact list. With Xero and Paylocity connected, each pay cycle automatically posts the payroll GL entries to Xero and updates employee records as new hires and terminations occur. The accounting team no longer re-keys payroll data, and the GL reconciles within hours of the pay run completing.

What you can do

  • Sync employees from Paylocity to Xero as contacts with job titles and locations.
  • Post payroll GL entries from Paylocity into Xero's general ledger after each pay cycle, split by earning and deduction type.
  • Map Paylocity earnings and deductions to your configured Xero GL accounts so payroll costs land on the correct lines.
  • Handle Paylocity's OAuth2 credentials with annual secret rotation and Xero's multi-tenant header requirements.
  • Poll Paylocity on a schedule tied to your payroll calendar with a full audit trail on every journal entry.

Questions

Which direction does data move between Xero and Paylocity?
The main flow is Paylocity into Xero. Employees, pay statements, and payroll GL entries move from Paylocity into Xero, while GL accounts and tracking categories are treated as reference data in Xero. Xero does not send employee or payroll data back to Paylocity.
How does the integration handle Paylocity's webhook and polling limitations?
Paylocity webhooks deliver only metadata and identifiers, not full payroll data. ml-connector polls the Paylocity pay statement API on a schedule tied to your payroll calendar to reliably capture complete pay cycles. This ensures every earnings line and deduction is posted into Xero even if a webhook event is missed.
What accounting setup is required in Xero before syncing payroll?
You must configure GL account mappings for each earnings and deduction type you use in Paylocity. For example, gross salary might map to a Salary GL account (debit) and net pay to a bank clearing account (credit). ml-connector uses these mappings to allocate payroll costs to the correct GL accounts when posting journal entries.

Related integrations

Connect Xero and Paylocity

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started