ml-connector
QuickBooks OnlineSalesforce

QuickBooks Online and Salesforce integration

QuickBooks Online runs your accounting and invoicing. Salesforce tracks your sales pipeline and customer relationships. Connecting the two keeps your sales and financial data in sync. Customers created in QuickBooks flow to Salesforce Accounts; invoices show up as Opportunities tied to the right contact. Orders entered in Salesforce post back to QuickBooks as journal entries so your revenue recognition and cost allocation are complete. ml-connector bridges the two OAuth systems and handles the different data shapes each uses.

How QuickBooks Online works

QuickBooks Online exposes customers, vendors, invoices, bills, journal entries, accounts, departments, and classes through the QuickBooks Online Accounting API, a REST service at https://quickbooks.api.intuit.com/v3/company/{realmId} (with a sandbox alternate). It authenticates with OAuth 2.0 Authorization Code flow, with access tokens expiring in 1 hour and refresh tokens rotating every 24-26 hours. QuickBooks offers both webhooks (push on create/update/delete for dozens of entity types) and a CDC polling endpoint with 30-day history, though webhook payloads contain only the entity ID and operation, requiring a full record fetch via GET.

How Salesforce works

Salesforce exposes Accounts, Contacts, Opportunities, Orders, Invoices, Leads, Products, and custom objects through the REST API and Change Data Capture (CDC) API. It authenticates with OAuth 2.0 Client Credentials Flow (server-to-server), requiring a Consumer Key, Consumer Secret, and My Domain instance URL; session tokens expire after 2 hours and there are no refresh tokens in the credentials grant. CDC streams changes via Pub/Sub API (gRPC) with 3-day retention; older org editions may not have the Invoice object (requires Revenue Cloud), and the Payment object is only in Revenue Cloud and B2B Commerce, not Sales Cloud.

What moves between them

QuickBooks Online customers and invoices flow into Salesforce as Accounts and Opportunities, with departments and classes from QuickBooks mapped to Salesforce custom fields. Sales Orders entered in Salesforce sync back to QuickBooks as journal entries, allocated to the matching department and GL account. The sync runs on a cadence tied to your sales and billing cycle, triggered by QuickBooks webhooks and Salesforce CDC events. Journal entries are read-only in QuickBooks after Salesforce posts them, so reversals flow through Salesforce.

How ml-connector handles it

ml-connector stores both OAuth credential sets encrypted and refreshes QuickBooks access tokens on expiry (1 hour) and refresh tokens on rotation (24-26 hours), triggering a re-auth if a refresh token is revoked. Salesforce tokens are refreshed every 90 minutes since there are no persistent refresh tokens in Client Credentials flow. QuickBooks webhook payloads contain only entity IDs and operations, so ml-connector immediately fetches the full record via GET to capture all fields; if a webhook is missed or arrives out-of-order, the CDC polling endpoint provides a 30-day history. Salesforce CDC streams changes in near-real-time over Pub/Sub API with 3-day retention; if the stream is interrupted, polling via GET /sobjects/Account/updated/ bridges the gap. All QuickBooks invoices carry a SyncToken for concurrency control; ml-connector includes the token on updates to prevent conflicts. Departments and Classes from QuickBooks map to text fields on the Salesforce Account, and Orders in Salesforce are validated against QuickBooks Item and Account entities before posting.

A real-world example

A mid-market SaaS company runs QuickBooks Online for invoicing and expense management, and Salesforce to track customer opportunities and close the sales pipeline. Before the integration, the accounting team exported customer lists from QuickBooks weekly and uploaded them to Salesforce by hand, then exported closed Opportunities from Salesforce and re-entered them as revenue journals in QuickBooks at month-end. With QuickBooks Online and Salesforce connected, each new customer in Salesforce is validated and pushed into QuickBooks; each invoice generated in QuickBooks surfaces in Salesforce tied to the matching Account. When a deal closes in Salesforce, the order becomes a journal entry in QuickBooks, pre-allocated to the right department. Manual exports and re-entry are gone, and the two systems stay synchronized throughout the month without human intervention.

What you can do

  • Sync QuickBooks Online customers and invoices to Salesforce Accounts and Opportunities, keeping sales and accounting in agreement.
  • Flow Salesforce Orders back to QuickBooks as journal entries, allocated to the matching department and GL account.
  • Bridge OAuth 2.0 credentials for both systems, refreshing tokens on expiry and re-authenticating on rotation.
  • Process QuickBooks webhooks and CDC polling to catch creates and updates in near-real-time, with 30-day history fallback.
  • Map QuickBooks departments and classes to Salesforce custom fields so departments on Opportunities line up with GL accounting.

Questions

How does ml-connector handle the different OAuth token lifetimes?
QuickBooks Online tokens expire after 1 hour, with refresh tokens rotating every 24-26 hours and the entire auth chain revoking if a refresh token is stale. Salesforce Client Credentials tokens expire after 2 hours with no refresh token, requiring a full re-auth on expiry. ml-connector tracks both expiry times independently and refreshes each on its own schedule, re-authenticating immediately if a revocation is detected.
QuickBooks webhooks only include entity IDs, not full records. How does ml-connector get the data?
WebhookPayloads in QuickBooks contain only the entity ID and operation (create/update/delete). ml-connector immediately fetches the full record via GET /v3/company/{realmId}/query?query=select from <Entity> where id=<ID>, capturing all fields. If a webhook is missed or arrives out-of-order, the CDC endpoint with 30-day history backfills the gaps.
Does Salesforce have a Purchase Orders or Invoices object in every edition?
Salesforce Invoices require Revenue Cloud or Order Management (API v48.0+); basic Sales/Service Cloud orgs may not have them. Purchase Orders have no standard object; ml-connector uses the standard Order object instead. Payment objects exist only in Revenue Cloud and B2B Commerce, not in Sales Cloud. Check your Salesforce edition before configuring invoice or payment flows.

Related integrations

Connect QuickBooks Online and Salesforce

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

Get started