# HubSpot to QuickBooks Online customer sync n8n template

> A HubSpot webhook starts the sync when a company changes. The workflow updates the linked QuickBooks Online customer, or uses Claude to score fuzzy name matches before creating a new one, then stores the QuickBooks ID and a field hash back on the company so there are no duplicates or loops. You need n8n, HubSpot, QuickBooks Online, an Anthropic API key and Slack.

- Platform: n8n
- Download: https://www.lumeor.studio/templates/n8n/automate-data-sync-between-apps.json
- Trigger: Webhook, HubSpot company.propertyChange subscription
- Credentials needed: HubSpot App Token, QuickBooks Online OAuth2, Anthropic API, Slack
- Full guide: https://www.lumeor.studio/guides/automate-data-sync-between-apps/
- Last updated: 2026-10-14

## What this workflow does

1. **HubSpot company changed** (Webhook) receives HubSpot's batch of change events.
2. **Filter events (loop prevention)** (Code) keeps one item per company, ignores properties the sync writes itself and ignores fields that are not synced.
3. **HubSpot: get company** (HTTP Request) reads the current company through the CRM v3 API, including the stored QuickBooks ID and hash.
4. **Map fields and detect changes** (Code) maps HubSpot fields to QuickBooks fields, converts state names to two-letter codes and hashes the result. If the hash matches the stored one, nothing that QuickBooks cares about changed and the item stops here.
5. **Sync action** (Switch) routes to update (ID on file), match (no ID yet) or exception (no name, unmappable state).
6. **QuickBooks: find candidates** (HTTP Request) queries QuickBooks for customers with a similar display name.
7. **Build match prompt**, **Claude: score fuzzy match** and **Decide match** ask Claude, at low effort with structured outputs, whether any candidate is the same business. Only a high-confidence answer links or creates automatically. Anything uncertain, plus `refusal` and `max_tokens` responses, goes to review.
8. **Match result** (Switch) creates a new customer, links an existing one through the update path, or sends it for review.
9. **QuickBooks: update customer** and **QuickBooks: create customer** write the fields. **HubSpot: store QuickBooks ID and hash** saves the mapping, which prevents duplicates next time.
10. **Slack: sync exceptions** collects every failure and uncertain match, with candidate IDs.

## Before you import

- n8n 1.x and a public webhook URL.
- A HubSpot private app token with company read and write scopes. The same private app can hold the webhook subscription in its Webhooks tab; apps built with HubSpot projects cannot.
- A QuickBooks Online OAuth2 credential in n8n (an Intuit developer app). Start in the sandbox.
- An Anthropic API key and a Slack app with `chat:write`.

## Setup

1. Create the HubSpot company properties `qbo_customer_id`, `qbo_sync_hash` and `qbo_last_synced_at`.
2. Subscribe to `company.propertyChange` for name, domain, phone, address, city, state and zip, pointed at the webhook URL.
3. Replace `REPLACE_WITH_QBO_REALM_ID`. While testing, switch the host to `sandbox-quickbooks.api.intuit.com` and set the QuickBooks credential's environment to Sandbox.
4. Replace `REPLACE_WITH_SLACK_CHANNEL_ID` and `REPLACE_WITH_HUBSPOT_PORTAL_ID`.
5. Review `FIELD_MAP`. HubSpot owns every mapped field, so a blank value in HubSpot clears it in QuickBooks.
6. Before going live, match your existing records once so most companies already have a stored ID.

## Test it

Edit the phone on a HubSpot company with a stored ID and confirm the QuickBooks customer updates within a minute. Edit a property that is not synced and confirm nothing runs past the hash check. Create a company named slightly differently from an existing customer and confirm it either links or lands in Slack for review, never creating a duplicate.

## Make it production-ready

- Add a nightly reconciliation workflow that compares hashes on both sides in report-only mode first.
- Decide how deletes and HubSpot merges should behave, and handle merges by updating the stored ID.
- QuickBooks and HubSpot both enforce API rate limits. Batch large backfills and keep the built-in retries.
- Log each write (company, customer ID, action, hash) to a table for audit.
- `claude-haiku-5-5` is a cheaper option for match scoring at volume.

Read the full guide at [How to sync data between business apps automatically](/guides/automate-data-sync-between-apps/), compare platforms in [n8n vs Zapier](/compare/n8n-vs-zapier/), or [talk to us](/start/) about a two-way sync.

---

Source: https://www.lumeor.studio/templates/automate-data-sync-between-apps/
Published by Lumeor Studio, Newtown, PA. hello@lumeor.studio. Get a written scope: https://www.lumeor.studio/start/
