On a schedule
Log 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.
- Runs
- On a schedule
- Apps
- Google Sheets, Stripe
- AI
- Optional
- Access
- Stripe read balance; sheet editor
Send this to your assistant
Create a ClickRuntime automation: every morning at 6, add yesterday's Stripe gross, fees, refunds and net per currency to my revenue sheet and email me a 30-day forecast.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A bootstrapped software company runs its finances from a Google Sheet: cash, runway, hiring plans. Revenue is the one number that has to be fetched from Stripe by hand, and the export never quite matches because of fees, refunds and two currencies. So the sheet is updated monthly at best, and the runway figure is always a few weeks out of date.
This automation adds one reconciled row per currency each morning, using Stripe's balance records so gross, fees, refunds and net match what actually reaches the bank. With a daily history building up in the sheet, AI writes a short 30-day forecast and emails it to you, so the plan in the sheet stays based on current numbers.
What you get out of it
Numbers that match the bank
Rows are built from Stripe's balance records, so fees and refunds are already taken out of net.
Kept separate by currency
Each currency gets its own row, so EUR and USD are never added together.
Always up to date
A new row arrives every morning without anyone exporting anything.
A forecast you can act on
A short 30-day projection by email, based on the history in your sheet.
Works with your own formulas
Because the data is in your sheet, runway, charts and pivot tables update on their own.
How it works
What happens, step by step
Every morning at the time you choose, ClickRuntime collects yesterday's Stripe balance activity.
It totals gross, fees, refunds and net for each currency.
One row per currency is added to your revenue sheet.
AI reads the recent history in the sheet and you get a short 30-day forecast by email.
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
- Change what the AI looks for, or how it writes the result
- 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, timedelta, timezone
from collections import defaultdict
import stripe
from clickruntime import on_trigger, credentials, ai, notify
SHEET_ID = "your-sheet-id"
@on_trigger
def run(event):
stripe.api_key = credentials.secret("STRIPE_API_KEY")
end = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0)
day = (end - timedelta(days=1)).date().isoformat()
t = defaultdict(lambda: {"gross": 0, "fees": 0, "refunds": 0, "net": 0})
for b in stripe.BalanceTransaction.list(created={"gte": int((end - timedelta(days=1)).timestamp()), "lt": int(end.timestamp())}, limit=100).auto_paging_iter():
row = t[b.currency.upper()]
row["refunds" if b.type == "refund" else "gross"] += b.amount
row["fees"] += b.fee
row["net"] += b.net
rows = [[day, cur] + [v[k] / 100 for k in ("gross", "fees", "refunds", "net")] for cur, v in t.items()]
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
if rows:
sheets.values().append(spreadsheetId=SHEET_ID, range="Revenue!A:F", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
history = sheets.values().get(spreadsheetId=SHEET_ID, range="Revenue!A:F").execute().get("values", [])[-120:]
forecast = ai.generate("From these daily rows (date, currency, gross, fees, refunds, net), forecast net revenue for the next 30 days per currency in 3 sentences:\n"
+ "\n".join(",".join(map(str, r)) for r in history), max_output_tokens=200).text
notify.email_me(f"Revenue for {day} and 30-day forecast", "\n".join(f"{r[1]}: net {r[5]:,.2f}" for r in rows) + "\n\n" + forecast)
return {"rows": len(rows)}FAQ
Common questions
Why balance transactions rather than payments?
How is the forecast made?
Can the forecast go to Slack instead?
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 worksSync 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.
See how it worksKeep exploring
Set up “Log daily Stripe revenue in a sheet with a running forecast” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.