Quick overview
This workflow runs on manual execution to count Xero Accounting records: sales invoices, bills, and sales/bill credit notes; with an optional filter to exclude VOIDED and DELETED statuses, returning a simple tally per record type.
How it works
- Starts when you manually execute the workflow in n8n.
- Sets an option that controls whether VOIDED and DELETED records are included in the counts.
- Calls Xero’s Connections endpoint to retrieve the tenant ID(s) used to authenticate subsequent Accounting API requests.
- Queries the Xero Accounting API for sales invoices (ACCREC) and bills (ACCPAY), paging through results and counting returned invoice records.
- Queries the Xero Accounting API for sales credit notes (ACCRECCREDIT) and bill credit notes (ACCPAYCREDIT), paging through results and counting returned credit note records.
- Combines the four tallies into a single output list of
{ type, count } results.
Setup
- Create and select a Xero OAuth2 credential in n8n with access to the target Xero organisation(s).
- If your Xero credential can access multiple tenants, adjust the workflow to target a single tenant if you need per-organisation counts.
- Set
includeVoidedDeleted to true if you want to include VOIDED and DELETED records; otherwise leave it false to exclude them.
Requirements
- Xero OAuth2 credential in n8n