Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. On the 1st of each month ClickRuntime looks at last month in Xero.

  2. It counts the sales invoices, supplier bills and credit notes raised, leaving out anything voided or deleted.

  3. The three counts arrive in your inbox as a short email.

Before it runs live

  • Connect Xero

What you get

RunsMonthly
Count last month's invoices, bills and credit notestoday, 9:00Succeeded
Email · Monthly countsinvoices: 64 bills: 41 credit notes: 3

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
invoice_count_report.pyexample
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 counts

FAQ

Common questions

Which date does it use to count an invoice?
It uses the invoice date, not the date it was paid or created in Xero. An invoice dated in the last week of the month falls in that month even if it was entered later, which matches how most accountants think about periods.
Are draft invoices included?
Counting follows the rules you choose. By default it leaves out voided and deleted documents. Drafts and awaiting-approval invoices can be included or excluded as you prefer, so say whether you want only finalised invoices counted.
Can it show the value as well as the count?
Yes. The same query can total the amounts, giving you the number of invoices and their combined value for each type. Your AI assistant can add the totals, and you approve the change before the next monthly run.
What permissions does it need?
accounting.transactions.read. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (monthly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.