Two-way QuickBooks Online sync: lessons from replacing a Desktop connector

OAuth tokens that rotate, checkpoints that must not skip records, and matching 194 existing customers without duplicates. What we learned building an unattended QuickBooks Online sync.

Accounting integrations have an unforgiving property: every mistake is visible to an accountant eventually. When a client asked us to replace their QuickBooks Desktop Web Connector integration with QuickBooks Online, we designed for the failure cases first.

1. Tokens rotate, so plan for it

QuickBooks Online uses OAuth 2.0 with rotating refresh tokens: each refresh returns a new refresh token, and the old one stops working. If you refresh successfully but fail to save the new token, you are locked out until a human reconnects. We persist the new token atomically before using the access token, so the sync can run unattended for months.

2. Decide what syncs which way

Not everything should be two-way. We settled on:

  • Two-way: Customers/Jobs, Vendors, Employees, Items, Classes and Accounts, tracked with NeedsPush/NeedsPull flags.
  • One-way push: Purchase Orders, Time Activities, Journal Entries and Inventory Adjustments.

Transactions with missing required fields are held back rather than failing the whole run, and they show up in the run summary.

3. Never move the checkpoint past a failure

Incremental sync means "give me everything changed since the last checkpoint." The subtle bug is moving the checkpoint forward after a partially failed run, which silently skips records forever. Our checkpoint moves only when a run has zero failures, and we query with a small safety buffer to catch clock skew.

4. Match existing data before the first sync

Both systems already had customers. Blindly pushing would have created duplicates. We built duplicate detection plus resolution of the Customer → Job → Phase hierarchy. 192 of 194 records linked automatically, with none left unresolved.

5. Give operations a way in

Per-entity toggles, a configurable interval, an on-demand trigger from the legacy app, two small admin screens, run summaries and exit codes for monitoring. The best integration is one nobody has to think about, but when someone does need to, everything should be visible.

Planning a QuickBooks, PayPal or Stripe integration? We can help.

Share this article

Let’s Solve Your Trucking & Logistics Software Challenges

Tell us about your operation, the systems you use, and the challenges you want to solve. Softlaunchers can help you evaluate a practical approach to software development, workflow automation, and integrations for your logistics business.