On a schedule
Sync active Stripe subscriptions to Google Sheets
A Subscriptions tab is rewritten every night with each live Stripe subscription: customer, plan, monthly amount, status and next renewal.
- Runs
- On a schedule
- Apps
- Google Sheets, Stripe
- AI
- Not needed
- Access
- Stripe secret or restricted key (read subscriptions, customers); Google Sheets read+write
Send this to your assistant
Create a ClickRuntime automation: every night at 2am, rewrite the Subscriptions tab of my sheet with all active, trialing and past-due Stripe subscriptions: customer email, plan, monthly amount, status and renewal date, plus a total MRR row.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Stripe's own dashboard shows MRR, but the moment you want to sort customers by value, add a column for account owner or join subscriptions with other data, you need the list in a spreadsheet.
This automation rebuilds a Subscriptions tab every night from Stripe, with each live subscription's customer, plan, monthly value, status and renewal date, sorted from the biggest account down.
Founders, customer success managers and finance leads use it as the starting point for renewal calls, churn reviews and board updates.
What you get out of it
Always current
The tab is rebuilt every night, so cancelled subscriptions disappear and new ones appear without manual exports.
Biggest accounts first
Rows are sorted by monthly amount, which makes the top of the sheet your key accounts list.
Upcoming renewals at a glance
The renewal date column makes it simple to filter for subscriptions renewing in the next 30 days.
Past-due customers stand out
Past-due subscriptions stay on the list with their status, so they can be chased before they cancel.
Ready for your own formulas
Other tabs can look up customers here for segment reports or forecasts.
How it works
What happens, step by step
Every night ClickRuntime pages through all your Stripe subscriptions.
It keeps active, trialing and past-due ones and converts yearly or weekly prices to a monthly amount.
The Subscriptions tab is cleared and rewritten with one row per subscription and a total monthly recurring revenue line at the bottom.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Stripe
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 Google Sheets and Stripe steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from datetime import datetime, timezone
from clickruntime import on_trigger, credentials, http, report_fetched
SHEET_ID = "your-spreadsheet-id"
KEEP = {"active", "trialing", "past_due"}
PER_MONTH = {"day": 30, "week": 52 / 12, "month": 1, "year": 1 / 12}
@on_trigger
def run(event):
key, subs, after = credentials.secret("STRIPE_API_KEY"), [], None
while True:
params = {"status": "all", "limit": 100, "expand[]": "data.customer", **({"starting_after": after} if after else {})}
page = http.get("https://api.stripe.com/v1/subscriptions", params=params, auth=(key, "")).json()
subs += [s for s in page["data"] if s["status"] in KEEP]
if not page["has_more"]:
break
after = page["data"][-1]["id"]
report_fetched(len(subs))
rows, mrr = [], 0.0
for s in subs:
monthly = 0.0
for item in s["items"]["data"]:
rec = item["price"]["recurring"]
monthly += (item["price"]["unit_amount"] or 0) / 100 * item.get("quantity", 1) * PER_MONTH[rec["interval"]] / rec["interval_count"]
mrr += monthly if s["status"] != "trialing" else 0
renew = datetime.fromtimestamp(s["items"]["data"][0]["current_period_end"], timezone.utc).date().isoformat()
plan = s["items"]["data"][0]["price"].get("nickname") or s["items"]["data"][0]["price"]["id"]
rows.append([s["customer"].get("email") or s["customer"]["id"], plan, round(monthly, 2), s["status"], renew, s["id"]])
rows.sort(key=lambda r: -r[2])
values = [["Customer", "Plan", "Monthly amount", "Status", "Renews", "Subscription"]] + rows + [["Total MRR", "", round(mrr, 2)]]
tab = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets().values()
tab.clear(spreadsheetId=SHEET_ID, range="Subscriptions!A:F").execute()
tab.update(spreadsheetId=SHEET_ID, range="Subscriptions!A1", valueInputOption="USER_ENTERED", body={"values": values}).execute()
return {"subscriptions": len(rows), "mrr": round(mrr, 2)}FAQ
Common questions
How is the monthly amount worked out?
Are trials counted in MRR?
Why rewrite the tab instead of appending?
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
Monthly Stripe tax summary by country in a sheet
On the 1st of each month, last month's paid Stripe invoices are totalled by country and tax rate in a new tab, and you're told in Slack.
See how it worksCopy new Stripe payouts to Google Sheets
Each new Stripe payout is added to a Payouts tab with arrival date, amount, fees and how many charges it covers.
See how it worksLog daily Stripe revenue in a sheet with a running forecast
Each morning yesterday's gross, fees, refunds and net per currency are added to your sheet, and you get a 30-day forecast by email.
See how it worksKeep exploring
Set up “Sync active Stripe subscriptions to Google Sheets” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.