Finance & Integrations

QuickBooks and Xero integration: what a production-ready sync needs

Connecting to the QuickBooks Online or Xero API takes a day. Building a sync that finance trusts at month end takes much longer. This guide covers the parts that separate the two: tokens, limits, duplicates, mapping, tax, and the screen finance uses when something fails.

6 min read KRIVA Technologies Finance & Integrations
Integration diagram: your product connects through a KRIVA connector to QuickBooks or Xero and other systems, with owned retry and matching.
Illustrative · product → connector → ledger, with retry and matching owned in the middle

Most products that touch money eventually need to talk to the customer's accounting system. For small and mid-size businesses in the US, UK, Canada, and Australia, that usually means QuickBooks Online or Xero. Both have well-documented APIs, official SDKs, and sandbox accounts, so a developer can create a test invoice on the first afternoon.

The hard part comes later: the token that silently expired over a holiday weekend, the retry that posted an invoice twice, the tax code that exists in one customer's file and not another's, and the finance manager who cannot tell which records synced. This guide covers what a production sync needs. API details below are correct at the time of writing; check the current Intuit and Xero developer documentation before you build, because limits and token rules do change.

Decide what the integration owns

Before writing code, agree on direction and ownership for every type of record. The usual candidates are customers or contacts, items, invoices, bills, payments, credit notes, and journal entries. For each one, decide:

  • Direction: does it flow from your product to the ledger, from the ledger to your product, or both?
  • Source of truth: if the same customer is edited in both places, which edit wins?
  • Timing: does it sync immediately, on a schedule, or when a user presses a button?

One-way push from your product to the ledger is far simpler than two-way sync, and covers most needs. Two-way sync multiplies the edge cases, because you now have to detect and resolve conflicting edits. Only build it when a real workflow requires it.

Tokens and connection health

Both platforms use OAuth 2.0. Your product never sees the customer's password; it holds an access token for API calls and a refresh token to obtain new access tokens.

  • Access tokens are short-lived. At the time of writing, QuickBooks Online access tokens last about an hour and Xero's about thirty minutes. Refresh them automatically, before they expire.
  • Refresh tokens expire too. If a customer's connection is not used for long enough, the refresh token lapses and the customer has to reconnect. Both platforms can also issue a new refresh token when you use the old one, so store the latest one every time.
  • Connections break for ordinary reasons. The user who connected leaves the company, a permission changes, or the customer disconnects the app from the accounting side.

So the product needs a visible connection status, an alert when a connection fails, and a one-click reconnect flow. A sync that fails silently is worse than no sync, because finance believes the data is there.

Rate limits, retries, and duplicates

Both APIs limit how many calls you can make. At the time of writing, QuickBooks Online allows a few hundred requests per minute per company, and Xero applies per-minute, daily, and concurrent-call limits per connected organisation. A first sync of a year's history, or a month-end burst, will reach these limits. Queue work, respect the limit headers, and back off when told to.

Retries create the most damaging bug in accounting integrations: the duplicate. A request times out, your code retries, and the first request had in fact succeeded. Now the customer has two invoices. Prevent it in two layers:

  1. Use the platform's idempotency support. QuickBooks Online accepts a request ID on write calls, and Xero accepts an idempotency key header. A retry with the same key does not create a second record. Xero keeps those keys for only six minutes, so also store your own record of what you posted, and check it before retrying later.
  2. Keep your own record of what synced. Store the accounting system's ID against your record once a write succeeds, and check it before any retry.

Duplicates are worse than failures. A failed sync shows up in a log; a duplicate invoice shows up in a customer's inbox. Design the retry path before the happy path.

Mapping accounts, items, and tax

Every company's chart of accounts is different, so the integration cannot assume that "Sales" or "Freight income" exists. Let an administrator map your product's categories to their accounts and items during setup, and store that mapping per connected company.

Tax needs the same care, and it differs by country:

  • In the US, sales tax varies by state and locality, and QuickBooks Online can calculate it automatically for many companies. Decide whether your product sends tax amounts or lets the ledger calculate them, and do not do both.
  • In the UK, VAT rates are applied through tax codes, and Making Tax Digital expects digital links between systems rather than retyped figures. A direct sync helps meet that expectation.
  • In Canada, GST, HST, PST, and QST combinations depend on the province.
  • In Australia, GST coding feeds the Business Activity Statement, so a wrong code becomes a wrong BAS.

Agree tax mapping with the customer's finance team or accountant during setup and record it. Do not guess. Multi-currency adds a further layer: decide which system owns the exchange rate, and show any difference rather than hiding it.

The screen finance actually uses

The part of an integration that decides whether finance trusts it is not the API code but the operator screen. At minimum, it should show:

  • Every record that synced, failed, or is waiting, with the reason for each failure in plain language
  • A retry button for failed records that is safe to press twice
  • A link from each synced record to the matching transaction in QuickBooks or Xero
  • A reconciliation view that compares totals between your product and the ledger for a period, and highlights the difference

With that screen, finance can fix most problems without filing a ticket. Without it, every sync error becomes an engineering task, and month-end close waits for a developer. Our accounting integrations page shows how we structure this view.

Rolling out against live books

Test against sandbox companies first. Both platforms provide them. Then roll out carefully:

  1. Agree account and tax mapping with finance, in writing.
  2. Run the sync in a review mode, where records are prepared but a person approves them before they post.
  3. Run in parallel with the old process for one close cycle, and compare totals.
  4. Switch to automatic posting once the totals match, and keep the reconciliation view.

If you plan to list your app publicly in the QuickBooks App Store or the Xero App Store, each platform has its own review and certification process. Allow time for it in the plan.

Key takeaways

  • Decide direction and source of truth for every record type before you build. One-way push covers most needs.
  • Treat token refresh and reconnection as product features, with visible connection status.
  • Use idempotency keys and store accounting IDs, so retries can never create duplicates.
  • Let administrators map accounts and tax codes per company, and agree tax mapping with finance.
  • Give finance a sync log, safe retries, and a reconciliation view, then run one close cycle in parallel.

Building or fixing a QuickBooks or Xero integration? Tell us which records need to move, in which direction, and what goes wrong today, and We reply within one business day with how we would approach it. Send a project brief or Book a free 20-minute fit call.

Start a conversation

Planning a QuickBooks or Xero sync?

Tell us which records need to move, in which direction, and what goes wrong today.

Prefer to talk first? Book a free 20-minute fit call, or send a longer brief with files from the contact page.

Enter your name.

Enter a valid work email.

Add enough detail for us to reply usefully.

We reply within one business day. Mutual NDA available on request before sharing confidential project information.

Inquiry received.

We reply within one business day. If you still need a longer brief or a scheduled call, use the contact page.

Next step

Show us the workflow your desk runs outside the TMS.

Board, spreadsheet, or handoff - we’ll say whether it should be configured, extended, or rebuilt.

Book a free 20-minute fit call→ Send a project brief→

◆We reply within one business day ◆Mutual NDA available on request before sharing confidential project information. ◆No commitment required