# Reconciling Payments in Xero

Source: https://docs.astalty.com.au/guide/integrations/xero-integration/reconciling-payments-in-xero

> Reconcile a plan or self managed payment in Xero and have it come back to Astalty automatically.

## Overview

Once an invoice has reached Xero, **Xero is where you record the payment**. Reconcile it there and Astalty reads the Xero invoice update, then creates the matching payment allocation against the same invoice.

This is the flow for **plan managed** and **self managed** invoices. NDIA managed invoices work differently. See [NDIA Managed Invoices](#ndia-managed-invoices).

> **Record the payment in one place, not both**
>
> Payments travel **from** Xero **to** Astalty only. If you use **Mark as Paid** in Astalty and then reconcile the same invoice in Xero, Astalty does not create another payment once the invoice has no amount outstanding.
>
> Pick one place per invoice. If you're connected to Xero, reconcile there and let Astalty follow.

## Before You Start

Three things have to be true before a payment recorded in Xero can find its way back:

1. **The invoice batch has synced to Xero.** Astalty matches on the Xero invoice identifier. With **Sync invoices automatically** on, finalising the batch queues the sync. If it is off, use **Actions > Sync with accounting** on the finalised batch. See [Sync With Xero](https://docs.astalty.com.au/guide/integrations/xero-integration/sync-payments-with-xero).
2. **The invoice can accept a payment in Xero.** Xero does not let you record a payment against a draft invoice. **New Invoice Status** defaults to **Draft**; the other choices are **Awaiting Approval** and **Approved**. Complete the required approval in Xero first.
3. **The invoice still has an amount outstanding in Astalty.** A payment already recorded manually in Astalty leaves nothing for the Xero payment to fill.

> **Check the batch for Xero errors first**
>
> If an invoice has a sync error, the batch's invoice list shows a red **sync error** count. A total mismatch can occur when the Xero invoice amount no longer matches Astalty.
>
> An invoice in that state will **never** reconcile automatically, no matter how many times you sync. Fix the mismatch first.

## Reconciling the Payment in Xero

Reconcile in Xero using the workflow approved by your organisation. Astalty reads payment records attached to the linked Xero invoice, including payments created through:

- **Bank reconciliation** - match the deposit in your bank feed to the invoice.
- **Batch payment** - the usual case for a Plan Manager paying several invoices in one deposit.
- **Add a payment** directly on the invoice in Xero.

The Xero invoice update normally triggers the payment pull automatically. The manual sync action is available as a fallback.

## What Happens in Astalty

Astalty processes the Xero invoice update in the background. When the pull succeeds, the payment carries:

| On the payment          | What it shows                                                      |
| ----------------------- | ------------------------------------------------------------------ |
| **Source**              | A **Xero** chip, so you can tell it apart from a manual payment    |
| **Type**                | **Plan** or **Self**, taken from the invoice                       |
| **Amount** and **Date** | The values returned by Xero when Astalty first creates the payment |
| **Reference**           | The reference on the Xero payment                                  |
| **Allocation**          | The full payment amount, allocated to that invoice                 |

Astalty applies the payment to the invoice, reducing its outstanding amount. When the payment clears the remaining balance, the invoice status becomes **Paid**. The invoice batch's **Outstanding** total refreshes to match.

> **Jumping between the two systems**
>
> Open the payment or invoice in Astalty and use **View in Xero** to open the matching Xero record.

## Plan Managed and Self Managed

The reconciliation itself is identical for both. The only differences are who the invoice is addressed to in Xero, and how the resulting payment is labelled in Astalty.

|                             | Plan managed                                                                                                               | Self managed    |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------- | --------------- |
| Xero contact on the invoice | The Plan Manager, or the Participant if you've changed **Who should we use to create invoices for Plan Managed invoices?** | The Participant |
| Payment **Type** in Astalty | Plan                                                                                                                       | Self            |
| Plan Manager on the payment | Set                                                                                                                        | Not set         |

Everything else, including approval and payment reconciliation, is the same.

## Partial Payments

A part payment is handled the same way as a full payment. Astalty creates a payment for each distinct Xero payment record and reduces the invoice's outstanding balance by that amount. Until the balance is cleared, the invoice remains **Awaiting Payment** before its due date and becomes **Overdue** after the due date. Once the balance reaches zero, it becomes **Paid**.

> **A Plan Manager short-paying an invoice**
>
> If a Plan Manager pays less than the invoice and you do not intend to chase the rest, reconcile what they paid in Xero, then clear the shortfall in Astalty. See [Writing Off an Unpaid Balance](https://docs.astalty.com.au/guide/finance/payments/writing-off-an-unpaid-balance). Do not use **Mark as Paid** on an invoice that is already partially paid.

## Payments From Xero Are Managed in Xero

Once a payment has come across, Xero owns it. In Astalty, a payment with a **Xero** source can't be edited, can't have its allocations cleared, and can't have documents attached. Trying to delete it gives you a **Cannot Delete Payment** message:

> This payment has been synced with your accounting platform and cannot be deleted. Please delete it there first.

To remove a Xero sourced payment from Astalty, delete it in Xero and sync the invoice again. Astalty removes the stale Xero allocation and recalculates the invoice and batch totals. Manual payments are left alone.

Changing the amount, date, or reference on the same Xero payment does **not** update the existing Astalty payment. If those values need to change in Astalty, delete the payment in Xero, create the corrected Xero payment, and let Astalty sync again.

> **Deleting in Xero deletes it here**
>
> A payment deleted in Xero is removed from Astalty on the next successful pull. Recreate it in Xero if it was deleted by mistake.

## If the Payment Hasn't Appeared

Check the [three conditions above](#before-you-start), the batch sync state, and any sync errors first.

If everything looks right and the payment still hasn't come through, you can ask Astalty to go and check:

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

![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 with *Payments will be synced shortly. Please check back in 5 - 10 minutes.* Return to the batch after processing and check the result. The message is a wait suggestion, not a guarantee that an ineligible or mismatched payment will be created.

> **When Sync payments isn't in the menu**
>
> The option appears when the batch has finished syncing to the connected accounting platform, includes at least one non-NDIA invoice, and still has an amount outstanding. If the batch is pending or failed, use **Sync with accounting** first.

## What Doesn't Come Back From Xero

Only payments are read from Xero. In particular:

- **Credit notes and write-offs applied in Xero** do not reduce the outstanding amount in Astalty. Handle the balance in Astalty as well. See [Writing Off an Unpaid Balance](https://docs.astalty.com.au/guide/finance/payments/writing-off-an-unpaid-balance).
- **Changes to the invoice amount in Xero** don't flow back, and editing an invoice in Xero after it has synced is what produces the total mismatch error described above.
- **Invoices imported into Xero from a CSV export** aren't linked to Astalty at all, so they never reconcile. This flow only works for invoices Astalty created in Xero through the integration.

## NDIA Managed Invoices

NDIA managed invoices are deliberately kept out of this flow. **Astalty never brings a Xero payment back onto an NDIA managed invoice**, because it reconciles NDIA claims line by line from the receipt file instead. That exclusion always applies - it isn't something you can switch on.

Whether the invoices themselves reach Xero is controlled separately by **Send NDIA invoices**. It is off by default and Astalty recommends leaving it off. See [Send NDIA Invoices](https://docs.astalty.com.au/guide/integrations/xero-integration/configuring-the-integration#send-ndia-invoices).

Either way, reconcile the payment itself in Astalty using [Reconciling NDIA Payments](https://docs.astalty.com.au/guide/finance/payments/reconciling-ndia). What you do on the Xero side depends on that setting:

- **Setting off (the default)** - the NDIA invoices do not reach Xero, so record the total the NDIA paid as a single [Receive Money](https://central.xero.com/s/article/Add-a-receive-money-transaction) transaction.
- **Setting on** - reconcile the NDIA deposit against the Xero invoices there. Do not also add a Receive Money transaction. Xero reconciliation still does not create the NDIA payment in Astalty.

## Video Walkthrough

Video walkthrough: reconcile payments in xero.

## Related Guides

- [Sync With Xero](https://docs.astalty.com.au/guide/integrations/xero-integration/sync-payments-with-xero) - manually syncing a batch or its payments.
- [Configuring the Integration](https://docs.astalty.com.au/guide/integrations/xero-integration/configuring-the-integration) - the **New Invoice Status** and plan managed contact settings.
- [Plan and Self Managed Payments](https://docs.astalty.com.au/guide/finance/payments/plan-and-self-managed) - recording a payment manually when you are not using Xero.
- [Reconciling NDIA Payments](https://docs.astalty.com.au/guide/finance/payments/reconciling-ndia) - the separate NDIA process.
- [Deleting Payments](https://docs.astalty.com.au/guide/finance/payments/deleting) - removing a payment recorded in Astalty.
