Monthly
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.
- Runs
- Monthly
- Apps
- Chargebee
- AI
- Not needed
- Access
- read-only
Send this to your assistant
Create a ClickRuntime automation: on the 1st of every month at 9am, email me the Chargebee customers whose card expires this month, with their email and the card's last four digits.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A subscription business loses a surprising number of renewals to something nobody decided: a card on file simply reached its expiry month. The customer never chose to leave, but the Chargebee invoice fails, the dunning emails start, and some of those accounts churn quietly. Finance usually only notices when the failed-payment report grows at month end.
On the first of each month, this pulls the saved payment sources from Chargebee, sorts them by expiry date, and emails you the customers whose cards will expire before their next renewal date. You get a plain list with customer, card brand, last four digits and expiry, so there is something concrete to act on.
It is most useful for teams with annual plans or high-value accounts, where one failed renewal is a real revenue event and a friendly heads-up beats an automated dunning sequence.
What you get out of it
Fix cards before the charge fails
A customer asked to update a card three weeks early does it in a calm moment. The same customer, told after a declined renewal, is already annoyed and may be mid-contract with your competitor. The earlier request costs you nothing and avoids the dunning cycle altogether.
Protect your largest annual renewals
Annual plans concentrate revenue into a single charge. A list of expiring cards lets account managers personally contact the few customers whose failed payment would hurt, instead of leaving those accounts to a generic automated retry schedule.
Cut involuntary churn you can see coming
Involuntary churn is the part of cancellation customers never chose. Because expiry dates are known months ahead, a monthly list turns an unpredictable loss into a short to-do list that someone can finish in an afternoon.
Spread the work across the month
Checking cards once a month keeps the workload small and regular. Rather than a panic when failures pile up on the first of the month, support sends a handful of notes each cycle and the queue never builds.
Give finance fewer failed payments to explain
When fewer renewals fail, the month-end reconciliation has fewer exceptions to chase. Finance can compare each month's expiring-card list against later failures and see how well the outreach actually worked. Comparing each month's list with later failures tells you whether the early outreach is really paying off.
How it works
What happens, step by step
Once a month, ClickRuntime looks in Chargebee for customer cards that expire this month.
It collects the customer email and the last four digits of each card.
You get an email with the number of cards and a line for each customer with the last four digits of their card, so you can ask them to update it before a payment fails.
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 date
from clickruntime import on_trigger, credentials, http, notify
SITE = "yourcompany" # yourcompany.chargebee.com
@on_trigger
def run(event):
api, auth = f"https://{SITE}.chargebee.com/api/v2", (credentials.secret("CHARGEBEE_API_KEY"), "")
today = date.today()
expiring, offset = [], None
while True:
params = {"type[is]": "card", "status[is]": "valid", "limit": 100, **({"offset": offset} if offset else {})}
body = http.get(f"{api}/payment_sources", auth=auth, params=params).json()
for row in body["list"]:
card = row["payment_source"]["card"]
if card["expiry_year"] == today.year and card["expiry_month"] == today.month:
expiring.append((row["payment_source"]["customer_id"], card["last4"]))
offset = body.get("next_offset")
if not offset:
break
lines = []
for customer_id, last4 in expiring:
customer = http.get(f"{api}/customers/{customer_id}", auth=auth).json()["customer"]
lines.append(f"- {customer.get('email', customer_id)}: card ending {last4}")
if lines:
notify.email_me(f"{len(lines)} cards expire this month", "\n".join(lines))
return {"expiring": len(lines)}FAQ
Common questions
Does it include cards that already expired?
Which Chargebee permissions does it need?
Will customers receive the email directly?
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
Get 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 worksPost 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.
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 “Email a list of cards expiring this month” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.