The moment it happens
Post Chargebee plan upgrades and downgrades to Slack
When a Chargebee subscription changes plan, Slack gets a message saying whether it was an upgrade or a downgrade, with the old and new plan and the MRR change.
- Runs
- The moment it happens
- Apps
- Chargebee
- AI
- Not needed
- Access
- admin sets webhook with basic auth; chat:write
Send this to your assistant
Create a ClickRuntime automation: when a Chargebee subscription changes, post to #revenue in Slack the customer, old plan, new plan and MRR change, marked as upgrade or downgrade.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Upgrades are some of the best news a subscription business gets, and downgrades are an early sign that a customer is drifting. Both happen quietly in Chargebee unless someone goes looking.
This listens for Chargebee's subscription events and posts to Slack when a customer moves to a different plan or price. Each message says which way it went and by how much MRR.
It suits SaaS teams where account managers own expansion, and founders who want to know at once when a customer scales back.
What you get out of it
Celebrate expansion
Seeing an upgrade the moment it happens lets the account owner thank the customer and check they have what they need on the new plan.
Catch downgrades early
A downgrade often comes before a cancellation. A quick conversation when it happens can bring out what is not working.
MRR change in every message
The difference in monthly revenue is shown directly, so small and large moves are easy to tell apart.
Only real changes
Updates to card details or addresses are ignored. The channel only shows plan or price changes.
Webhook check built in
The basic auth header on the webhook is verified on every event, so nobody else can post fake updates to your channel.
How it works
What happens, step by step
Chargebee sends ClickRuntime an event whenever a subscription is changed.
ClickRuntime checks the event's basic auth so only Chargebee can trigger it.
It compares the new plan and MRR with what it last saw for that subscription.
Upgrades and downgrades are posted to Slack with the MRR difference. Changes that do not affect plan or price are skipped.
Before it runs live
- Connect Chargebee
- 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 Chargebee steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_event, credentials, notify, state
def from_chargebee(event):
return event.header("Authorization") == credentials.secret("CHARGEBEE_WEBHOOK_AUTH") # "Basic ..." set on the webhook
@on_event
def handle(event):
if not from_chargebee(event):
return {"posted": False, "reason": "unauthorised"}
body = event.json
if body["event_type"] not in ("subscription_created", "subscription_changed"):
return {"posted": False}
c, sub = body["content"]["customer"], body["content"]["subscription"]
plan = next((i["item_price_id"] for i in sub["subscription_items"] if i.get("item_type") == "plan"),
sub["subscription_items"][0]["item_price_id"])
mrr = sub.get("mrr", 0)
before = state.get(f"sub:{sub['id']}")
state.set(f"sub:{sub['id']}", {"plan": plan, "mrr": mrr})
if body["event_type"] == "subscription_created" or not before or (before["plan"] == plan and before["mrr"] == mrr):
return {"posted": False}
diff = (mrr - before["mrr"]) / 100
kind = "⬆️ Upgrade" if diff > 0 else "⬇️ Downgrade" if diff < 0 else "🔁 Plan change"
name = c.get("company") or f"{c.get('first_name', '')} {c.get('last_name', '')}".strip() or c.get("email", c["id"])
notify.slack(f"{kind}: {name} moved from {before['plan']} to {plan}. "
f"MRR {diff:+,.2f} {sub['currency_code']} (now {sub['currency_code']} {mrr / 100:,.2f})", channel="#revenue")
return {"posted": True, "subscription": sub["id"]}FAQ
Common questions
Why does it need to see the subscription before?
Does it post when only the billing address or card changes?
Which Chargebee events should the webhook send?
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
Announce 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 worksGet a Slack alert with the MRR lost when a customer cancels
Every cancellation is flagged with how much monthly revenue it removes, so account owners can step in.
See how it worksReport failed Chargebee payments in Slack
One message per failed invoice with the customer, amount and reason, even while dunning keeps retrying.
See how it worksKeep exploring
Set up “Post Chargebee plan upgrades and downgrades to Slack” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.