The moment it happens
Post each new Xero invoice to Slack
Whenever a sales invoice is created, Slack shows the contact, total and due date.
- Runs
- The moment it happens
- Apps
- Xero
- AI
- Not needed
- Access
- accounting.transactions.read
Send this to your assistant
Create a ClickRuntime automation: when a new sales invoice is created in Xero, post the contact, total and due date to #sales in Slack.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Finance teams often work in a different place from the people who sell. A sales invoice is raised in Xero for a customer, the account manager is not told, and a week later the customer calls to ask when the invoice is arriving. Or an invoice goes out with the wrong amount and nobody notices until it is chased as overdue.
When a new invoice is created in Xero, a webhook arrives. The automation first verifies the request signature to confirm it really came from Xero, then fetches the invoice and posts a Slack message with the customer, number, amount and due date, so people see sales billing as it happens.
It suits companies where finance, account management and leadership want a shared view of billing without logging into Xero.
What you get out of it
Account managers know an invoice went out
A customer calling about billing no longer catches the account manager off guard, because they saw the invoice posted in Slack when it was raised. That avoids the awkward moment of a customer knowing more about their invoice than you do.
Errors are spotted quickly
A wrong amount or a customer name typo is noticed by someone scanning the channel on the day the invoice is created, long before it becomes a dispute. Catching a mistake before the customer sees it protects both the relationship and cash flow.
Only genuine events are processed
Checking the signature on each request means a forged call to the trigger link cannot make your Slack channel show invoices that do not exist. That protects the channel from fake data and keeps trust in what it shows.
Leadership sees revenue as it is billed
A running feed of invoices gives owners a sense of billing pace through the month without needing a report or a finance meeting. It is a lighter way to follow revenue than waiting for the month-end report.
Faster follow-up on large invoices
A big invoice posted to a channel can prompt a call to the customer to confirm receipt and ask about the expected payment date. That personal touch often speeds up payment and strengthens the customer relationship.
How it works
What happens, step by step
When a sales invoice is created in Xero, Xero lets ClickRuntime know straight away.
ClickRuntime checks the message really came from your Xero account, then looks up the full invoice.
It posts the invoice number, contact, total, currency and due date to your Slack channel.
Before it runs live
- Connect Xero
- Paste your automation's link into the other app's webhook settings
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
- Act only on the items that match your own rules, and skip the rest
- 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 clickruntime import on_event, credentials, http, notify, verify
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_event
def handle(event):
if not verify.generic_hmac_sha256(event.body, event.header("x-xero-signature"), credentials.secret("XERO_WEBHOOK_KEY"), encoding="base64"):
return {"ok": False}
headers = xero_headers()
for e in event.json.get("events", []):
if e["eventCategory"] != "INVOICE" or e["eventType"] != "CREATE":
continue
inv = http.get(f"{API}/Invoices/{e['resourceId']}", headers=headers).json()["Invoices"][0]
if inv["Type"] == "ACCREC":
notify.slack(f"New invoice {inv['InvoiceNumber']} for {inv['Contact']['Name']}: "
f"{inv['Total']:,.2f} {inv['CurrencyCode']}, due {inv['DueDateString'][:10]}", channel="#sales")
return {"ok": True}FAQ
Common questions
Does it alert for bills as well as sales invoices?
What does the signature check protect against?
Are draft invoices announced too?
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
Know when a Xero invoice is paid
A Slack message as soon as an invoice turns to paid, sent once per invoice.
See how it worksHear when a contact is added to Xero
A Slack message whenever a new customer or supplier appears in Xero.
See how it worksRaise a draft Xero invoice when a deal closes
A won deal elsewhere creates a draft invoice for the right contact, and Slack gets a link to review it.
See how it worksKeep exploring
Set up “Post each new Xero invoice to Slack” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.