On a schedule
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.
- Runs
- On a schedule
- Apps
- Google Sheets, Stripe
- AI
- Not needed
- Access
- Stripe read invoices; sheet editor
Send this to your assistant
Create a ClickRuntime automation: on the 1st of each month, total last month's paid Stripe invoices by country and tax rate into a new tab in my tax sheet and Slack me in #finance.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A company selling subscriptions across Europe charges different VAT rates in each country and has to report the totals every quarter. Each month someone exports Stripe invoices to CSV, filters by country, adds up tax by rate and pastes the results into the tax workbook. It is slow and easy to get wrong, and the error only shows when the return does not reconcile.
This automation does the month-end sum on the 1st. It reads every invoice paid in the previous month, groups the taxable amount and tax by customer country and rate, and writes the result into a new tab named after the month. Finance gets a Slack message when it is ready, and the quarterly return becomes a matter of adding up three tabs.
What you get out of it
Month-end done for you
The tax summary is in the sheet on the 1st without anyone exporting or filtering.
Grouped the way returns need it
Totals are split by country and tax rate, with taxable amount and tax shown separately.
One tab per month
Each month gets its own tab, so earlier figures are never overwritten.
Fewer arithmetic mistakes
Totals are calculated from every invoice line, not copied by hand.
Finance knows when it's ready
A short Slack message says the tab is there and gives the overall tax total.
How it works
What happens, step by step
On the 1st of each month, ClickRuntime collects all Stripe invoices paid in the previous month.
It groups the taxable amounts and tax by customer country, tax rate and currency.
The totals are written to a new tab in your tax sheet, named after the month.
A short message with the overall tax total is posted to #finance.
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 collections import defaultdict
import stripe
from clickruntime import on_trigger, credentials, 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(day=1, hour=0, minute=0, second=0, microsecond=0)
start = (end.replace(day=1) - timedelta(days=1)).replace(day=1)
totals = defaultdict(lambda: [0, 0])
for inv in stripe.Invoice.list(status="paid", created={"gte": int(start.timestamp()), "lt": int(end.timestamp())}, limit=100).auto_paging_iter():
country = (inv.customer_address or {}).get("country") or "unknown"
for t in inv.total_tax_amounts:
rate = stripe.TaxRate.retrieve(t.tax_rate).percentage
key = (country, rate, inv.currency.upper())
totals[key][0] += t.taxable_amount or 0
totals[key][1] += t.amount
tab = start.strftime("%Y-%m")
rows = [["Country", "Rate %", "Currency", "Taxable", "Tax"]] + [[c, r, cur, v[0] / 100, v[1] / 100] for (c, r, cur), v in sorted(totals.items())]
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
sheets.batchUpdate(spreadsheetId=SHEET_ID, body={"requests": [{"addSheet": {"properties": {"title": tab}}}]}).execute()
sheets.values().update(spreadsheetId=SHEET_ID, range=f"{tab}!A1", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
notify.slack(f"Tax summary for {tab} is in the sheet: {len(totals)} country and rate lines.", channel="#finance")
return {"lines": len(totals)}FAQ
Common questions
Which invoices are included?
Which country is used?
Does it handle more than one currency?
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
Copy 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 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 “Monthly Stripe tax summary by country in a sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.