ml-connector
SAP Business OneSalesforce

SAP Business One and Salesforce integration

SAP Business One runs finance and operations. Salesforce runs sales and customer relationships. Connecting the two keeps your sales data and your orders aligned. New opportunities in Salesforce flow into SAP Business One as sales orders, and customer information stays current in both systems. Invoice status, payment history, and outstanding balances from SAP Business One enrich your Salesforce opportunity records with real-time credit risk and fulfillment visibility without manual data exports.

How SAP Business One works

SAP Business One exposes business partners, invoices, purchase orders, sales orders, journal entries, chart of accounts, dimensions, and profit centers through OData v4 REST at a customer-provided Service Layer endpoint (https://<customer-server>:<port>/b1s/v2/). Authentication uses a session token obtained via POST /Login returning a B1SESSION cookie with 30-minute inactivity timeout, or OAuth 2.0 in version 10.0 FP 2305 and later. SAP Business One runs on-premise only with customer-managed deployments, so there is no fixed global endpoint. Webhooks are supported in version 10.0 FP 2602+ but require server-side Webhook Messenger Service activation and SAP admin setup, so polling with UpdateDate filters is the recommended default. OData v3 is deprecated; all new integrations use OData v4.

How Salesforce works

Salesforce exposes accounts, contacts, opportunities, orders, invoices, leads, and products through OAuth 2.0 Client Credentials Flow REST APIs at https://<MyDomain>.my.salesforce.com/services/data/v63.0/. Each call requires a client_id, client_secret, and instance URL, with OAuth tokens expiring after a configurable session timeout (default 2 hours). Salesforce also supports Change Data Capture via Pub/Sub API for real-time push streaming on accounts, contacts, opportunities, orders, and invoices, with 72-hour event retention. Invoice and advanced order objects require Revenue Cloud or Order Management module and may not exist in basic Sales Cloud orgs.

What moves between them

The main flow is bidirectional. Opportunities from Salesforce flow into SAP Business One as sales orders, mapped to matching business partners by account number. Customer accounts from Salesforce create or update business partners in SAP Business One. In the reverse direction, invoices and payments from SAP Business One read back into Salesforce to populate opportunity credit limits, outstanding balance fields, and payment status. Reference data such as customer IDs and currencies must be aligned in both directions so orders and invoices match correctly.

How ml-connector handles it

ml-connector stores SAP Business One session credentials encrypted and reuses B1SESSION cookies for up to 30 minutes to avoid the 5-second cold-start penalty of a new login. For Salesforce, it authenticates via OAuth 2.0 Client Credentials Flow and refreshes the bearer token before expiry. Because SAP Business One is deployed on-premise, ml-connector accepts the full Service Layer endpoint URL per customer and validates entity paths against that instance. SAP Business One has no public webhook standard, so ml-connector polls OData endpoints on a configurable schedule using UpdateDate filters to fetch only changed records. Salesforce Change Data Capture is used where available to detect account and opportunity changes in near real time, with polling as a fallback. Opportunities are mapped to sales orders by matching Salesforce AccountId to SAP Business One CardCode. Invoice matching uses Salesforce OrderNumber or a custom field mapped to SAP Business One DocNum. Rate limits on both sides are handled with exponential backoff and jitter. Session tokens for both systems are tracked for expiry to avoid 401 errors mid-flow. Every record carries an audit trail and can be replayed if a downstream call fails.

A real-world example

A mid-market software services firm uses SAP Business One for accounting and order fulfillment and Salesforce for sales pipeline and customer relationships. Before the integration, opportunities created in Salesforce were printed and entered manually into SAP Business One by an operations admin, creating a week-long lag between when a deal closed and when it became an order in the ERP. Customers calling support often heard different invoice and payment status from Salesforce than from SAP Business One, since AR data was exported monthly rather than live. With SAP Business One and Salesforce connected, each new Salesforce opportunity generates a sales order in SAP Business One within minutes, the sales team sees current invoice totals and payment status in Salesforce, and reconciliation between systems is automatic.

What you can do

  • Sync Salesforce opportunities into SAP Business One as sales orders, automatically mapped to the correct business partner.
  • Sync Salesforce account changes to SAP Business One business partners to keep customer master data aligned.
  • Read SAP Business One invoices and payments back to Salesforce to show current outstanding balance and credit status on opportunities.
  • Authenticate SAP Business One via session token (with automatic refresh and cold-start reuse) and Salesforce via OAuth 2.0 Client Credentials, with encrypted credential storage.
  • Poll SAP Business One on a configurable schedule and listen to Salesforce Change Data Capture streams where available, with retries and a full audit trail on every record.

Questions

Does the integration support SAP Business One webhooks, or does it need to poll?
SAP Business One webhooks are supported in version 10.0 FP 2602+ if the customer has the Webhook Messenger Service activated and SAP admin setup complete. Since on-premise deployments and older versions do not have webhooks enabled, ml-connector defaults to polling with OData UpdateDate filters on a schedule you control. If your instance has webhooks enabled, ml-connector can subscribe to Create and Update events for faster sync.
Why does SAP Business One require a customer-provided Service Layer endpoint?
SAP Business One runs on-premise only, with each customer operating their own server instance. There is no fixed global endpoint like Salesforce. ml-connector accepts the full Service Layer URL per customer and can connect to any on-premise deployment that allows network access to the Service Layer port (default 50000 or 50001 for HTTPS).
How does the integration handle differences between Salesforce Invoice and SAP Business One invoice objects?
Salesforce Invoice requires Revenue Cloud or Order Management module and may not exist in basic Sales Cloud orgs. If Invoice is not available, ml-connector can sync invoice data via Salesforce Orders paired with custom fields instead. The mapping is configured per customer to match the available objects and Salesforce edition.

Related integrations

Connect SAP Business One and Salesforce

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

Get started