Monthly
Save a monthly Stripe revenue report to Drive
On the first of each month, last month's Stripe transactions are saved to Drive as a spreadsheet file, with a short written summary emailed to you.
- Runs
- Monthly
- Apps
- Google Drive, Stripe
- AI
- Yes, uses the built-in AI allowance
- Access
- Stripe read; Drive file
Send this to your assistant
Create a ClickRuntime automation: on the 1st of each month, export last month's Stripe balance transactions as a CSV to my Accounting folder in Drive and email me a short summary.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A small agency's accountant asks for the same thing every month: a list of Stripe payments, refunds and fees for the month just closed. The owner logs in, sets the date range, exports, renames the file and emails it over, usually a week late because it slips down the to-do list.
A report that saves itself to a shared Drive folder on the first of the month removes that chore. The accountant has the data on day one, and the owner gets a short summary of how the month went without opening Stripe.
What you get out of it
Books close on time
The accountant has the month's transactions the moment the month ends. Reconciliation starts straight away instead of waiting for an export.
Fees and refunds are included
The file lists every payment, refund, fee and payout, not just sales. That is what an accountant needs to match Stripe to the bank.
A plain summary for the owner
A few sentences on revenue, refunds and fees compared with the month before arrive by email. The owner sees how the month went without reading a spreadsheet.
One folder for every month
Reports pile up in the same folder with consistent names. Finding March of last year takes seconds.
How it works
What happens, step by step
On the first day of each month, ClickRuntime collects all of last month's transactions from your Stripe account.
It totals sales, refunds and fees and builds a spreadsheet file with one row per transaction.
The file is saved in your Accounting folder in Google Drive.
AI writes a short summary of the month from the totals, which is emailed to you with a link to the file.
Before it runs live
- Connect Google Drive
- 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 Drive and Stripe steps into one automation
Under the hood
The code that runs this automation
import csv, io, time, stripe
from datetime import date
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload
from clickruntime import on_trigger, credentials, notify, ai
FOLDER_ID = "your-accounting-folder-id"
@on_trigger
def run(event):
stripe.api_key = credentials.secret("STRIPE_API_KEY")
end = date.today().replace(day=1)
start = end.replace(year=end.year - 1, month=12) if end.month == 1 else end.replace(month=end.month - 1)
period = {"gte": int(time.mktime(start.timetuple())), "lt": int(time.mktime(end.timetuple()))}
out, totals = io.StringIO(), {}
w = csv.writer(out)
w.writerow(["Date", "Type", "Description", "Gross", "Fee", "Net", "Currency"])
for tx in stripe.BalanceTransaction.list(created=period, limit=100).auto_paging_iter():
w.writerow([date.fromtimestamp(tx.created), tx.type, tx.description, tx.amount / 100, tx.fee / 100, tx.net / 100, tx.currency.upper()])
totals[tx.type] = round(totals.get(tx.type, 0) + tx.amount / 100, 2)
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
f = drive.files().create(body={"name": f"Stripe {start:%Y-%m}.csv", "parents": [FOLDER_ID]}, fields="webViewLink",
media_body=MediaIoBaseUpload(io.BytesIO(out.getvalue().encode()), mimetype="text/csv")).execute()
summary = ai.generate(f"Stripe totals by type for {start:%B %Y}: {totals}", system="Write a 3-sentence plain summary for a business owner.", max_output_tokens=200).text
notify.email_me(f"Stripe report {start:%B %Y}", f"{summary}\n\nFile: {f['webViewLink']}")
return {"types": totals}FAQ
Common questions
What is in the file?
Does the AI see my customers' details?
Can it go straight to my accountant?
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
Deliver a Drive file when someone buys on Stripe
Each buyer gets access to the right Google Drive file seconds after paying, with an email from Drive containing the link.
See how it worksSave every Stripe invoice PDF to Drive
Each paid Stripe invoice is saved as a PDF in your Drive receipts folder, named by date and customer.
See how it worksGet a daily news digest in Slack
Each morning your team gets a short summary of what's new on the sites and blogs you follow.
See how it worksKeep exploring
Set up “Save a monthly Stripe revenue report to Drive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.