> ## Documentation Index
> Fetch the complete documentation index at: https://sailia-mintlify-5b02008a.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Xero accounting sync

> Automatically sync your Sailia payouts to Xero as categorized invoices.

Sailia's accounting sync connects your account to [Xero](https://www.xero.com/) and automatically creates invoices for each payout. Every invoice is categorized by VAT rate and account code, marked as paid, and includes a detailed CSV breakdown for reconciliation.

<Note>
  When you enable accounting sync, only payouts created **after** you turn on syncing are sent to Xero automatically. Historical payouts are not back-synced, but you can send individual past payouts manually.
</Note>

## Prerequisites

* An active Xero organization
* A Stripe-connected Sailia account with payouts enabled

## Set up accounting sync

<Steps>
  <Step title="Connect your Xero account">
    Navigate to your accounting settings and select **Connect to Xero**. You are redirected to Xero to authorize Sailia. Once authorized, Sailia automatically creates two clearing accounts in your Xero organization:

    * **Sailia Stripe Clearing Account** — receives Stripe payout payments
    * **Sailia Cash Clearing Account** — receives cash payout payments
  </Step>

  <Step title="Configure accounting categories">
    Set up at least two accounting categories:

    * A **default** category with your standard VAT rate
    * A **no-VAT** category with a 0% rate

    You can create additional categories for other VAT rates. Once a category has been used on a transaction, its rate is locked and cannot be changed.

    <Warning>
      You cannot modify the VAT rate of a category after it has been applied to a basket item. Archive the category and create a new one if you need a different rate.
    </Warning>
  </Step>

  <Step title="Map categories to Xero">
    Map each accounting category to:

    * A **Xero tax type** (e.g. `OUTPUT2` for 20% VAT) — required
    * A **Xero account code** (e.g. a revenue account) — required
    * A **Xero item code** — optional, links the line item to a Xero inventory or service item
    * A **Xero tracking category and option** — optional, tags each line item with a tracking dimension for departmental or project-based reporting in Xero

    <Note>
      When setting a tracking category, you must select both the tracking category **and** the tracking option. You cannot set one without the other.
    </Note>

    You also need to configure two special mappings:

    | Mapping       | Purpose                                                      |
    | ------------- | ------------------------------------------------------------ |
    | **Gift card** | The Xero account code for gift card redemptions              |
    | **Fee**       | The Xero account code for processing fees (e.g. Stripe fees) |

    The special mappings also support optional item codes and tracking categories.

    The setup status indicator shows whether all required mappings are complete.
  </Step>

  <Step title="Assign categories to products">
    Assign accounting categories to your products — activities, shop products, membership plans, activity passes, and add-ons. This determines how each sale is categorized on the Xero invoice.

    Add-ons have their own accounting category, separate from the activities they are linked to. Assign each add-on a category that reflects its own VAT treatment so equipment hire, photography, meal upgrades, and similar extras are reported under the correct account code rather than inheriting the parent activity's category.

    If you change category assignments after baskets have been created, use the **Recalculate** action to re-apply categories to any basket items that have not yet been synced.
  </Step>

  <Step title="Enable sync">
    Toggle **Sync to Xero** on. Sailia records the current timestamp and only syncs payouts created from this point forward.

    <Info>
      If you disable and re-enable sync, the timestamp resets. Only payouts created after re-enabling are automatically synced.
    </Info>
  </Step>
</Steps>

## How sync works

Once enabled, a scheduled process handles automatic syncing:

1. **Finds new payouts** — picks up all paid payouts created after you enabled syncing that have not yet been sent to Xero.
2. **Creates an invoice for charges** — sales, gift card redemptions, and fees become a single authorized invoice with line items grouped by accounting category.
3. **Creates a credit note for refunds** — refunds in the same payout are posted as a separate credit note so charges and refunds can be independently reconciled.
4. **Marks both as paid** — a payment is recorded against the appropriate clearing account (Stripe or cash) for each document.
5. **Attaches a CSV breakdown** — a detailed product-level breakdown is attached to each invoice for auditing.

If you configured item codes or tracking categories on your mappings, each invoice and credit note line item carries the corresponding Xero item code and tracking dimension.

<Info>
  If a payout has a negative net total (refunds exceed charges), Sailia creates an accounts payable bill in Xero instead of a receivable invoice.
</Info>

## Send a historical payout manually

To sync a payout that was created before you enabled accounting sync, locate the payout in your finances section and select **Send to Xero**. This sends the individual payout regardless of when it was created.

## Disconnect Xero

To disconnect your Xero integration, go to your accounting settings and select **Disconnect**. This revokes the OAuth connection on both Sailia and Xero. Invoices already created in Xero are not affected.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Setup status shows incomplete">
    Verify that every accounting category has both a Xero tax type and a Xero account code mapped. Check that the special gift card and fee mappings are also configured.
  </Accordion>

  <Accordion title="Payouts are not appearing in Xero">
    Confirm that:

    * **Sync to Xero** is toggled on
    * The payout was created **after** you enabled syncing
    * The payout status is **paid**
    * Your Xero connection is active (check the accounting settings page)
  </Accordion>

  <Accordion title="Xero connection expired">
    Sailia automatically refreshes your Xero OAuth tokens. If the connection expires (for example, after extended downtime), reconnect by selecting **Connect to Xero** again in your accounting settings.
  </Accordion>
</AccordionGroup>

## Related guides

<Columns cols={2}>
  <Card title="Financial reporting" icon="chart-line" href="/payments/reporting">
    View payouts and export financial data.
  </Card>

  <Card title="Gift cards" icon="gift" href="/pricing/gift-cards">
    How gift card redemptions are mapped in Xero.
  </Card>
</Columns>
