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

# 🧾 Xero

> Connect Xero accounting data to Margin

Margin connects to Xero using OAuth client credentials.

## 1. What Margin Needs

From your finance/data team:

1. A Xero app with **Client ID** and **Client Secret**
2. Server-side secret storage for those credentials
3. A tenant-scoped connection in Margin (no shared credentials across tenants)

<Note>
  Margin stores provider credentials server-side only. We never store Xero secrets in browser state.
</Note>

## 2. Create the Xero App

1. Log into [Xero My Apps](https://developer.xero.com/app/manage).
2. Click **New app** and create a **Web app**.
3. Fill required app info and set the redirect URI to the callback URL shown in Margin's integration setup.
4. Open the app's **Configuration** tab.
5. Copy the **Client ID** and generate/copy a **Client Secret**.

## 3. Configure the Integration in Margin

Use the Xero connector with:

| Field         | Value                  |
| :------------ | :--------------------- |
| Client ID     | Xero app client ID     |
| Client Secret | Xero app client secret |

Margin then runs a connection test and validates access before enabling syncs.

## 4. Useful References

* [Xero OAuth client credentials docs](https://developer.xero.com/documentation/guides/oauth2/client-credentials)
* [Xero OAuth scopes](https://developer.xero.com/documentation/guides/oauth2/scopes)

## Next Steps

Once Xero is connected, continue to data modelling.

<Card title="📊 Data Modelling" horizontal="true" href="/modelling/overview">
  Align accounting data with your event data for reconciled unit economics
</Card>
