Monthly
Count last month's invoices, bills and credit notes
A monthly tally of documents raised in Xero, leaving out voided and deleted ones.
- Runs
- Monthly
- Apps
- Xero
- AI
- Not needed
- Access
- accounting.transactions.read
Send this to your assistant
Create a ClickRuntime automation: on the 1st, email me how many invoices, bills and credit notes were raised in Xero last month, excluding voided and deleted ones.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Accountants and owners sometimes need simple volume figures: how many invoices went out last month, how many bills came in, how many credit notes were issued. Xero does not hand that over in a single click, so someone filters each list by date, subtracts the voided ones and writes numbers on a note, and the figure is slightly different each time.
On the first of each month, the automation counts sales invoices, bills and credit notes dated in the previous month, leaving out voided and deleted documents, and emails you the three totals. The same rules are applied every time so the monthly numbers can be compared fairly.
Practice managers, operations leads and anyone tracking transaction volume for pricing, staffing or audit planning use it most. The count is the same rule applied every month, so the trend you see is real.
What you get out of it
Volumes are counted the same way
Excluding voided and deleted documents each month means the numbers are consistent, so a change from 120 to 150 invoices is a real change and not a counting quirk. Reliable comparisons let you answer questions about growth with facts.
Credit notes get attention
A rising number of credit notes can signal quality or billing problems. Seeing the count each month highlights it before it shows up in your profit figures. Early notice of that trend can lead to a conversation with a supplier or a change in process.
Workload planning gets data
If bills double over a quarter, you can staff bookkeeping accordingly, or decide to move to a different processing method before the backlog arrives. Matching staff time to volume avoids both overwork and idle hours.
Pricing for clients is easier
Bookkeepers who charge by transaction volume have a clear monthly number to base fees on, which keeps invoicing of their own clients straightforward and defensible. Clear numbers also make it easier to justify a fee change to a client.
A tidy record for audits
Having each month's counts in your inbox gives auditors and managers a quick reference without anyone recalculating from Xero history. They save hours when an auditor asks how many documents were processed.
How it works
What happens, step by step
On the 1st of each month ClickRuntime looks at last month in Xero.
It counts the sales invoices, supplier bills and credit notes raised, leaving out anything voided or deleted.
The three counts arrive in your inbox as a short email.
Before it runs live
- Connect Xero
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Xero steps into one automation
Under the hood
The code that runs this automation
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, notify
API = "https://api.xero.com/api.xro/2.0"
def xero_headers():
token = credentials.connection("xero", "work")
tenant = http.get("https://api.xero.com/connections", headers={"Authorization": f"Bearer {token}"}).json()[0]["tenantId"]
return {"Authorization": f"Bearer {token}", "xero-tenant-id": tenant, "Accept": "application/json"}
@on_trigger
def run(event):
end = date.today().replace(day=1) - timedelta(days=1)
start = end.replace(day=1)
where = (f'Date>=DateTime({start.year},{start.month},1) AND Date<=DateTime({end.year},{end.month},{end.day})'
' AND Status!="VOIDED" AND Status!="DELETED"')
headers = xero_headers()
invoices = http.get(f"{API}/Invoices", headers=headers, params={"where": where, "summaryOnly": "true"}).json()["Invoices"]
notes = http.get(f"{API}/CreditNotes", headers=headers, params={"where": where}).json()["CreditNotes"]
counts = {"invoices": sum(i["Type"] == "ACCREC" for i in invoices),
"bills": sum(i["Type"] == "ACCPAY" for i in invoices), "credit notes": len(notes)}
notify.email_me(f"Xero counts for {start:%B %Y}", "\n".join(f"{k}: {v}" for k, v in counts.items()))
return countsFAQ
Common questions
Which date does it use to count an invoice?
Are draft invoices included?
Can it show the value as well as the count?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get overdue invoices in Slack by age
Each morning Slack lists invoices overdue by 7, 14 and 30 days, without repeating ones already flagged at that stage.
See how it worksSee the week's payments every Friday
A Friday email lists the payments Xero recorded this week and their total.
See how it worksGet a Monday list of bills falling due
You start the week knowing which supplier bills need paying in the next seven days.
See how it worksKeep exploring
Set up “Count last month's invoices, bills and credit notes” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.