# Xero

![Logo_-_Blue_-cropped.png](https://assets.relyanceuat.xyz/images/docs/7761984025741/7762966775053.png)
Xero is a cloud-based accounting software product that lets business owners manage their bookkeeping functions like invoicing and payroll. It also connects to banks, accountants, bookkeepers, and other business apps.

In order to integrate Xero with Relyance AI you will need a Client ID and Client Secret

.

#### In Xero:

1. Login to your Xero account.
2. Go here: [https://developer.xero.com/app/manage](https://developer.xero.com/app/manage)
3. Click the **New app** button.
4. Fill in the following form with these values: **App name:** A relevant name **Integration type:** Web app **Company or application URL:** Your main website **Redirect URI:**[https://root.relyance.ai/api/oauth2](https://root.relyance.ai/api/oauth2) Make sure you also check the **Terms and Conditions** checkbox.
5. Click **Create app**.
6. This will bring up the newly created app details. On the left hand side select the **Configuration** tab.
7. On this page, click **Generate a secret**.  You will not be able to access the Client Secret again after you leave this screen.
8. Copy the **Client ID** and **Client Secret** to be used in Relyance AI.

![Xero-4.png](https://assets.relyanceuat.xyz/images/docs/7761984025741/7762398483725.png)

![Xero-5.png](https://assets.relyanceuat.xyz/images/docs/7761984025741/7762398481293.png)

#### In the Relyance AI application:

1. Login to your Relyance account.
2. Navigate to the **Settings** Menu in the bottom left-hand side.
3. Select **Integrations**.
4. Click on the **Vendor Integration** tab.
5. Find the **Xero** integration card and click it to open its connections.
6. Under **Authentication Method**, choose **Oauth2 / App Token**.
8. Click the **Process DSRs** checkbox if processing DSRs.
9. Paste the **Client ID** and **Client Secret** into their respective fields.

![Xero-DSR-1.png](https://assets.relyanceuat.xyz/images/docs/7761984025741/13957069820685.png)

10. Click **Authenticate**.
11. This will bring up a bring you to the Xero site to allow permissions to Relyance AI.

![Xero-3.png](https://assets.relyanceuat.xyz/images/docs/7761984025741/7762338322445.png)

12. Click the **Allow access** button to grant permissions.
13. At this point, you should see the following result on the **Vendor** Integrations page:

![Xero-2.png](https://assets.relyanceuat.xyz/images/docs/7761984025741/7761966485517.png)

14. Congratulations, you are now connected to **Xero**.

<!-- failure-modes:begin (generated from the integration catalog; do not hand-edit) -->

## If the connection reports Connected but returns nothing

These are the ways this integration comes back empty without reporting an error. Generated from the integration catalog, so it tracks what the connection actually asks for.

1. **A feature you enabled returns nothing.** Some scopes belong to a feature rather than to the connection: **Data subject requests** needs `accounting.contacts.read`. Turning the feature on after the connection exists does not widen the grant it already holds, so re-authenticate the connection.
2. **Authorised, then empty.** The connection carries an authorisation, not a password: it stops returning data if the account that granted it loses access, its own permissions narrow, or the grant is revoked at the vendor. None of that reports an error here -- the connection keeps its last status until the next scan.
3. **A credential rotated at the vendor is not picked up here.** **Client Secret** is stored when you save the connection, so regenerating the value at the vendor breaks the next scan until it is re-pasted here. Recording the expiry on the connection means Relyance warns you before it lapses.

<!-- failure-modes:end -->

<!-- terraform-examples:begin (generated from the integration catalog; do not hand-edit) -->

## Manage this integration with Terraform

Connections for this integration can be managed as code with the [Relyance Terraform provider](https://registry.terraform.io/providers/Relyance/relyance/latest). Non-secret fields go in `auth.params`; secret fields go in `auth.secrets_wo`, which is write-only — never stored in Terraform state. Rotate secrets by bumping `auth.secrets_wo_version`.

The **OAuth (browser authorization)** method uses a browser authorization flow, so the connection is created in the Relyance app. Manage it in Terraform afterwards by importing it (`terraform import relyance_integration_connection.example xero/<connection_id>`) or reading it with the `relyance_integration_connection` data source.

<!-- terraform-examples:end -->
