On a schedule
Get yesterday's Stripe revenue in your inbox each morning
Every morning you get one email with yesterday's sales, refunds and new subscriptions, plus a two-line summary.
- Runs
- On a schedule
- Apps
- Gmail, Stripe
- AI
- Optional
- Access
- Stripe read; gmail.send
Send this to your assistant
Create a ClickRuntime automation: every morning at 7, email me yesterday's Stripe sales, refunds and new subscriptions with a short AI summary.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
The owner of a small subscription business checks the Stripe dashboard most mornings, clicks through payments, then refunds, then subscriptions, and tries to remember whether yesterday was good compared with last week. On busy days she skips it, and a run of refunds or a quiet sales day goes unnoticed until the monthly numbers come in.
This automation puts the numbers in her inbox before she starts work: gross sales, refunds, new subscriptions and new customers for the previous day, with a two-line summary that points out anything unusual. It is quick to read on a phone and builds a daily record she can search later.
What you get out of it
Numbers without logging in
The day's figures arrive by email, so there is no dashboard to open.
Problems surface early
A jump in refunds or a quiet day is visible the next morning, not at month end.
A plain summary on top
Two sentences say what stood out, so the email is useful in ten seconds.
A searchable record
Each day's email stays in Gmail, so you can look back at any date.
Multi-currency totals
Sales and refunds are totalled per currency rather than mixed together.
How it works
What happens, step by step
Every morning at the time you choose, ClickRuntime collects yesterday's payments, refunds and new subscriptions from Stripe.
It adds them up per currency and counts new customers.
AI writes a two-line summary of what stood out.
The totals and summary are emailed to you from your Gmail.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- 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 Gmail and Stripe steps into one automation
Under the hood
The code that runs this automation
import base64
from email.message import EmailMessage
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
def send(to, subject, text):
msg = EmailMessage(); msg["To"], msg["Subject"] = to, subject; msg.set_content(text)
g = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
g.users().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
@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)
span = {"gte": int((end - timedelta(days=1)).timestamp()), "lt": int(end.timestamp())}
totals = defaultdict(int)
for c in stripe.Charge.list(created=span, limit=100).auto_paging_iter():
totals[f"Sales {c.currency.upper()}"] += c.amount if c.paid else 0
for r in stripe.Refund.list(created=span, limit=100).auto_paging_iter():
totals[f"Refunds {r.currency.upper()}"] += r.amount
lines = [f"{k}: {v / 100:,.2f}" for k, v in totals.items()]
lines.append(f"New subscriptions: {len(stripe.Subscription.list(created=span, status='all', limit=100).data)}")
summary = ai.generate("Summarise yesterday's revenue in two sentences:\n" + "\n".join(lines), max_output_tokens=120).text
send("me@example.com", f"Stripe revenue for {(end - timedelta(days=1)).date()}", summary + "\n\n" + "\n".join(lines))
return {"lines": len(lines)}FAQ
Common questions
Which day does the email cover?
Does it include subscription renewals?
Can it go to my co-founder too?
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
Win back failed payments with a friendly email
When a card fails, the customer gets a short note from you with a link to pay, and a reminder three days later if it's still unpaid.
See how it worksEmail buyers their product and receipt after a Stripe payment
As soon as someone pays, they get their download link and a receipt from your own Gmail address.
See how it worksCheck VAT numbers on Stripe invoices and email the right person
When Stripe drafts an invoice, an invalid VAT number is flagged to finance; when it's finalised, the customer gets an email from you.
See how it worksKeep exploring
Set up “Get yesterday's Stripe revenue in your inbox each morning” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.