Skip to content

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.

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

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

  1. Chargebee sends ClickRuntime an event whenever a subscription is changed.

  2. ClickRuntime checks the event's basic auth so only Chargebee can trigger it.

  3. It compares the new plan and MRR with what it last saw for that subscription.

  4. 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

RunsThe moment it happens
Post Chargebee plan upgrades and downgrades to Slackjust nowSucceeded
Slack · #revenue⬆️ Upgrade: Kestrel Media moved from starter-USD-monthly to growth-USD-monthly. MRR +USD 150.00 (now USD 199.00)

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

  • 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

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.
post_chargebee_plan_upgrades_and_downgrades_to_slack.pyexample
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?
Chargebee's change event carries the subscription as it is now, not as it was. The automation remembers each subscription's plan and MRR from earlier events, so the first change it sees for an older subscription is used to learn the starting point and is not posted.
Does it post when only the billing address or card changes?
No. If the plan and MRR are the same as before, nothing is posted. Only changes that affect what the customer pays reach Slack.
Which Chargebee events should the webhook send?
Subscription Created and Subscription Changed. Created events are used only to remember the starting plan for new customers.
What permissions does it need?
admin sets webhook with basic auth; chat:write. 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 for each event the app sends.
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 “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.