ml-connector
Microsoft Dynamics NAVGusto

Microsoft Dynamics NAV and Gusto integration

Microsoft Dynamics NAV is your ERP for finance and operations. Gusto is your HR and payroll engine. Connecting them keeps your general ledger accurate and your employee roster in sync. Each payroll run posts labor costs to NAV's accounts without re-keying, and employee changes in Gusto update your NAV workforce file so headcount and accounting records agree. ml-connector handles the OAuth token lifecycle on both sides, maps earning types and deductions to journal line codes, and delivers a full audit trail.

How Microsoft Dynamics NAV works

Microsoft Dynamics NAV exposes employees, general ledger entries, dimensions, accounts, journals, purchase invoices, sales invoices, and purchase orders through OData v4 REST APIs at a tenant-specific base URL or an on-premises server instance. Authentication uses OAuth 2.0 client credentials via Microsoft Entra ID for Business Central online, or basic auth with a web service access key for legacy setups. NAV can accept webhook notifications on employees, general ledger entries, and dimensions with a 3-day subscription window that must be renewed before expiry, or accept polling. GL accounts and entries are read-only through the standard API once posted.

How Gusto works

Gusto exposes employees, payrolls, earning types, compensations, contractor payments, and benefits through REST APIs at https://api.gusto.com with OAuth 2.0 Authorization Code flow; each access token expires in 2 hours and the refresh token is single-use and rotates on refresh. Gusto scopes are assigned during partner review, not self-selected in production. Gusto supports webhooks for payroll events (calculated, processed, paid, reversed) and employee events (created, updated, terminated), verified via HMAC-SHA256. Dollar amounts are returned as string decimals, and each OAuth token is scoped to a single company.

What moves between them

The primary flow is from Gusto into NAV. After each payroll run, Gusto fires a webhook on the processed or paid event; ml-connector reads the payroll, maps earning types and deductions to NAV dimension codes, and posts the labor cost journal into NAV's general ledger against the correct cost centers. Employee changes in Gusto (hires, terminations, rehires) flow into NAV's employee list simultaneously, so NAV headcount always reflects the current Gusto roster. Dimensions such as cost centers and departments are mapped in both directions so payroll journals reference valid NAV dimensions. All postings are read-only once in the ledger, so ml-connector never attempts to reverse or modify payroll entries already posted.

How ml-connector handles it

ml-connector stores both credential sets encrypted and refreshes the Gusto OAuth token 15 minutes before its 2-hour expiry to avoid outages. On the NAV side, it uses the tenant-specific base URL or on-premises instance URL provided per customer. For online NAV, it subscribes to employee and general ledger entry webhooks (with renewal 1 day before the 3-day expiry); for on-premises NAV, it polls at intervals tied to your payroll calendar. When a Gusto payroll webhook fires with a processed or paid event, ml-connector fetches the payroll details, maps each earning type and deduction to a NAV journal line using a configurable dimension mapping, validates that each dimension (cost center, department) exists in NAV before posting, and writes the labor cost journal to NAV. If NAV returns a 401 or 403 on an OAuth call, ml-connector re-authenticates before retrying. For employee syncs, it creates new employees in NAV when Gusto adds them, updates the employee status when Gusto marks a termination, and rehires when the employee is re-added in Gusto. Each record carries the Gusto payroll ID and employee ID to prevent duplicate postings. Rate limits on either side are handled with exponential backoff and jitter.

A real-world example

A professional services firm with 40 employees runs Gusto for payroll and benefits, and NAV for project accounting and GL. Before the integration, the finance team exported payroll registers from Gusto twice per month, manually matched earning types to NAV cost centers and project codes, and entered 80+ journal lines by hand into NAV, introducing data-entry errors that caused month-end reconciliations to run over schedule. With Gusto and NAV connected, each payroll run posts the labor costs automatically into NAV with the correct project and cost center codes, and the finance team validates the totals rather than re-keying numbers. Employee changes sync immediately, so the headcount in NAV always matches Gusto.

What you can do

  • Post Gusto payroll GL documents into Microsoft Dynamics NAV after each pay run, allocated to the correct cost centers and dimensions.
  • Keep NAV employee records synchronized with Gusto hires, terminations, and rehires.
  • Map Gusto earning types and deductions to NAV journal line codes and dimensions.
  • Authenticate with Gusto OAuth 2.0 (with token refresh before expiry) and NAV OAuth 2.0 or basic auth.
  • Receive Gusto payroll webhooks (processed, paid, calculated events) and poll NAV on schedule with full audit trail and error replay.

Questions

Does the integration support on-premises NAV as well as NAV online?
Yes. ml-connector accepts either the cloud OData base URL for Business Central online or the on-premises server instance URL with port and API path. On-premises setups must have the OData service enabled in NAV Server Administration and the API port (default 7048) open through the firewall. Authentication uses OAuth 2.0 for online and either OAuth 2.0 or basic auth with a web service access key for on-premises.
What happens if a Gusto payroll references a cost center that does not exist in NAV?
ml-connector validates every cost center and dimension against NAV before posting the journal. If a dimension does not exist, the sync fails with an error, the record is marked for replay, and an alert is sent. The posting does not proceed until the missing dimension is created in NAV and the sync is re-run.
How are Gusto's OAuth token expiry and NAV's webhook subscription renewal handled?
ml-connector refreshes the Gusto OAuth token 15 minutes before its 2-hour expiry to prevent authentication failures. For NAV online, it renews webhook subscriptions 1 day before the 3-day expiry window closes. On-premises NAV uses polling on a schedule you define, tied to your payroll calendar.

Related integrations

Connect Microsoft Dynamics NAV and Gusto

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

Get started