ml-connector
Sage 300Paylocity

Sage 300 and Paylocity integration

Sage 300 manages your accounting and inventory. Paylocity handles payroll and HR. Connecting the two keeps your labor costs aligned with your general ledger. Each payroll period, Paylocity's gross pay, deductions, and taxes flow into Sage 300 as journal entries posted to the GL accounts and cost centers you configure. Employee records move from Paylocity into Sage 300 so your headcount and labor cost tracking match reality.

How Sage 300 works

Sage 300 is an on-premise ERP deployed on Windows IIS with a SQL Server backend. It exposes Accounts Payable, Accounts Receivable, General Ledger, Purchase Orders, Order Entry, and Inventory through REST APIs serving JSON and XML. The API base URL includes the company code and module name per customer instance. Authentication uses HTTP Basic Auth with an uppercase username and password sent with every request. An API user must be created in Administrative Services and assigned the Web API security group. There are no webhooks or change-data-capture; all reads are pull-based through OData filtering and pagination by date and time.

How Paylocity works

Paylocity is a cloud HCM and payroll platform accessed through REST APIs at api.paylocity.com. It authenticates with OAuth 2.0 client credentials, returning a bearer token valid for 3600 seconds. Paylocity exposes Employee records, PayStatement details, Earnings, Deductions, Company and WorkLocation references, and Position codes. The platform supports both webhook push and pull-based polling. Webhook events include New Hire, Employee Change, Termination, and Payroll Processed, delivered as HTTPS POST with retries up to 24 hours. Event payloads carry identifiers only; full record data must be fetched via separate API calls.

What moves between them

The primary flow is from Paylocity into Sage 300. After each payroll period, ml-connector reads Paylocity's Employee records, Earnings, and Deductions, then constructs GL journal entries that post into Sage 300's GLJournalBatches. Each entry is allocated to a GL account and cost center according to the mapping you configure. Employee changes from Paylocity are tracked so Sage 300's headcount and department assignments reflect payroll updates. GL postings are unidirectional: Paylocity has no GL account structure, so data does not flow back to Paylocity.

How ml-connector handles it

ml-connector stores both credential sets encrypted: the Sage 300 API username and password (converted to uppercase as required by Sage 300's API), and the Paylocity client ID and client secret used for OAuth2 token exchange. It requests a new Paylocity bearer token before making each API call, caching the token for its 3600-second lifetime, and refreshing if a call returns 401. On the Sage 300 side, it constructs POST requests to GLJournalBatches with the correct IIS server URL per customer instance, including the company code and GL module path. Earnings and deduction amounts from Paylocity are mapped to Sage 300 GL account segments; if Paylocity fires an Employee Change webhook, ml-connector receives it and fetches the full employee record to update the Sage 300 employee reference. Because Sage 300 has no webhooks, ml-connector also polls Paylocity at regular intervals to catch any changes missed between webhook deliveries. Every record carries a full audit trail so failed GL postings can be replayed once the underlying issue is corrected.

A real-world example

A mid-sized professional services firm runs Sage 300 on its own IIS server for accounting and cost center tracking. They use Paylocity to manage payroll for 200 employees across three offices. Before the integration, the payroll team exported Paylocity reports every two weeks, calculated labor cost totals for each office and project code, and hand-entered them into Sage 300 journal batches. Month-end close was delayed while the accounting team reconciled the manually entered labor costs against Paylocity records and chased keying errors. With Sage 300 and Paylocity connected, each payroll period's GL entries post automatically, allocated to the correct cost center and GL account per office, and the month-end labor reconciliation is complete before the ledger close begins.

What you can do

  • Read Paylocity employee records and post labor cost GL journal entries into Sage 300 after each payroll period.
  • Allocate Payroll earnings and deductions to Sage 300 GL accounts and cost center segments per your configuration.
  • Authenticate Sage 300 with HTTP Basic Auth (credentials in uppercase) and Paylocity with OAuth2 bearer tokens, refreshing tokens on 401 responses.
  • Receive Paylocity webhook events for new hires and employee changes, and poll Paylocity on a cadence to catch events between webhook deliveries.
  • Maintain a full audit trail on every record and support replay of GL postings when corrections are needed.

Questions

How does ml-connector handle Sage 300's requirement for uppercase usernames and Basic Auth?
ml-connector stores the Sage 300 API username and password encrypted. Before building the Authorization header, it converts both to uppercase as Sage 300's API requires, then Base64-encodes them and includes the header on every request. Paylocity uses OAuth2 instead, so the credential types are independent.
What happens if a Paylocity webhook is delayed or dropped?
Paylocity webhook events carry employee identifiers only; ml-connector must fetch the full employee record via API to use it. Because Sage 300 has no webhook capability, ml-connector also polls Paylocity on a regular schedule. If a webhook is delayed or dropped, the scheduled poll will fetch the record before the next payroll period, so no changes are lost.
Can GL entries flow back from Sage 300 into Paylocity?
No. Paylocity has no GL account or cost center structure, so there is nothing to write back to. The integration is unidirectional: payroll data from Paylocity flows into Sage 300 as GL transactions, but accounting entries in Sage 300 remain read-only from Paylocity's perspective.

Related integrations

Connect Sage 300 and Paylocity

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

Get started