> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chartcastr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Xero accounting source

> Connect Xero to Chartcastr for automated profit and loss, cash flow, accounts receivable, and payable charts. Setup and configuration guide.

<Warning>
  **Early Access** — Xero integration is currently in early access. [Contact us](mailto:support@chartcastr.com) or [sign up](https://chartcastr.com/sign-up) to request access.
</Warning>

<Info>
  **Paid Feature** — Xero is available on all paid plans (Starter, Pro, Enterprise). [See pricing](https://chartcastr.com/pricing).
</Info>

<Warning>
  **Two-factor authentication required** — Xero requires 2FA on every account that connects to it. If your Chartcastr account doesn't have 2FA enabled, you'll be redirected to enable it before the OAuth flow can complete. See [Two-Factor Authentication](#two-factor-authentication) below.
</Warning>

## Overview

Use Xero as a data source for Chartcastr. Connect your Xero organisation via OAuth and Chartcastr will pull financial metrics directly from your accounting reports — P\&L, cash flow, aged receivables, and aged payables — and deliver them as automated charts to Slack or email.

Chartcastr connects with **read-only** access to your Xero organisation. No write permissions are requested.

## Setup

<Steps>
  <Step title="Enable two-factor authentication">
    Xero requires 2FA on every connected account. If you haven't already enabled 2FA on your Chartcastr account, you'll be redirected to a setup page when you start the connection — scan the QR code with an authenticator app (1Password, Authy, Google Authenticator, etc.) and complete the verification before continuing.
  </Step>

  <Step title="Connect your Xero organisation">
    In Chartcastr, go to [Sources](https://chartcastr.com/admin/sources) and select **Xero**. Click **Connect** and complete the OAuth flow. You will be asked to authorise read-only access to accounting reports and contacts.
  </Step>

  <Step title="Select a metric">
    Choose which financial metric you want to track. Each metric becomes its own pulse source — you can add multiple to send different charts on different schedules. See [Available Charts](/integrations/sources/xero/available-charts) for the full list.
  </Step>

  <Step title="Create a connection">
    Go to [Connections](https://chartcastr.com/admin/connections) → **New Connection**. Select your Xero source, pick or add a destination (Slack channel or email), set the delivery frequency, and optionally enable AI summaries. Most teams send P\&L metrics weekly and cash/receivables metrics daily or on a Monday morning.
  </Step>
</Steps>

## Available Charts

Chartcastr supports **11 pre-built Xero metrics** across four categories, each backed by a specific Xero report endpoint.

<CardGroup cols={2}>
  <Card title="Profitability" icon="chart-line">
    Revenue, gross profit, net profit, and revenue vs expenses — all from your Profit & Loss report.
  </Card>

  <Card title="Expenses" icon="receipt">
    Operating expense breakdown by account category from your P\&L.
  </Card>

  <Card title="Cash & Banking" icon="building-columns">
    Cash position (closing balances) and cash in vs out across all bank accounts.
  </Card>

  <Card title="Receivables & Payables" icon="clock">
    Aged receivables and aged payables — outstanding invoices and bills bucketed by overdue days.
  </Card>
</CardGroup>

<Card title="View all available charts" icon="chart-bar" href="/integrations/sources/xero/available-charts">
  See the full list of Xero metrics with chart types, descriptions, and AI context hints.
</Card>

## Data & Permissions

Chartcastr requests the following Xero OAuth scopes:

| Scope                      | Purpose                                       |
| -------------------------- | --------------------------------------------- |
| `accounting.reports.read`  | P\&L, Bank Summary, Aged Receivables/Payables |
| `accounting.settings.read` | Organisation currency and settings            |
| `accounting.contacts.read` | Contact data for Streams (real-time events)   |

No write access is requested. Chartcastr cannot create, modify, or delete any data in your Xero organisation.

## Two-Factor Authentication

Xero's API terms require two-factor authentication on every account that connects to a Xero organisation. Chartcastr enforces this before any Xero OAuth flow begins.

**How it works:**

* When you click **Connect** on the Xero source, Chartcastr checks whether your account has 2FA enabled (via Clerk).
* If 2FA is **not** enabled, you're redirected to `/admin/security/mfa-required` where you can set up an authenticator app inline. Once 2FA is active, you'll be sent back to finish the Xero OAuth flow automatically.
* If 2FA is already enabled, the OAuth flow proceeds normally and this step is invisible.

**Setting up 2FA:**

1. On the MFA-required page, scan the QR code with any TOTP authenticator app (1Password, Authy, Google Authenticator, Microsoft Authenticator).
2. Enter the 6-digit code to verify.
3. Save your backup codes somewhere safe — you'll need one if you lose access to your authenticator.

You can also enable 2FA proactively at any time from your [Account Security](https://chartcastr.com/admin/security) page.

<Note>
  This requirement only applies to Xero. Other sources do not require 2FA, but enabling it is strongly recommended for all production accounts.
</Note>

## Token Refresh

Xero access tokens expire after 30 minutes and refresh tokens expire after **60 days of inactivity**. Chartcastr handles token refresh automatically:

* Tokens are refreshed on-demand when a chart runs
* A background job proactively refreshes tokens that are approaching 60 days without activity
* You will receive an email warning if your token is at risk of expiring

If your integration shows as **Disconnected**, re-authorise by going to [Sources](https://chartcastr.com/admin/sources) → **Xero** and clicking **Reconnect**.

## Real-Time Events with Streams

In addition to scheduled charts, Xero also supports [Streams](/streams/xero) — real-time webhook events forwarded to Slack the instant they happen. New invoices, contact changes, and credit notes can be routed to any Slack channel without polling.

<Card title="Xero Streams" icon="bolt" href="/streams/xero">
  Forward Xero invoice, contact, and credit note events to Slack in real-time.
</Card>

## Next Steps

<CardGroup cols={2}>
  <Card title="Slack destination" icon="slack" href="/integrations/destinations/slack">
    Deliver Xero charts to your Slack channels with AI summaries in the thread.
  </Card>

  <Card title="Email destination" icon="envelope" href="/integrations/destinations/email">
    Schedule Xero reports to any inbox or distribution list.
  </Card>
</CardGroup>
