ml-connector
SAP Business OneHubSpot

SAP Business One and HubSpot integration

SAP Business One runs your financials and operations. HubSpot runs your sales pipeline and customer relationships. Connecting the two gives sales the context they need on customer invoices, payment status, and credit history without leaving HubSpot, and it keeps both systems aligned on who your customers are. New customers created in SAP sync to HubSpot as companies, invoices and payments flow into the deal and contact records, and the two systems become the single source of truth for customer financial data.

How SAP Business One works

SAP Business One exposes invoices, purchase orders, business partners, chart of accounts, journal entries, dimensions, and profit centers through OData v4 REST APIs published at each customer's on-premise Service Layer instance. Authentication uses a time-limited session token obtained via POST /Login, which returns a B1SESSION cookie that expires after 30 minutes of inactivity. The platform supports webhooks for Create/Update/Delete events in version 10.0 FP 2602 and later if the customer has enabled the Webhook Messenger Service, but polling via scheduled GET with UpdateDate filters is recommended as the default approach. Each customer provides their own Service Layer base URL and port; no global shared endpoint exists.

How HubSpot works

HubSpot exposes contacts, companies, deals, invoices, payments, and commerce objects through REST APIs at https://api.hubapi.com with date-versioned paths. Authentication uses a Private App Access Token in Bearer format, with credentials scoped to a specific portal ID. HubSpot supports both webhook subscriptions for real-time event notifications and polling via list and search endpoints with cursor-based pagination capped at 200 records per page. Invoice write support is in public beta as of January 2026. Batch operations are limited to 100 records per request, and rate limits vary by subscription tier, with Professional and Enterprise tiers allowing up to 190 requests per 10 seconds.

What moves between them

Invoices, business partners, and payment records flow from SAP Business One into HubSpot. Each SAP invoice creates or updates a HubSpot invoice linked to the customer company record; payment records update invoice status in HubSpot. Customer business partners in SAP sync as HubSpot company records with credit limits and payment terms embedded. The integration polls SAP on a schedule you control, typically aligned to your invoice and payment processing cycles, and pushes the data into HubSpot either via webhook delivery or polled batches. Reference data such as chart of accounts and profit centers are available but not synced by default; they are used to enrich invoice line items where needed.

How ml-connector handles it

ml-connector maintains the SAP session token lifecycle: it authenticates once per connection cycle using the customer-provided Service Layer URL and credentials, receives the B1SESSION cookie, and reuses that session until expiry or error. On the HubSpot side it stores the Private App Access Token encrypted and includes it as a Bearer token on every call. ml-connector polls SAP invoices and business partners on a schedule tied to your financial close calendar, using OData $filter parameters to retrieve only records modified since the last sync run, which minimizes SAP load and HubSpot API consumption. Invoices are matched to existing HubSpot company records by business partner code; if no match is found, ml-connector creates the company. Payments from SAP are associated with invoices in HubSpot using idempotent reference IDs so retries never create duplicates. The integration tracks SAP document numbers to avoid re-syncing invoices that have already been processed, handles SAP's 20-record default page size by using OData $top and $skip parameters, and catches HubSpot's 100-record batch limit by chunking invoice operations across multiple requests. Errors on either side trigger exponential backoff with jitter, and every sync event is logged so failed records can be replayed once the issue is resolved.

A real-world example

A mid-market B2B services firm uses SAP Business One for accounting, invoicing, and customer master data, and uses HubSpot to manage their sales pipeline and customer relationships. Before the integration, the sales team received invoices and payment status via weekly email exports and manually copied key data into HubSpot deal records. With SAP Business One and HubSpot connected, each new invoice that SAP generates flows into HubSpot within minutes, attached to the customer company record with payment terms and credit status. The sales team can now see the full financial picture of each customer without leaving HubSpot, and can prioritize follow-ups based on overdue invoices or upcoming contract renewals. Month-end reporting is faster because invoice and payment data are already synchronized and no manual data entry is needed.

What you can do

  • Sync SAP Business One invoices and customer records to HubSpot companies, maintaining the relationship between invoices and the customers who owe them.
  • Create and update HubSpot company records from SAP Business One business partners, including credit limits, payment terms, and customer classification.
  • Flow payment records from SAP into HubSpot to update invoice status and track payment history on each customer company.
  • Authenticate SAP with session tokens managed transparently and HubSpot with Private App Access Tokens stored encrypted.
  • Poll SAP on your financial calendar and sync changes idempotently, tracking document numbers to prevent duplicate invoices.

Questions

Which direction does data flow between SAP Business One and HubSpot?
The primary flow is SAP into HubSpot: invoices, payments, and customer records from SAP sync into HubSpot companies and invoice records. HubSpot is the read destination. This is because HubSpot invoice write support is in public beta and SAP is the system of record for financial data. Prospects and leads created in HubSpot can be exported and manually imported into SAP as new business partners outside the automated integration.
How does ml-connector handle SAP Business One's session token expiry?
ml-connector authenticates to SAP at the start of each sync cycle by sending the customer credentials to POST /Login, receives the B1SESSION cookie, and stores it for the duration of that sync run. If the session expires during a long-running sync, ml-connector detects the -5002 timeout error code, re-authenticates, and retries the failed operation with the new session token. This is transparent to the user and requires no manual intervention.
What happens if an invoice fails to sync to HubSpot?
Every invoice sync is idempotent using SAP's document number as the key, so ml-connector retries automatically with exponential backoff. The failed record is logged with full context including the SAP invoice number and the HubSpot error response, allowing you to diagnose the issue and replay the sync once fixed. Common causes are missing company records in HubSpot or malformed line items; ml-connector can be configured to auto-create companies from SAP or skip line items that fail validation.

Related integrations

Connect SAP Business One and HubSpot

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

Get started