How we built an HR & payroll SaaS platform serving 85+ companies and 12K employees — with multi-state tax rules, benefits integration, compliance automation, and self-service portals achieving 99.9% payroll accuracy.
HR & Payroll SaaS · Tax & Compliance
A PEO (Professional Employer Organization) serving mid-market companies was struggling with legacy payroll software that couldn't keep up with multi-state expansion. Their clients employed workers across 40+ states, each with different withholding rules, sick leave mandates, and reporting requirements. Payroll runs took hours of manual verification, and one state tax rule change could break an entire pay cycle.
They needed a modern HR & payroll platform that could handle multi-state tax calculations automatically, integrate with benefits providers (ADP, QuickBooks) and compliance systems (DocuSign for I-9, W-4), provide employees with a self-service portal for pay stubs and tax documents, and maintain a full audit trail for SOC 2 and payroll compliance. The goal was to reduce payroll processing time by 70% while improving accuracy to 99.9%+.
Each state has different withholding rates, local tax jurisdictions, and special rules (e.g., reciprocity agreements). Manual updates were error-prone — a single wrong rate could affect hundreds of employees. Rules changed quarterly.
Health insurance, 401(k), and other benefits were administered by external providers. Payroll deductions had to sync with ADP, QuickBooks, and carrier feeds. Mismatches caused over/under deductions and employee confusion.
SOC 2 and payroll compliance required immutable audit logs. Who changed an employee's salary? When was a pay run approved? Legacy systems had gaps that auditors flagged. Document retention for 7+ years was manual.
Employees called HR for pay stubs, W-2s, and tax form updates. HR spent 40% of their time on repetitive requests. There was no way for employees to update W-4 or banking info themselves.
We built a multi-tenant SaaS platform with a Next.js admin for HR and finance teams, an employee self-service portal, and a Node.js backend that orchestrates payroll runs, tax calculations, and third-party integrations. Tax rules live in a versioned, state-specific config that we update as regulations change. ADP and QuickBooks integrations sync deductions and ledger entries. DocuSign handles I-9 and W-4 e-signatures. Every mutation is logged with user, timestamp, and before/after state for audit compliance.
The tax engine was the most delicate piece. We built a rule engine that evaluates employee work location, residence state, reciprocity agreements, and local jurisdiction codes. Rules are stored as JSON configs with effective dates — when a state updates rates, we add a new version and the engine picks the correct one for each pay period. We run regression tests against known pay scenarios before every release.
Audited payroll workflows and pain points. Mapped multi-state tax rules and built initial rule config schema. Defined integration requirements for ADP, QuickBooks, and DocuSign. Designed audit log and compliance model.
Built Next.js admin and employee portal. Implemented Node.js payroll engine with tax calculator. Integrated ADP and QuickBooks for deductions and ledger. Added DocuSign for I-9 and W-4. Deployed multi-tenant PostgreSQL with audit tables.
Populated tax rules for 40+ states. Built rule versioning and regression test suite. Implemented document storage and 7-year retention. Completed SOC 2 readiness checklist.
Piloted with 10 companies and 800 employees. Validated 99.9% payroll accuracy. Phased migration of remaining 75+ companies. Trained HR teams and documented runbooks for tax rule updates.
Payroll is unforgiving. A single miscalculation can affect an employee's taxes, benefits, and trust. The tax engine had to be deterministic, versioned, and testable. We built a regression suite with hundreds of scenarios — employee in State A, works in State B, reciprocity applies — and run it before every deploy. That discipline caught several edge cases before they reached production.
Integrations with ADP, QuickBooks, and DocuSign were critical. Each has different webhook semantics and error handling. We built idempotent sync logic and reconciliation jobs that compare our records with provider data. Mismatches trigger alerts — we'd rather flag a discrepancy than silently propagate an error.
The audit trail was non-negotiable for compliance. Every change to an employee record, tax config, or pay run is logged with user ID, timestamp, and before/after JSON. That gave auditors a complete picture and the client confidence to pass SOC 2. Document retention for 7 years was implemented with lifecycle policies and encrypted storage.
We help HR Tech and FinTech companies build compliant payroll, benefits integration, and self-service portals. Let's talk about your architecture.