ml-connector
SAP Business OnePaylocity

SAP Business One and Paylocity integration

SAP Business One runs accounting, purchasing, and inventory for small-to-midsize businesses. Paylocity runs payroll and HR in the cloud. Connecting them keeps your payroll records and your general ledger synchronized. Payroll GL postings from Paylocity flow into SAP Business One's journals, allocated to the correct cost centers and dimensions, without manual re-entry. ml-connector handles the very different APIs on each side and moves the data on a schedule you control.

How SAP Business One works

SAP Business One is an on-premise ERP platform that exposes its data through OData v4 REST endpoints at the customer's Service Layer instance. The platform authenticates with a session token obtained via POST /Login that returns a B1SESSION cookie and expires after 30 minutes of inactivity. Key entities include Chart of Accounts, Dimensions, Profit Centers, Invoices, Purchase Orders, and Journal Entries. SAP Business One supports both webhooks (v10.0 FP 2602 and later with Webhook Messenger Service enabled) and polling for data sync. Webhooks require server-side configuration, so polling with UpdateDate filters is the standard approach. Each customer provides their own Service Layer base URL; there is no shared global endpoint.

How Paylocity works

Paylocity is a cloud payroll and HCM platform that exposes employee records, payroll data, deductions, and earnings through REST API endpoints at https://api.paylocity.com/api/v2 for production and https://dc1demogwext.paylocity.com for sandbox. The platform authenticates with OAuth 2.0 client credentials, returning a bearer token with a 3600-second lifetime. Key entities include Employee, PayStatement, Deduction, Earning, Company, WorkLocation, and Position. Paylocity supports both webhooks and polling. Webhook events include New Hire, Employee Change, Termination, and Payroll Processed, delivered as HTTPS POST JSON with 30-minute retries for up to 24 hours on failure. Webhook payloads carry identifiers only, so full record data must be fetched via API calls.

What moves between them

The main flow runs from Paylocity into SAP Business One. After each payroll run, ml-connector reads Paylocity earnings and deduction records, maps them to the matching SAP Business One cost centers and profit centers, and creates Journal Entries in the general ledger. Employee records flow the same direction so SAP Business One headcount reflects Paylocity hires and terminations. Cost centers, dimensions, and profit centers are validated against SAP Business One before any payroll posting so all allocations land on valid accounts. GL postings are created as read-only records in Business One, so ml-connector never writes financial entries back into Paylocity.

How ml-connector handles it

ml-connector accepts each customer's SAP Business One Service Layer URL and maintains the 30-minute session token by re-authenticating before expiry, avoiding the 5-second cold-start penalty of a fresh login on every request. On the Paylocity side, ml-connector refreshes the OAuth bearer token when a call returns 401 (token expired) and handles the 3600-second lifetime by scheduling a pre-expiry refresh. Paylocity webhook events fire multiple times per minute and carry identifiers only, so ml-connector fetches the full record via API after receiving a webhook event. Because Paylocity does not expose vendor or purchase order data, all cost allocations are derived from Paylocity employee master records (cost center, position, work location) matched against SAP Business One's Dimensions and Profit Centers. SAP Business One on-premise instances often use self-signed TLS certificates, so certificate verification is configurable per customer. Paylocity rate limits are applied per gateway node, so ml-connector backs off and retries on HTTP 429. Every record carries a full audit trail and can be replayed if a downstream GL posting fails.

A real-world example

A mid-market staffing services company operates SAP Business One on-premise for accounting, procurement, and job costing, and uses Paylocity for payroll across 15 branch offices. Before integration, the accounting team exported payroll registers from Paylocity every week, manually allocated costs to the correct job codes and branch dimensions in SAP Business One, and re-entered labor totals into the GL by hand. The finance team spent 8 hours each week on cost allocation reconciliation and often missed records or allocated them to the wrong cost center. With SAP Business One and Paylocity connected, each payroll run flows into Business One automatically with costs pre-allocated to the correct branch and job code dimensions. The manual cost allocation step is eliminated, and reconciliation happens in minutes instead of days.

What you can do

  • Create Journal Entries in SAP Business One's general ledger from Paylocity earnings and deductions after each payroll run.
  • Allocate Paylocity payroll costs to SAP Business One cost centers, dimensions, and profit centers automatically based on employee master records.
  • Keep SAP Business One employee records aligned with Paylocity hires, terminations, and position changes.
  • Maintain both SAP Business One's 30-minute session token and Paylocity's 3600-second OAuth bearer token without manual re-authentication.
  • Poll on a schedule tied to your payroll calendar, with retries on TLS/network failures and a full audit trail on every record.

Questions

Which direction does data move between SAP Business One and Paylocity?
The main flow is Paylocity into SAP Business One. Payroll earnings, deductions, and employee records move from Paylocity into SAP Business One, where they are posted as Journal Entries and allocated to the correct cost centers and dimensions. Employee master data from Paylocity (cost center, position, work location) drives the allocation logic. SAP Business One does not push financial data back to Paylocity.
How does ml-connector handle SAP Business One's 30-minute session token timeout?
ml-connector tracks the session token lifetime and re-authenticates before the 30-minute inactivity timeout expires, avoiding the 5-second cold-start penalty of a fresh POST /Login on every request. The new token is cached and reused until the next scheduled refresh.
What happens when Paylocity webhook events carry only identifiers and not full record data?
ml-connector receives the webhook event notification and then fetches the full employee, earnings, or deduction record from the Paylocity API using the identifier in the event payload. This ensures the GL posting in SAP Business One reflects the current state of the payroll record, not stale cached data.

Related integrations

Connect SAP Business One and Paylocity

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

Get started