The Zeroic Journal

QuickBooks API integration: what breaks in invoice sync

Rotating tokens, per-company limits, reads that now cost money and retries that double-post invoices: where QuickBooks syncs fail, and the design that holds.

On this page 7 sections
  1. Save every refresh token QuickBooks returns
  2. Stay under 500 requests per minute per company
  3. QuickBooks API integration reads now cost money
  4. Webhooks for speed, CDC as the net
  5. Stop duplicates with requestid and SyncToken
  6. How to plan your QuickBooks sync
  7. FormulaBot runs 40+ connectors for 1.5M+ users

A QuickBooks API integration breaks in four places: token refresh, rate limits, metered reads and duplicate records. Access tokens last 60 minutes, refresh tokens rotate and expire after 100 unused days, each company allows 500 requests a minute, and most reads now count against a monthly cap. Design for all four before the first invoice syncs.

Most teams find these out in production. The sandbox isn’t metered and has one tidy company file. A live app has hundreds of connected companies, accountants editing the same invoices, and a background job that retries on every timeout. Intuit also changed the economics in late 2025, when it began metering read calls under its App Partner Program, so a sync design that was free a year ago can now hit a hard cap.

Save every refresh token QuickBooks returns

QuickBooks Online uses OAuth 2.0 with the com.intuit.quickbooks.accounting scope. Intuit’s OAuth 2.0 setup guide gives the lifetimes: access tokens are valid for 3,600 seconds, and refresh tokens have a rolling expiry of 100 days. Three details cause most of the “user got disconnected” tickets.

The refresh token rotates. Intuit’s authorization FAQ says it updates the refresh_token value every 24 hours, or on the next refresh after that, and “the previous refresh token value automatically expires.” If your code refreshes the access token but keeps the refresh token it started with, the connection dies a day later.

Two workers can race. If a webhook handler and a nightly job both see an expired access token and refresh at the same moment, one of them may save a token the other has already replaced. Keep tokens in one row per company (the realmId), refresh under a row lock, and have every other process read from that row instead of refreshing on its own.

There is now a hard ceiling. Intuit’s release notes for June 2026 state that the maximum refresh token lifetime is now limited to five years. Rolling use no longer keeps a connection alive forever. Send the x-include-refresh-token-hard-expires-in: true header on the token request and the response includes x_refresh_token_hard_expires_in, the seconds left in that five-year span. Store it, and prompt the customer to reconnect well before it runs out instead of finding out from a failed sync.

// one refresh at a time per connected company
await db.transaction(async (tx) => {
  const conn = await tx.qboConnections.lockByRealm(realmId); // SELECT ... FOR UPDATE
  if (conn.accessExpiresAt > Date.now() + 60_000) return;    // another worker already refreshed
  const t = await intuit.refresh(conn.refreshToken);
  await tx.qboConnections.update(realmId, {
    accessToken: t.access_token,
    refreshToken: t.refresh_token,                            // always the newest value
    accessExpiresAt: Date.now() + t.expires_in * 1000,
  });
});

Build the disconnect path too. A user can revoke access from QuickBooks, and Intuit’s FAQ lists revoked access alongside expiry as reasons a token stops working. Your app needs a visible “reconnect QuickBooks” state that asks the user to sign in again, because retrying a revoked token never succeeds.

Stay under 500 requests per minute per company

Intuit’s limits page sets the same numbers for sandbox and production:

LimitValue
REST requests500 per minute per realm ID
Concurrency10 requests per second, per realm ID and app
Batch endpoint40 batch requests per minute, per realm ID and app
Operations per batch30 recommended maximum
Query results1,000 entities per response, so paginate
Request timeout120 seconds

Going over returns HTTP 429, and Intuit says to wait 60 seconds before retrying. Higher limits aren’t for sale: the App Partner Program FAQ says access to higher throttling limits “is not available” at the moment.

Because the limits are per company, one big customer can’t starve the others, but one busy customer can starve itself. The first sync after a customer connects is where this bites: a year of invoices, customers and payments pulled in a loop will hit 429 within a minute. Put each company’s calls behind its own queue with a rate limiter set below 10 a second, use the batch endpoint for bulk writes, and back off for the full 60 seconds on a 429 instead of retrying straight away.

QuickBooks API integration reads now cost money

This is the change older guides miss. Every app is enrolled in the Intuit App Partner Program, and its FAQ splits API calls in two:

  • Core calls cover most data-in operations, such as creating or updating invoices, bills and customers. They’re unmetered and free.
  • CorePlus calls cover most data-out operations, such as reading accounts, querying company information and fetching reports. They’re metered.

CorePlus metering began on November 3, 2025 in the US, Canada (excluding Quebec), the UK and Australia. The free Builder tier includes 500,000 CorePlus calls per calendar month, and Intuit blocks any CorePlus call above that until you upgrade. The Silver tier lifts the block: Intuit’s US billing example shows a $300 monthly program fee, 1,000,000 included CorePlus credits, and $3.50 per 1,000 calls above that. Usage is counted per app and added up across your developer workspace, and sandbox calls aren’t metered, which is why the problem only shows up after launch.

Run the numbers on a polling design. Checking one company every 5 minutes is 8,640 checks a month. If each check is a single read call, 58 connected companies already cross 500,000 a month, and if you check invoices, customers and payments with three separate queries, about 20 companies do. Intuit classifies each call by endpoint and HTTP method, and the Analytics tab on your app in the developer portal shows usage by Core and CorePlus, so measure your own mix before you pick a tier. Whatever the exact count, polling every company on a timer is the most expensive way to stay in sync.

Webhooks for speed, CDC as the net

QuickBooks webhooks notify your endpoint when an entity changes in a connected company. Intuit’s webhook best practices set the rules your endpoint has to meet:

  • Answer within 3 seconds with HTTP 200. Failed deliveries are retried at 10s, 20s, 30s, 5m, 20m, 2h, 4h and 6h, then every 6 hours, and Intuit warns you may not receive later events until the first one is acknowledged. Put the payload on a queue and return.
  • Expect events out of order. The time field in the notification is the source of truth for when a change happened.
  • Verify the signature. Hash the raw payload with HMAC-SHA256 using your app’s verifier token and compare it with the intuit-signature header, as the webhook configuration guide describes.

The payload is a CloudEvents-style message with an event type such as qbo.salesreceipt.updated.v1 and the changed record’s ID in intuitentityid. Intuit’s page on the webhook data object shows that an update event can arrive with no data object at all. In practice, a webhook tells you what changed and you read the record to see how, the same refetch pattern we describe for Stripe webhooks that drift.

Webhooks can still be missed. Intuit’s answer is change data capture: one GET to /v3/company/<realmId>/cdc?entities=invoice,customer,payment&changedSince=<timestamp> returns full payloads for every listed entity that changed since that time. The CDC documentation sets three limits: it looks back 30 days at most, a response holds up to 1,000 objects, and it doesn’t cover JournalCode, TaxAgency, TimeActivity, TaxCode or TaxRate. Deleted records come back with a Deleted status, which a plain query won’t show you.

Intuit’s best practice is to run CDC from the last webhook you processed successfully whenever you suspect a gap, plus a daily CDC call for every entity you sync. That pairing costs a handful of reads per company per day instead of thousands.

Stop duplicates with requestid and SyncToken

The most expensive QuickBooks bug is an invoice that posts twice, because an accountant has to find and void it by hand. Intuit’s field definitions give the fix: send a requestid query parameter on every create, update and delete. If Intuit receives the same request ID again, it returns the original response instead of performing the operation twice. Without one, Intuit says a retried request creates “a duplicate invoice with a new entity ID.”

The rules are strict. The ID must be unique per company file, up to 50 characters (36 for batch requests), and a retry must send the same ID with the same content. Derive it from your own record, such as your invoice’s UUID, so a retry after a crash produces the same ID automatically. A random UUID generated inside the retry loop defeats the purpose.

Updates have a second guard. Every QuickBooks object carries a SyncToken that changes each time the object is modified. Intuit’s error guide lists error 5010, Stale Object Error, for an update sent with an old token, usually because someone edited the invoice in QuickBooks first. Read the latest version before you update, and on a 5010, re-read and decide whether your change still applies instead of overwriting the accountant’s edit.

Two more errors come from the customer’s settings rather than your code:

  • 6140, Duplicate DocNum: the company uses custom transaction numbers and your DocNumber clashes with an existing one. Intuit suggests checking Preferences.SalesFormsPrefs.CustomTxnNumbers first and prefixing your numbers when it’s on.
  • 6240, Duplicate Name Exists: you tried to create a customer whose name already belongs to another customer, vendor or employee. Look the name up and link to the existing record before creating one.

Keep a mapping table of your ID, the QuickBooks ID and the last SyncToken per company. It’s the table every one of these fixes reads from.

How to plan your QuickBooks sync

  • Writes only, a few dozen companies: you’re mostly making free Core calls. A daily CDC call per company is enough to catch edits made inside QuickBooks.
  • Two-way sync of invoices and payments: webhooks into a queue, a refetch per event, and CDC from the last processed event after any outage. Budget for CorePlus reads from the start.
  • More than a few hundred companies, or reports in your product: model your monthly CorePlus volume from measured usage before launch, and plan for the Silver tier rather than discovering the 500,000 cap when calls start failing.
  • Retries anywhere in the write path: requestid derived from your own record ID, stored mappings, and a re-read before every update.
  • Connections older than a few years: store the hard expiry and email the customer before the five-year limit, with a one-click reconnect.
  • Serving UK or Australian customers too: Xero is the usual second integration, with tighter limits. Xero’s API limits page allows 60 calls a minute and 5 concurrent calls per organisation, and 1,000 calls a day on the starter tier or 5,000 on higher tiers. Its 429 responses include a Retry-After header, so design the same queue for both.

If you’re adding QuickBooks to an app that’s already live and something here is missing, our senior developers can add it inside your existing codebase.

FormulaBot runs 40+ connectors for 1.5M+ users

The habits above apply to any product that holds credentials for many outside systems. For FormulaBot (now Better Analyst), our engineers built the connector layer behind its 40+ data sources, from BigQuery to Postgres, and split data processing, AI inference and the user-facing API into independently deployable services. That separation helped the platform scale from thousands to 1.5M+ users, and it’s the pattern we follow for accounting syncs: each connection’s work runs apart from the request your user is waiting on, so one slow or throttled source doesn’t hold up the rest. Our write-up on English-to-SQL at 1M users covers the query side of the same product.

Financial data adds its own care. For Finance Girlie, a personal finance platform that has served 400+ women, we built Plaid bank linking and transaction sync with category rules tuned to its coaching program.

For QuickBooks and Xero work, we quote one fixed price before work starts. Single integrations start at $1,000. Our QuickBooks and Xero integration page covers what we build, and API integration services covers the other systems your product may need to talk to.

Frequently asked questions

How long do QuickBooks API refresh tokens last?
A QuickBooks Online refresh token lasts 100 days on a rolling basis, so each use extends it. Intuit also rotates the value roughly every 24 hours and expires the previous one, so you must save the newest token from every response. On top of that, every refresh token now has a hard maximum lifetime of five years, after which the user has to reconnect your app.
What are the QuickBooks Online API rate limits?
Intuit allows 500 requests per minute per company (realm ID) and 10 requests per second per company and app. The batch endpoint is throttled at 40 requests per minute per company and app, with a recommended maximum of 30 operations per batch. Going over returns HTTP 429, and Intuit says to wait 60 seconds before retrying. Higher limits are not currently offered.
Does the QuickBooks API cost money to use?
Writing data is free, but most reads are metered. Under the Intuit App Partner Program, Core calls such as creating invoices or customers are unmetered. CorePlus calls, mostly reads, queries and reports, are counted. The free Builder tier includes 500,000 CorePlus calls a month and blocks calls above that. The Silver tier costs $300 a month in the US and includes 1 million credits.
How do I stop the QuickBooks API from creating duplicate invoices?
Send a unique requestid query parameter with every create, update and delete, and reuse the same ID and body when you retry. If QuickBooks has already processed that request, it returns the original response instead of creating a second invoice. Store the QuickBooks ID against your own record as soon as the create succeeds, and read the latest SyncToken before any update.
Should I use QuickBooks webhooks or polling to sync data?
Use webhooks for speed and change data capture as the safety net. Webhooks tell you which record changed, and a scheduled change data capture call catches anything a webhook missed. Polling every entity on a timer burns metered read calls and can push a busy app past the free tier's 500,000 monthly limit. Intuit's own best practices recommend the webhook and CDC combination.

References

  1. Intuit Developer - Set up OAuth 2.0
  2. Intuit Developer - Authorization FAQ (refresh token lifetimes)
  3. Intuit Developer - QuickBooks Online release notes
  4. Intuit Developer - API call limits and throttles
  5. Intuit Developer - Intuit App Partner Program FAQ (Core and CorePlus calls, fees)
  6. Intuit Developer - Webhooks best practices
  7. Intuit Developer - Configure webhooks (verifier token and signature)
  8. Intuit Developer - Understanding the webhook data object
  9. Intuit Developer - Change data capture operation
  10. Intuit Developer - Handling common errors
  11. Intuit Developer - Basic ID and field definitions (request IDs)
  12. Xero Developer - OAuth 2.0 API limits

More from the journal

Hear from Prashant within 24 hours.

Prashant Abbi Partner @ Zeroic

Need invoices in QuickBooks without the duplicates? Tell us what has to land in QuickBooks or Xero and what breaks today. We'll design the token handling, webhooks and retries, and quote one price before we start.

Rather talk it through? Book a 30-minute call