# Xero

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

> Connect Xero, configure invoicing or payroll, send reviewed work, and check the results in Astalty and Xero.

Use the [Xero integration](https://app.astalty.com.au/settings/integrations/xero) to send invoices to Xero, bring their payments back into Astalty, and send Scheduling timesheets to Xero Payroll AU. Accounting and payroll share a connection, but each needs its own setup.

## Data Flow

| Information                                      | Direction       | What You Do                                                                                               |
| ------------------------------------------------ | --------------- | --------------------------------------------------------------------------------------------------------- |
| Invoices                                         | Astalty to Xero | Finalise an invoice batch, then check its accounting sync result.                                         |
| Payments on linked plan or self managed invoices | Xero to Astalty | Reconcile in Xero, then check the payment allocation in Astalty. NDIA payments follow a separate process. |
| Invoice comments                                 | Astalty to Xero | Enable comment sync if you want individual invoice comments copied to Xero history notes.                 |
| Accounts and tracking categories                 | Xero to Astalty | Choose the Xero accounts and tracking options to use for invoice lines.                                   |
| Payroll employees, Pay Items and calendars       | Xero to Astalty | Link employees and map payroll settings before sending timesheets.                                        |
| Timesheet hours and allowances                   | Astalty to Xero | Review a timesheet batch, validate it, and export draft timesheets. Finish payroll in Xero.               |
| Approved leave                                   | Astalty to Xero | Enable leave sync and map leave types, then check each request's payroll result.                          |

Invoice sync can create the Xero contact needed for an invoice. It is not a two-way address-book sync for Participants or Plan Managers.

## What can it do?

### Syncing Invoices

With **Sync invoices automatically** enabled, finalising an invoice batch queues eligible invoices for Xero. Turn the setting off if you want to start the sync manually from the finalised batch. NDIA invoices are excluded unless **Send NDIA invoices** is enabled.

### Syncing Payments

When Xero reports a payment on a linked plan or self managed invoice, Astalty creates the matching payment allocation. Payments flow from Xero to Astalty only. NDIA invoices are always excluded from this payment flow. Learn more in [Reconciling Payments in Xero](https://docs.astalty.com.au/guide/integrations/xero-integration/reconciling-payments-in-xero).

### Syncing Invoice Comments

Optionally, comments on individual invoices can be pushed to Xero as history notes. Invoice batch comments stay in Astalty. Learn how to turn this on in [Syncing Invoice Comments to Xero](https://docs.astalty.com.au/guide/integrations/xero-integration/syncing-invoice-comments-to-xero).

### Sending Payroll Timesheets

Choose **Xero** as your Scheduling payroll platform, link employees, and map Pay Items and payroll calendars. After reviewing a batch, validate and send it to create draft timesheets in Xero. Sending hours does not complete the pay run. Follow [Xero Payroll Integration for Scheduling](https://docs.astalty.com.au/guide/xero-payroll-integration-for-scheduling) for setup and [Process Timesheet Batches](https://docs.astalty.com.au/guide/process-timesheet-batches-for-xero-payroll-integration) for each pay period.

### Syncing Leave

Leave uses a separate setting and result from timesheet exports. With **Sync leave automatically** enabled, eligible approved requests are sent to Xero. An older connection may need to be refreshed before it can send leave, even when timesheets still work. See [Xero Leave Sync](https://docs.astalty.com.au/guide/scheduling/leave#xero-leave-sync).

## Connecting and disconnecting your Xero account

Start with [Connecting and Disconnecting Xero](https://docs.astalty.com.au/guide/integrations/xero-integration/connecting-and-disconnecting). Choose the correct Xero organisation and grant the requested access. Astalty connects to one accounting platform at a time.

## Configuring the integration

For invoicing, set the default sales account, invoice status, automatic sync, and any Charge Item or tracking mappings in [Configuring the Xero Integration](https://docs.astalty.com.au/guide/integrations/xero-integration/configuring-the-integration).

For payroll, complete the [payroll setup guides](https://docs.astalty.com.au/guide/xero-payroll-integration-for-scheduling#getting-setup). Connecting Xero for invoices alone does not configure employee links or pay mappings.

## Integration Flow

Once the integration is connected and configured, the normal plan or self managed flow is:

1. You finalise an Invoice Batch in Astalty.
2. Astalty queues any enabled automatic email delivery and Xero sync as separate background work.
3. The invoice is created in Xero automatically, or after you choose **Actions > Sync with accounting** if automatic sync is off.
4. If the invoice was created as **Draft** or **Awaiting Approval**, approve it in Xero. If **New Invoice Status** is **Approved**, it is created in the approved state.
5. The recipient pays into your bank account.
6. You reconcile the invoice in Xero.
7. The payment is created back in Astalty automatically.

> **Don't send the invoice again from Xero**
>
> If Astalty sent the invoice, sending it again from Xero can give the recipient a duplicate. Check the invoice delivery status in Astalty before emailing from Xero.

### Why invoices are sent from Astalty

Astalty can email the invoice while Xero holds the accounting copy used for reconciliation. The email and Xero sync are separate background actions, so do not rely on one completing before the other.

- **You can see whether it arrived.** Astalty records a delivery status against every recipient on the invoice, so a failed or bounced invoice shows up instead of going unnoticed. See [Invoices](https://docs.astalty.com.au/guide/finance/invoicing/invoices) for how to read it.
- **The configured recipients get the Astalty copy.** Recipient rules depend on the invoice management type and your [Invoice Settings](https://docs.astalty.com.au/guide/settings/invoices-settings). NDIA managed invoices are not emailed.

Payment reconciliation is separate from invoice email delivery. The invoice must have a Xero identifier, and Astalty must still have room to allocate a new payment. NDIA managed invoices never take payments from Xero. See [Reconciling Payments in Xero](https://docs.astalty.com.au/guide/integrations/xero-integration/reconciling-payments-in-xero).

If you would rather send invoices yourself, turn off automatic sending first so Astalty does not email them as well. See [Turning off automatic invoice sending](https://docs.astalty.com.au/guide/finance/invoicing/invoice-batches/turning-off-automatic-invoice-sending).

## Checking Results And Fixing Problems

| Where You Are Working | What To Check                                                                                                          | Where To Continue                                                                                                                      |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Xero connection       | Confirm the connected organisation and resolve any connection or setup warning.                                        | [Refresh the connection](https://docs.astalty.com.au/guide/integrations/xero-integration/resetting-your-xero-connection).              |
| Invoice batch         | Check the accounting sync result and any invoice errors. Email delivery has its own status.                            | [Sync invoices and payments](https://docs.astalty.com.au/guide/integrations/xero-integration/sync-payments-with-xero).                 |
| Timesheet batch       | Check the result for every worker. A partially failed export can leave some workers sent and others needing attention. | [Validate, export and re-export timesheets](https://docs.astalty.com.au/guide/process-timesheet-batches-for-xero-payroll-integration). |
| Leave request         | Check the payroll sync status after approval.                                                                          | [Resolve leave sync results](https://docs.astalty.com.au/guide/scheduling/leave#xero-leave-sync).                                      |

## Video Walkthrough

This earlier recording covers Xero invoice mapping. Use the written steps above for the current workflow and labels.

Video walkthrough: xero mapping products services.
