How the Sync Works

Updated 20 Sept 2026

TwoCanConnect runs entirely inside your Salesforce org. There's no middleware and no external service holding your data — the sync is scheduled Apex talking directly to the Xero API.

Direction is set per Xero organisation, and applies to every object you've enabled.

The ongoing sync

Once started, the sync runs on a schedule. Each run looks for records that changed since the last one and moves only those — it isn't a full comparison every time, which is what keeps it quick even on large orgs.

Frequency is set under Organization Wide Settings → Default Settings and applies to every connected Xero organisation — you can't run one organisation on a tighter interval than another.

A change to the interval takes effect from the next sync cycle. To apply a shorter interval immediately, restart the ongoing sync. See Organisation-wide settings.

Sending one record now

The record-level Send To Xero button pushes a single invoice, quote, purchase order or contact straight away, using the same mapping and settings as the scheduled run. It's the right choice when someone needs a document in Xero now rather than within the hour. It complements the schedule rather than replacing it. See Send To Xero and Resync.

What a run does

  1. Collects records changed since the last successful run
  2. Applies your field mappings
  3. Sends them to Xero, and reads back anything changed there if you're on Two Way
  4. Records the result in Sync History
Records Synced counts both directions

The number in Sync History is the total processed in that run, not just those pushed to Xero.

Not everything runs every cycle

Repeating invoices are pulled once a day, not on every cycle. Xero's endpoint for them ignores "modified since" and returns the whole list each time, so pulling it every cycle would burn API calls for no benefit.

Contact linking happens once, at the end of a cycle. Documents whose Xero contact isn't in Salesforce yet are linked in a single sweep, fetching only the contacts actually missing. One consequence worth knowing: an invoice edited in Salesforce whose contact isn't linked yet pushes to Xero one cycle later than it used to.

Rate limits are per organisation

If Xero throttles one of your Xero organisations, the others keep syncing. A single busy organisation no longer holds up the rest.

When a run fails

A failed run doesn't stop the schedule — the next run tries again. Records that failed stay flagged until they succeed, so a transient Xero outage resolves itself without intervention.

The exception is a broken Xero connection. If Xero refuses to renew the access token, the sync pauses after an hour rather than failing every cycle, the Connection Status card reads Reconnect needed, and a banner on Configuration links to the fix. See Reconnecting an expired Xero connection.

Persistent failures need attention: see Why a sync failed and how to retry it.

Bulk imports

Loading thousands of records into Salesforce with the sync running means each one is processed individually. Pause the sync, load, then resume — see Turning the sync on and off.