ml-connector
SAP S/4HANAHubSpot

SAP S/4HANA and HubSpot integration

SAP S/4HANA runs your procurement and finance. HubSpot runs your sales and customer relationship management. Connecting the two keeps your business partner records synchronized and enables invoice visibility in HubSpot. When a new supplier or customer is created in SAP S/4HANA, it appears as a company in HubSpot, and purchase orders and invoices from SAP S/4HANA flow into HubSpot as opportunities and invoices. ml-connector bridges the very different API models and manages authentication on both sides, keeping your data in sync on a schedule you control.

How SAP S/4HANA works

SAP S/4HANA exposes suppliers, customers, purchase orders, purchase requisitions, invoices, GL accounts, and cost centers through OData V2 and V4 REST APIs, authenticated with OAuth 2.0 Client Credentials against a tenant-specific URL. Cloud deployments publish APIs at https://<tenant-id>-api.s4hana.ondemand.com/sap/opu/odata/sap/<SERVICE_NAME>/. On-Premise instances require an sap-client query parameter. SAP S/4HANA has no native webhooks; data is read by polling with LastChangeDateTime filters or delta tokens. Tokens are short-lived and must be refreshed before expiry.

How HubSpot works

HubSpot provides REST JSON APIs covering contacts, companies, deals, invoices, line items, and payments, authenticated with Private App Access Tokens or OAuth 2.0. The base URL is https://api.hubapi.com with cursor-based pagination and a 200-record limit per request. HubSpot supports webhooks with signature verification for real-time updates, though invoice write support is in public beta as of January 2026. Batch operations are capped at 100 records per request, and rate limits vary by tier, typically 100 to 190 requests per 10 seconds. Invoices must be associated with contacts and line items to be valid.

What moves between them

Business partners flow from SAP S/4HANA into HubSpot: suppliers and customers map to HubSpot companies. Purchase orders and supplier invoices flow from SAP S/4HANA into HubSpot: invoices map to HubSpot commerce invoice objects, and purchase orders can map to deals with line items. The sync runs on a polling schedule since SAP S/4HANA does not publish webhook events for procurement records. Reference data such as business partner roles and GL accounts establish the mapping between systems.

How ml-connector handles it

ml-connector stores both credential sets encrypted and manages OAuth 2.0 tokens on both sides: SAP S/4HANA tokens are typically valid for 12 hours and are refreshed before expiry, while HubSpot Private App tokens are long-lived. On the SAP S/4HANA side, ml-connector accepts the full tenant URL from the Communication Arrangement, constructs OData filter expressions using LastChangeDateTime to identify changed records, and respects the short token lifetime with proactive refresh. On the HubSpot side, it maps supplier and customer entities to companies, validates that invoices include required contact and line item associations, and uses batch operations within the 100-record cap to post changes. Rate-limit headers from HubSpot are monitored and backoff is applied when approaching tier limits. Polling cadence can be adjusted based on your business cycle, and every record carries a full audit trail.

A real-world example

A mid-sized B2B services firm runs SAP S/4HANA for procurement and accounting across three regional offices. Sales teams use HubSpot to manage customer relationships and track deals. Before the integration, the procurement team manually logged supplier names and invoice details into a spreadsheet, and sales did not have visibility into customer payment history or open orders. With SAP S/4HANA and HubSpot connected, suppliers appear automatically in HubSpot as companies, and invoices are linked to the customer records. Sales teams can now see which customers have open invoices, and the procurement team no longer re-enters supplier data.

What you can do

  • Sync SAP S/4HANA suppliers and customers into HubSpot as companies, keeping business partner master data aligned.
  • Map purchase orders from SAP S/4HANA to HubSpot deals with line items, automating the visibility of procurement to sales teams.
  • Post invoices from SAP S/4HANA into HubSpot with automatic association to the correct contact and line item records.
  • Authenticate SAP S/4HANA with OAuth 2.0 Client Credentials and refresh tokens before expiry, and HubSpot with Private App Access Tokens.
  • Poll SAP S/4HANA on a configurable schedule using LastChangeDateTime filters, with retries and a full audit trail on every record.

Questions

Which direction does data move between SAP S/4HANA and HubSpot?
The main flow is SAP S/4HANA into HubSpot. Suppliers and customers flow as companies, and purchase orders and invoices flow as deals and commerce records. HubSpot invoices are read-only post-sync, so ml-connector does not write invoice updates back into SAP S/4HANA.
How does ml-connector handle the different token lifetimes on each side?
SAP S/4HANA tokens are typically valid for 12 hours and ml-connector refreshes them proactively before expiry to avoid outages. HubSpot Private App tokens are long-lived. Both credential sets are stored encrypted, and token refresh happens transparently.
Does HubSpot's invoice write feature affect how the integration works?
HubSpot invoice write support is in public beta as of January 2026. When enabled, invoices from SAP S/4HANA are posted as HubSpot invoice objects with required associations to contacts and line items. The integration respects these constraints and will not post malformed invoices.

Related integrations

Connect SAP S/4HANA and HubSpot

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

Get started