Skip to content

The moment it happens

Log Stripe sales in a sheet and send buyers their product

Every payment becomes a row in your sales sheet, and the buyer gets the download link you keep in that sheet.

Runs
The moment it happens
Apps
Google Sheets, Stripe
AI
Not needed
Access
Stripe read; sheet editor

Send this to your assistant

Create a ClickRuntime automation: when a Stripe checkout succeeds, add a row to my sales sheet, look up the product's download link in the Products tab and email it to the buyer.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A small digital shop sells e-books and presets through Stripe. The owner keeps a Google Sheet of sales for her accountant and a tab with each product's download link, and both get updated by hand: copy each payment into the sheet, look up the link, email the buyer. When sales spike after a newsletter, she spends the evening catching up.

This automation does both from the moment the payment clears. The sale is added to the sheet with the date, buyer, product and amount, the matching link is looked up in the Products tab and the buyer is emailed straight away. The sheet stays complete for the accountant, and changing a link is as simple as editing a cell.

What you get out of it

  • A complete sales record

    Every payment lands in the sheet with its date, buyer, product, amount and currency.

  • Links managed in the sheet

    Download links live in a Products tab, so updating one is a cell edit rather than a settings change.

  • Buyers served instantly

    The product email goes out seconds after payment, at any hour.

  • Ready for your accountant

    The sales tab is already in a format you can share or export at month end.

  • No double rows

    A resent Stripe event is recognised, so each sale is logged and emailed once.

How it works

What happens, step by step

  1. When a checkout is paid, Stripe tells ClickRuntime straight away, and the message is checked to be genuinely from Stripe.

  2. It skips payments already handled, so a resent message never adds a second row.

  3. A row with the date, buyer, product and amount is added to your sales tab.

  4. The product's download link is looked up in your Products tab and emailed to the buyer.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Stripe
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Log Stripe sales in a sheet and send buyers their productjust nowSucceeded
Google Sheets · Sales2026-10-19 | maya@contoso.example | Lightroom preset pack | 24.00 | GBP | cs_live_a1B2c3

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

  • Act only on the items that match your own rules, and skip the rest
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
log_stripe_payments_to_a_sheet_and_deliver_the_product.pyexample
import base64
from email.message import EmailMessage
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
import stripe
from clickruntime import on_event, credentials, verify, state

SHEET_ID = "your-sheet-id"

@on_event
def handle(event):
    if not verify.stripe(event.body, event.header("Stripe-Signature"), credentials.secret("STRIPE_WEBHOOK_SECRET")):
        return {"ignored": "bad signature"}
    s = event.json["data"]["object"]
    if state.get(f"done:{s['id']}"):
        return {"duplicate": True}
    stripe.api_key = credentials.secret("STRIPE_API_KEY")
    item = stripe.checkout.Session.list_line_items(s["id"], limit=1).data[0]
    email, google = s["customer_details"]["email"], Credentials(credentials.connection("google", "work"))
    sheets = build("sheets", "v4", credentials=google, cache_discovery=False).spreadsheets()
    sheets.values().append(spreadsheetId=SHEET_ID, range="Sales!A:F", valueInputOption="USER_ENTERED", body={"values": [[
        event.received_at[:10], email, item.description, s["amount_total"] / 100, s["currency"].upper(), s["id"]]]}).execute()
    products = sheets.values().get(spreadsheetId=SHEET_ID, range="Products!A:B").execute().get("values", [])
    link = next((r[1] for r in products if len(r) > 1 and r[0] == item.price.product), None)
    msg = EmailMessage(); msg["To"], msg["Subject"] = email, f"Your {item.description}"
    msg.set_content(f"Thanks for your purchase. Download it here: {link or 'we will send it to you shortly'}")
    build("gmail", "v1", credentials=google, cache_discovery=False).users().messages().send(
        userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
    state.set(f"done:{s['id']}", True)
    return {"logged": s["id"]}

FAQ

Common questions

How should the Products tab be laid out?
Two columns: the Stripe product ID in the first and the download link in the second. Your AI assistant can tell you the product IDs from your Stripe account.
Which columns are added to the sales tab?
Date, customer email, product name, amount, currency and the Stripe checkout ID. You can ask for others, such as country or coupon code.
Which address does the buyer email come from?
From the Google account you connected, so replies come back to your inbox.
What permissions does it need?
Stripe read; sheet editor. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Log Stripe sales in a sheet and send buyers their product” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.