Key takeaways#
- Always check the HubSpot App Marketplace first – a maintained app beats custom code for standard needs.
- For custom integrations with one portal, use a private app with minimal scopes.
- Use webhooks and workflow actions for near real-time events; use scheduled syncs for bulk data.
- Design data mapping, unique IDs, error handling and monitoring before you write code.
HubSpot becomes much more valuable when it knows what happens in your other systems: orders in the web shop, invoices in the ERP, bookings in the scheduling tool, usage in your SaaS product. In this guide we explain the integration options HubSpot offers, how to choose between them, and the practices that keep an integration reliable for years.
Step 1: Start with the business question#
An integration is never the goal in itself. Write down the questions you want HubSpot to answer or the actions it should trigger, for example:
- “Which contacts have bought product X in the last 12 months?” → orders need to sync to HubSpot.
- “Notify the account manager when a customer’s invoice is overdue.” → invoice status needs to sync.
- “Create a customer in the ERP when a deal is won.” → HubSpot needs to push data out.
From these questions you can derive which objects, properties and directions are needed – and, just as importantly, what you can leave out.
Step 2: Choose the right integration approach#
| Approach | Best for | Considerations |
|---|---|---|
| Marketplace app | Standard tools (e-commerce platforms, accounting, video, webinars) | Fast and maintained by the vendor; limited customisation |
| Data sync (Operations / Data Hub) | Two-way sync of contacts, companies and deals with supported apps | No code, field mapping in the UI; depends on supported apps |
| Private app + API | Custom integrations for one portal | Access token with scopes; you host the code |
| Public app (OAuth) | Integrations used by many portals (e.g. your SaaS product) | OAuth flow, app webhooks, can be listed in the marketplace |
| Workflow webhooks & custom-coded actions | Triggering external systems from HubSpot automation | Requires the right Operations / Data Hub tier |
| Serverless functions (CMS) | Website features that need server-side logic | Content Hub Enterprise; short-running functions |
Feature availability depends on your HubSpot subscription and changes over time, so always verify tiers in HubSpot’s current documentation before committing to an approach.
Step 3: Design the data model and mapping#
Most integration problems are data problems. Before coding, agree on:
- Objects: which external records map to contacts, companies, deals, products, line items, tickets or custom objects.
- Unique identifiers: store the external system’s ID in a unique HubSpot property (e.g.
erp_customer_id) so you can upsert instead of creating duplicates. - Source of truth per field: if both systems can edit a field, decide which one wins.
- Associations: e.g. orders (deals) associated with both the contact and the company.
- Formats: dates (HubSpot uses UTC midnight timestamps for date properties), currencies, enumeration values.
Step 4: Build with reliability in mind#
Authentication and security#
Use a private app access token stored as a secret (never in front-end code or Git). Grant only the scopes the integration needs. Rotate tokens when people leave the project.
Rate limits and batching#
HubSpot APIs have burst and daily limits that depend on your subscription and app type. Use batch endpoints (create, update and read up to many records per request), respect 429 responses with exponential back-off, and avoid polling when webhooks are available.
Idempotency#
Design every sync so it can run twice without creating duplicates. Upsert by unique ID, and keep a log of processed events.
Error handling and monitoring#
- Log every failed request with the payload and HubSpot’s error message.
- Retry transient errors; alert a human for validation errors.
- Build a simple health dashboard: last successful run, records processed, errors.
Step 5: Example – syncing web shop orders to HubSpot#
- The shop sends an order created webhook to a small integration service.
- The service upserts the contact by email and the company by domain or customer number.
- It creates a deal in a dedicated “Web orders” pipeline with amount, order number and status.
- Line items are created and associated with the deal, referencing HubSpot products by SKU.
- A HubSpot workflow uses the order data for post-purchase emails and cross-sell segments.
Step 6: Document and hand over#
Document the data mapping, environment variables, deployment process and how to re-run a failed sync. An integration that only one developer understands is a risk.
Checklist#
- Is there a marketplace app that already solves this?
- Which questions/actions does the integration enable?
- Which unique ID links records across systems?
- Which system owns each field?
- How are failures detected and retried?
- Who owns the integration after launch?
Frequently asked questions#
What is a HubSpot private app?#
A private app gives a single HubSpot account an access token with specific scopes for API calls. It is the recommended way to build custom integrations for one portal and replaced the old API keys.
Should I use a marketplace app or build a custom integration?#
Always check the marketplace first. A maintained app is usually faster and cheaper for standard tools. Build custom when you need specific data mapping, business logic or an unsupported system.
How do I avoid duplicate records when syncing data?#
Store the external system’s unique ID in a unique HubSpot property and upsert records by that ID or by email/domain. Design each sync so it can run twice without creating duplicates.
How much does a HubSpot integration cost?#
Our integrations start from SEK 15,000 (excl. VAT), including requirements, data mapping, error handling, logging and documentation. Complex two-way syncs are quoted after scoping.