LostChurn Docs
Integrations

Xero Integration

Connect Xero to LostChurn for automatic invoice sync, payment reconciliation, and multi-currency support.

The LostChurn Xero integration keeps your books accurate as payments are recovered. Failed payments create invoices in Xero, successful recoveries record payments, and refunds generate credit notes -- all automatically.

What You Get

After connecting:

  • Invoice creation -- Failed payments automatically create Authorised invoices in Xero with the original payment details.
  • Payment recording -- When LostChurn recovers a charge, a Payment record is created against the matching invoice in Xero.
  • Credit notes -- Refunds processed during recovery create Credit Notes linked to the original invoice.
  • Two-way sync -- If an invoice is paid manually in Xero, LostChurn pauses dunning for that customer.
  • Multi-currency -- Transaction currency is matched to Xero invoice currency. Exchange rates are applied automatically.
  • Revenue reconciliation -- Daily reconciliation job at 02:00 UTC catches any events missed due to temporary connectivity.

Xero is a data sync integration, not a payment processor. LostChurn does not process payments through Xero. It pushes recovery outcomes so your financial records stay current without manual journal entries.

Prerequisites

  • An active Xero account (any plan)
  • Admin or Standard user access to your Xero organization
  • A LostChurn account with at least one workspace created

Connect Your Xero Account

  1. In your LostChurn dashboard, go to Settings > Integrations and click Connect Xero.
  2. You are redirected to Xero's OAuth 2.0 authorization page.
  3. Select the Xero organization you want to connect.
  4. Review the permissions and click Allow Access.
  5. You are redirected back to LostChurn with the connection confirmed.

LostChurn requests these OAuth scopes:

ScopePurpose
accounting.transactionsCreate and update invoices, payments, and credit notes
accounting.contactsRead and create contacts for customer matching
accounting.settingsRead chart of accounts, tax rates, and currencies
offline_accessMaintain connection with refresh tokens (no re-authorization needed)

OAuth tokens are stored securely and refreshed automatically using PKCE. LostChurn never stores your Xero password.

How the Sync Works

Failed Payment -- Invoice Created

When a payment failure is detected:

  1. LostChurn checks if a corresponding invoice exists in Xero.
  2. If not, LostChurn creates a new Authorised Invoice in Xero:
    • Contact: Matched by email or created if new
    • Due date: Set to the original payment date
    • Line items: Reflect subscription or order details from your billing platform
    • Reference: Tagged with LostChurn for easy filtering
  3. If a matching invoice already exists, it is left unchanged.

Recovery Succeeded -- Payment Recorded

When LostChurn recovers a failed payment:

  1. LostChurn finds the matching invoice in Xero by reference number.
  2. A Payment record is created against that invoice, marking it as paid.
  3. The payment is allocated to your configured account (default: Accounts Receivable).
  4. If no matching invoice exists, one is created and the payment is applied immediately.

Refund -- Credit Note Created

When a refund occurs during recovery:

  1. A Credit Note is created in Xero linked to the original invoice.
  2. The credit note reduces the outstanding balance on the invoice.

Xero to LostChurn

The sync works both ways:

DirectionWhat Syncs
LostChurn to XeroInvoices, payments, credit notes, payment allocations
Xero to LostChurnInvoice paid in Xero stops dunning in LostChurn

Two-way sync requires the webhook registered during OAuth. If you disconnect and reconnect, the webhook is re-registered automatically.

Configuration

Account Mapping

Configure account mappings under Settings > Integrations > Xero:

EventDefault Xero AccountCustomizable
Recovered paymentAccounts Receivable (200)Yes
Refund / credit noteAccounts Receivable (200)Yes
Recovery feeRevenue - Other Income (460)Yes

Multi-Currency

LostChurn matches the source payment currency to the Xero invoice currency. If the currency does not exist in your Xero organization, the invoice is created in your base currency with the exchange rate applied.

Tax Rates

LostChurn uses your default Xero tax rate for new invoices. Override this per workspace in your LostChurn integration settings.

Troubleshooting

Connection shows "Disconnected"

  • Xero OAuth tokens expire after 30 minutes. LostChurn refreshes them automatically using the offline_access scope. If refresh fails, click Reconnect in Settings > Integrations > Xero.

Invoices not appearing in Xero

  1. Verify the connection is active (green badge in Settings > Integrations).
  2. Check the sync log for errors. Common issues: missing currency in Xero, contact creation failed.
  3. Confirm your Xero organization has not hit API rate limits (60 per minute, 5,000 per day).

Duplicate invoices

LostChurn uses the recovery ID as the invoice reference to prevent duplicates. If you see duplicates, check whether the same recovery event was processed by multiple LostChurn workspaces.

Multi-organization

Connect each Xero organization to a separate LostChurn workspace. Each requires its own OAuth authorization.

Demo Company

Xero provides a Demo Company for testing. LostChurn fully supports connecting to Demo Companies. Events are labeled as test data.

Next Steps

On this page