# Set up the Xero integration

## Before you begin

* You will need an active Xero account. If you do not have one, create a Xero account first.
* Only one Xero organization can be linked per Caspen workspace.

***

## What syncs

### From Caspen to Xero

**Invoices**

An invoice syncs to Xero when you finalize it or apply a payment to it in Caspen. Draft invoices do not sync.

**Clients (Xero Contacts)**

When an invoice syncs, Caspen checks Xero for a matching customer contact. If a match is found, the invoice is linked to that contact. If no match is found, Caspen creates a new customer contact in Xero.\
\
**How we avoid duplicates with the same name**&#x20;

​Caspen creates unique customer names in Xero using this format:&#x20;

* Full name (Caspen #####)&#x20;

Where ##### is the last 5 digits of the Caspen client ID.\
This reduces the risk of two different people with the same name being merged unintentionally.

**Payments**&#x20;

Payments applied to invoices in Caspen are synced to Xero.

**Discounts**&#x20;

Fixed-amount and percentage discounts on invoice line items are synced to Xero.

**Tax rates**&#x20;

The tax rate on each line (for example, GST or GST free) is synced to Xero automatically. You may need to link your Caspen tax rates to Xero tax rates (see **Check and sync your tax rates** below).

**Credit notes**&#x20;

Credit notes applied to invoice line items in Caspen sync to Xero.

**Totals**&#x20;

Invoice subtotal and tax amount sync to Xero, whether tax is inclusive, exclusive, or no tax.

***

### From Xero to Caspen

Caspen only syncs the Xero actions listed below. Changes made in Xero outside of these actions will not sync back to Caspen (for example, deleting a payment in Xero).

**Invoice updates (payment status)**

When a payment is added or allocated to an invoice in Xero (including during reconciliation), Caspen updates the invoice payment status to match.

**Payments and reconciliation**

* Payments added to an invoice in Xero are synced to the matching invoice in Caspen.
* Payments reconciled against an invoice in Xero are synced to Caspen.
* Bulk payments reconciled across multiple invoices in Xero are synced to the relevant invoices in Caspen.

***

## How to connect Xero with Caspen

1. In Caspen, go to **Settings** → **Integrations**.

<figure><img src="https://3848983471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8mHp6Xvui6hSl3fbco11%2Fuploads%2FbCAUr0XhLpKUa5VbsSZK%2FGroup%20427318366.png?alt=media&#x26;token=d990ad6b-79e1-49ba-9ca1-7bf1ab204e72" alt="" width="563"><figcaption></figcaption></figure>

2. Find **Xero** and toggle it On.

<figure><img src="https://3848983471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8mHp6Xvui6hSl3fbco11%2Fuploads%2FCJ64QFmOcznNE0BOBCCU%2FGroup%20427318406.png?alt=media&#x26;token=231ed93b-fe88-4ba0-9b47-8e94ea82c1d8" alt="" width="563"><figcaption></figcaption></figure>

3. In the "Connect with Xero" pop up, click **Next**.

<figure><img src="https://3848983471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8mHp6Xvui6hSl3fbco11%2Fuploads%2Fd1o1ZwiOJeTLWvYChMrC%2FGroup%20427318407.png?alt=media&#x26;token=fc22a04e-7bb8-436c-8040-dcc60f3baf3c" alt="" width="457"><figcaption></figcaption></figure>

4. You will be redirected to Xero. Sign in to your Xero account.
5. When prompted, select the Xero organization you want to connect, then click **Allow access** to approve the connection.

<figure><img src="https://3848983471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8mHp6Xvui6hSl3fbco11%2Fuploads%2FC97Z6cuiXh2F7o9BqxvV%2FGroup%20427318408.png?alt=media&#x26;token=2e21404c-9cfb-4468-a24b-444efc983205" alt="" width="563"><figcaption></figcaption></figure>

6. You will return to Caspen on the **Xero settings** page.

***

## Configure Xero integration settings

Use Xero settings to select default accounts for invoice items and payments, and review unsynced invoices.

To access these settings:

1. Go to **Settings** → **Integrations**.
2. In the **Xero** tile, select **Settings**.
3. After making any changes, click **Save settings**.

#### Select a default Xero account for invoice items

Choose the default Xero account used for invoice line items. This is commonly an income account such as **Sales** or **Revenue**.

<figure><img src="https://3848983471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8mHp6Xvui6hSl3fbco11%2Fuploads%2F2I030SU4SfPhTYyskXAU%2FGroup%20427318410.png?alt=media&#x26;token=9f56abe6-2734-4c79-9c54-5d1f67e4dad8" alt=""><figcaption></figcaption></figure>

#### Select a default Xero account for payments

Choose the default Xero account Caspen should apply to payments when syncing to Xero. Unless you override it in payment settings, Caspen uses this account for payments, which is usually where funds are received or settled. Commonly, this is a **Bank account** or **Clearing account**.

<figure><img src="https://3848983471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8mHp6Xvui6hSl3fbco11%2Fuploads%2F7cffIklKPK9BOXFS9Qo3%2FGroup%20427318410.png?alt=media&#x26;token=ec265a38-59e7-4361-a514-4961fdefca57" alt=""><figcaption></figcaption></figure>

***

## Check and sync your tax rates

After connecting Xero, make sure your Caspen tax rates are linked to the correct Xero tax rates.

1. Go to **Settings** → **Taxes**.
2. Check the **Xero status** column:

* **Synced** means it is already linked to Xero.
* **Not synced** means it still needs linking.

<figure><img src="https://3848983471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8mHp6Xvui6hSl3fbco11%2Fuploads%2FzKmHIfR6G9ETXN9omKka%2FGroup%20427318411.png?alt=media&#x26;token=9f05b693-ea6e-401b-a80d-aa4754ba39ef" alt=""><figcaption></figcaption></figure>

3. For any **Not synced** tax rate, click **Actions** → **Sync with Xero**, choose the matching **Xero Tax Rate**, then click **Sync**. Note: If the tax rate is missing from the list, add it in Xero first.

***

## What a successful invoice sync looks like

A synced invoice shows **Synced** status and a Xero panel message. Click **Open in Xero** link to view the invoice in Xero.

<figure><img src="https://3848983471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8mHp6Xvui6hSl3fbco11%2Fuploads%2FgZsAOVi9B3Qf69BXyh1o%2FGroup%20427318412.png?alt=media&#x26;token=c71cdec4-1b91-4376-8628-c31e692c0432" alt=""><figcaption></figcaption></figure>

***

## Unsynced invoices

If any invoices fail to sync, they will appear in **Unsynced invoices** in the **Xero settings** page.

<figure><img src="https://3848983471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8mHp6Xvui6hSl3fbco11%2Fuploads%2FB3YNpO5QpPZupmvQEOh1%2Fimage%20890.png?alt=media&#x26;token=c1421be2-cb1d-4317-aa0a-a9b79ac7a76f" alt=""><figcaption></figcaption></figure>

***

**Need help?** Feel free to contact support and we will help you connect Xero and get invoices and payments syncing.
