Engineered a custom, real-time integration between Salesforce and QuickBooks Online using Heroku middleware, replacing an expensive third-party connector to eliminate recurring costs and remove technical bottlenecks.
Tools: External Client App (ECA), APEX (Classes, Queueable, Test), APEX Triggers, Named Credentials, Custom Metadata, Salesforce REST API (HttpRequest and HttpResponse), Custom Fields, Heroku, GitHub, LWC, VSC, Salesforce CLI, Remote Site Settings, Tabs, Custom Action, Flow, Perm Sets
As part of an organization-wide initiative to cut operational expenditures, the company audited recurring software expenses and identified a significant opportunity within our billing tech stack. The organization was spending $25,000 annually on an off-the-shelf third-party integration between Salesforce and QuickBooks Online that was both costly and restrictive. In addition to the recurring fee, the vendor tool imposed operational friction—most notably a five-minute batch sync delay that stalled workflows and introduced data discrepancies between sales and accounting teams. The business needed a high-performance, cost-effective alternative that not only eliminated vendor licensing expenses but also granted full architectural control to implement custom mapping and instant sync logic tailored to our specific accounting processes.
To solve these challenges, I architected and deployed an automated, in-house integration layer hosted on Heroku to serve as the secure middleware between Salesforce and QuickBooks Online. Replacing the rigid five-minute polling cycle, the new solution leverages real-time webhooks and event-driven architecture to instantly sync financial data—automatically creating and updating invoices, bills, and payment records directly within Salesforce the moment transactions occur. Taking development in-house eliminated the $25,000 annual vendor cost, removed third-party platform constraints, and delivered a scalable, fully customizable integration that gives finance and operations teams reliable, zero-latency visibility into critical accounting data.
The integration operates as an asynchronous, event-driven pipeline connecting Salesforce, Heroku, and QuickBooks Online across multiple operating and escrow entities.
Real-Time Triggering & Ingestion: When business records—including Contact Cards, Agents, Properties, Invoices, and Bills—are created or updated in Salesforce, Apex triggers package the record payload and dispatch an authenticated HTTPS REST callout to the Heroku middleware. A Heroku Web Dyno immediately receives the payload and pushes the task into Heroku Redis via BullMQ, offloading execution from the web layer to keep Salesforce transactions non-blocking and snappy.
Multi-Entity Processing & Background Workers: A dedicated Heroku Worker Dyno consumes jobs from the Redis queue and evaluates entity routing against Heroku Postgres, which securely maintains persistent configuration mappings and OAuth tokens across multiple QuickBooks companies (e.g., standard brokerage vs. state escrow entities). The worker transforms Salesforce records into QuickBooks-compliant payloads—such as converting Agent Services invoices into Sales Receipts, standard invoices into QBO Invoices with specific tax/sales terms, or syncing Vendor records according to agent employment milestones—and makes the appropriate Intuit REST API calls using specific Realm IDs.
Bi-Directional Sync & Status Reflection: The data loop is completed in real time. Once QuickBooks processes a transaction (or when QuickBooks webhooks fire for events such as invoice updates and payment collections), Heroku catches the event and writes back to Salesforce using a Salesforce External Client App with JWT Bearer Flow authentication. Heroku stamps the target record with its QuickBooks Document Number, updated balances, sync timestamps, and job statuses (Success or Failed). If an error or API validation failure occurs, Heroku logs the explicit error message directly onto the Salesforce record for accounting visibility and routes an automated alert email through a QuotaGuard Static IP proxy to ensure whitelisted, reliable delivery to support inboxes. There is also a custom tab and table that displays any records with errors allowing for troubleshooting and automatic re-run of the record.