On a schedule
Post a daily Chargebee revenue summary to Slack
Every morning at 8am Slack gets yesterday's Chargebee figures: money collected, failed payments, refunds, new subscriptions and cancellations.
- Runs
- On a schedule
- Apps
- Chargebee
- AI
- Not needed
- Access
- read-only key; chat:write
Send this to your assistant
Create a ClickRuntime automation: every day at 8am, post to #revenue in Slack yesterday's Chargebee totals: successful payments, failed payments, refunds, new subscriptions and cancellations.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Chargebee has detailed reports, but most people want five numbers each morning: what came in, what failed, what was refunded, and how many customers joined or left.
This reads yesterday's transactions and subscriptions from the Chargebee API and posts a short summary to Slack before the day starts. Founders, finance and the revenue team all see the same figures.
It suits subscription businesses that want a daily pulse without building a dashboard, and teams who discuss numbers in Slack rather than in a BI tool.
What you get out of it
Failed payments in plain sight
A day with unusually many failed payments often means a card processor issue or an expired gateway setting. Seeing it the next morning lets you act quickly.
Same numbers for everyone
Posting to a shared channel means sales, finance and the founder discuss the same figures, not their own exports.
Refunds are counted too
A spike in refunds can point to a billing mistake or an unhappy cohort. The summary shows it alongside collections.
Growth and churn side by side
New subscriptions next to cancellations shows whether the day moved you forward.
Read-only key
The automation only reads transactions and subscriptions. It cannot issue refunds or change any billing.
How it works
What happens, step by step
Every morning ClickRuntime reads yesterday's transactions from Chargebee.
It totals successful payments, failed payments and refunds separately.
It counts subscriptions created and cancelled during the same day.
A short summary is posted to your Slack channel.
Before it runs live
- Connect Chargebee
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 Chargebee steps into one automation
Under the hood
The code that runs this automation
from datetime import datetime, time as dtime, timedelta
from clickruntime import on_trigger, credentials, http, notify
SITE = "yourcompany" # yourcompany.chargebee.com
def fetch_all(api, auth, path, key, params):
out, offset = [], None
while True:
body = http.get(f"{api}/{path}", auth=auth, params={**params, "limit": 100, **({"offset": offset} if offset else {})}).json()
out += [r[key] for r in body["list"]]
offset = body.get("next_offset")
if not offset:
return out
@on_trigger
def run(event):
api, auth = f"https://{SITE}.chargebee.com/api/v2", (credentials.secret("CHARGEBEE_API_KEY"), "")
day = datetime.now().date() - timedelta(days=1)
start = int(datetime.combine(day, dtime.min).timestamp())
end = start + 86400
tx = fetch_all(api, auth, "transactions", "transaction", {"date[between]": f"[{start},{end - 1}]"})
def total(kind, status):
rows = [t for t in tx if t["type"] == kind and t["status"] == status]
return sum(t["amount"] for t in rows) / 100, len(rows)
paid, failed, refunded = total("payment", "success"), total("payment", "failure"), total("refund", "success")
created = fetch_all(api, auth, "subscriptions", "subscription", {"created_at[between]": f"[{start},{end - 1}]"})
cancelled = fetch_all(api, auth, "subscriptions", "subscription", {"cancelled_at[between]": f"[{start},{end - 1}]"})
cur = tx[0]["currency_code"] if tx else "USD"
notify.slack(f"📊 Chargebee, {day:%a %d %b}\n"
f"Collected: {cur} {paid[0]:,.2f} ({paid[1]} payments)\n"
f"Failed: {cur} {failed[0]:,.2f} ({failed[1]} payments)\n"
f"Refunded: {cur} {refunded[0]:,.2f} ({refunded[1]})\n"
f"New subscriptions: {len(created)} · Cancellations: {len(cancelled)}", channel="#revenue")
return {"collected": paid[0], "new": len(created), "cancelled": len(cancelled)}FAQ
Common questions
What if I bill in more than one currency?
Which time zone defines 'yesterday'?
Is this the same as MRR?
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
Email a list of cards expiring this month
On the first of each month you get the customers whose saved cards run out before their next renewal.
See how it worksGet a Slack list of Chargebee trials ending soon
Every weekday at 9am, Chargebee trials ending in the next 3 days are posted to Slack with the customer, plan, end date and whether a payment method is on file.
See how it worksAnnounce new Chargebee subscriptions in Slack
Each new subscription is posted with the customer, plan and amount as soon as it's created.
See how it worksKeep exploring
Set up “Post a daily Chargebee revenue summary to Slack” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.