# Sync With Xero

Source: https://docs.astalty.com.au/guide/integrations/xero-integration/sync-payments-with-xero

> Manually queue invoice batch sync or pull Xero payments into Astalty.

## Overview

The finalised invoice batch has two separate actions:

- **Sync with accounting** sends eligible invoices to the currently selected accounting platform.
- **Sync payments** reads payments from that platform after the batch has synced.

Use these actions after repairing a connection, when automatic invoice sync is off, or when an expected payment has not appeared.

## Sync your Invoice Batches with Xero

1. Open [Invoice Batches](https://app.astalty.com.au/finance/invoice-batches) and select the finalised batch.
2. Select **Actions > Sync with accounting**.
3. Confirm the sync. The confirmation also states how many pending invoice comments will be added as Xero history notes when comment sync is enabled.

The action appears when the connected accounting platform is configured and the batch state is new, pending, or failed. It does not appear while a sync is queued. It can reappear after a batch is marked as synced when Astalty has confirmed that the platform no longer has one of the batch's current invoices. Astalty sends invoices that have no accounting identifier or have been confirmed missing, so retrying a failed batch does not duplicate invoices that succeeded earlier.

The sync runs in the background. The batch moves through queued processing and is marked synced or failed. A connection or platform problem can fail the whole batch. If Xero rejects one invoice, Astalty records the error on that invoice and continues with the others, so the batch can be marked synced with an invoice that still needs attention.

Open an invoice with an error to read Xero's reason. Fix the account mapping, invoice detail, or other issue it names. A successful Xero connection or **Refresh Connection** automatically queues batches that are marked **Failed**. If the connection did not need refreshing, or the batch remains failed after that retry, use **Actions > Sync with accounting** again. Astalty does not duplicate the invoices that succeeded earlier.

If the batch is marked **Synced** but one invoice still has an error, the batch action is not offered for that error alone. Contact Astalty Support if the corrected invoice needs to be queued again.

When Xero's security filter refuses a request, Astalty separates the invoices and retries each one. It also retries a refused invoice once with brackets removed from its Xero reference. If the second attempt still fails, only that invoice keeps the sync error.

![An invoice batch page with the Actions menu open and Sync with accounting highlighted, below Add Comment, above the batch's Total, Paid and Outstanding amounts and its list of invoices.](https://docs.astalty.com.au/assets/ib1.png)

## Sync Payments Within Batch

1. Open the synced batch from [Invoice Batches](https://app.astalty.com.au/finance/invoice-batches).
2. Select **Actions > Sync payments**.

![An invoice batch page with the Actions button highlighted and an arrow pointing to it at the top right, beside Generate Bulk Upload, above the batch's Total, Paid and Outstanding amounts and its list of invoices.](https://docs.astalty.com.au/assets/ib2.png)

![An invoice batch page with the Actions menu open and an arrow pointing to Sync payments, below Add Comment, above the batch's Total, Paid and Outstanding amounts and its list of invoices.](https://docs.astalty.com.au/assets/ib3.png)

Astalty confirms that payments will be synced shortly and suggests checking again in 5-10 minutes. The action queues a pull for the batch's non-NDIA invoices. A payment is created only when the invoice and Xero payment are linked and Astalty still has an outstanding amount to allocate.

**Sync payments** appears only after the batch has synced, while the batch is outstanding and contains a non-NDIA invoice. It does not send an Astalty payment to Xero.

> **This is the manual fallback**
>
> You should not normally need this action. Xero invoice update webhooks trigger the standard payment pull. See [Reconciling Payments in Xero](https://docs.astalty.com.au/guide/integrations/xero-integration/reconciling-payments-in-xero) for eligibility and troubleshooting.

## Video Walkthrough

Video walkthrough: sync xero payments.
