SAP S/4HANA and Paylocity integration
SAP S/4HANA runs your enterprise resource planning and general ledger. Paylocity runs your payroll and human capital management. When employee data and payroll results flow from Paylocity into SAP S/4HANA, your headcount stays current, your labor cost allocations land on the right cost centers, and your general ledger reflects the true cost of labor after each payroll cycle. ml-connector handles the different authentication models and APIs on each side and moves the data on a schedule tied to your payroll calendar.
What moves between them
The main flow runs from Paylocity into SAP S/4HANA. Employee records including name, hire date, termination date, and work location flow from Paylocity into SAP S/4HANA as business partners and cost assignments. After each payroll cycle, ml-connector reads payroll earnings and deductions from Paylocity, maps them to SAP cost centers and GL accounts, and writes journal entry lines into SAP S/4HANA to post labor cost distributions. Employee changes such as terminations and rehires flow the same direction so SAP headcount reflects current staffing. The sync runs on a schedule tied to your payroll calendar, typically triggered by the Payroll Processed webhook from Paylocity or via polling if webhooks are not enabled. Cost center alignment happens first, so every journal entry line references a valid SAP cost center and GL account.
How ml-connector handles it
ml-connector stores both OAuth credential sets encrypted and refreshes the bearer tokens for each system before they expire. On the SAP side, it accepts the tenant-specific OData base URL per customer instance, which is copied from the Communication Arrangement settings; it does not construct the URL manually because token endpoints and API paths vary by tenant. SAP Cloud Public deployments do not require the sap-client parameter, whereas On-Premise instances do. Since SAP exposes no webhooks, ml-connector polls for GL account and cost center changes on a payroll-driven schedule and uses LastChangeDateTime filters to fetch only records changed since the last successful sync. When a GL account or cost center is not found in SAP, the posting is queued for retry after confirmation that the dimension has been created. Paylocity webhook events (Payroll Processed, Employee Change, New Hire, Termination) are received via a registered HTTPS endpoint and trigger immediate reconciliation; if a webhook delivery fails, Paylocity retries for up to 24 hours. ml-connector backs off and retries on rate limits or transient network failures, and it tracks audit metadata (source ID, timestamp, authenticated user) on every record so failed postings can be inspected and replayed.
A real-world example
A multi-location services company with 500 employees runs SAP S/4HANA for procurement and financial accounting across five regional operations, and uses Paylocity Workforce Now for payroll, HR, and benefits administration. Before the integration, payroll specialists exported earnings and deductions from Paylocity each pay period, manually allocated labor costs to the correct operations and job cost codes in SAP, and then posted journal entries for GL review. This manual process took one full business day after payroll close and was error-prone when allocations changed. With SAP S/4HANA and Paylocity connected, each payroll run automatically posts labor cost journal entries into SAP, allocated to the correct regional cost centers, and new hires and terminations update employee records in SAP in real time. The accounting team now verifies GL balances within hours of payroll close instead of days, and allocation errors have dropped by over 90 percent.
What you can do
- Sync Paylocity employee records, hire dates, and terminations into SAP S/4HANA as business partners and cost assignments.
- Post payroll earnings and deductions from Paylocity into SAP S/4HANA general ledger journal entries, allocated to the correct cost centers.
- Receive and process Paylocity webhook events for New Hire, Termination, Employee Change, and Payroll Processed triggers.
- Authenticate both systems with OAuth 2.0 and manage token refresh for both SAP and Paylocity, respecting each token's expiry.
- Poll SAP on a payroll-cycle schedule with LastChangeDateTime filters, maintain a full audit trail, and replay failed postings on demand.
Questions
- Does ml-connector receive Paylocity webhook events or does it poll for changes?
- ml-connector supports both modes. It can receive Paylocity webhooks for New Hire, Termination, Employee Change, and Payroll Processed events if webhooks are enabled in your Paylocity account. It also polls SAP S/4HANA on a configurable schedule tied to your payroll calendar since SAP has no native webhooks. If a webhook delivery fails, Paylocity retries for up to 24 hours, and ml-connector reconciles with polling as a fallback.
- How does the integration handle SAP S/4HANA's tenant-specific OAuth configuration?
- Each SAP S/4HANA customer has a different tenant domain and token endpoint. ml-connector accepts the base OData URL and Communication Arrangement details per customer instance; an SAP administrator provides these during setup from the Communication Arrangement configuration. ml-connector does not construct URLs or token endpoints manually because they vary by deployment mode (Cloud Public, Cloud Private, On-Premise). Tokens are cached and refreshed before expiry to avoid authentication failures mid-sync.
- What happens if a cost center or GL account referenced in a payroll entry does not exist in SAP S/4HANA?
- ml-connector queues the journal entry for retry and logs the missing dimension in the audit trail. The posting does not fail the entire sync; instead it waits for confirmation that the cost center or GL account has been created in SAP by your finance team. When the dimension is added, ml-connector automatically retries the posting on the next scheduled cycle or on demand via the audit replay feature.
Related integrations
More SAP S/4HANA integrations
Other systems that connect to Paylocity
Connect SAP S/4HANA and Paylocity
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started