Connect Stripe to Google Sheets: 3 Ways to Track Sales Automatically
stripe nov 25, 2026

Connect Stripe to Google Sheets: 3 Ways to Track Sales Automatically

Three ways to log Stripe sales in Google Sheets: CSV exports, no-code connectors, and a free Apps Script setup with copy-paste code for live tracking.

/blog/how-to-connect-stripe-to-google-sheets-for-automatic-sales-tracking

Header image: a Stripe charge, a scheduled pull, and a new row in Google Sheets. Graphic: Ctrl Alt Orion.

You can connect Stripe to Google Sheets three ways: Stripe’s own reporting and CSV exports (free, but manual), a no-code connector like Zapier or Make (fast to set up, but costs money per task), or a Google Apps Script integration you build yourself (free, fully yours, about 30 minutes of setup). For most small shops, the sweet spot is the third option: a small script that pulls your payments from Stripe’s API on a schedule — or receives webhook pings and re-fetches the details — and appends a row to a sheet, with no monthly fee.

This guide walks through all three so you can pick based on your time and budget. If you’ve never dealt with an API before, skim What Is an API? Explained for Business Owners first — the concepts there (requests, keys, endpoints) map directly onto what we’re doing here.

Option 1: Stripe’s native exports and Sigma (the zero-effort baseline)

Before you build anything, know what Stripe already gives you:

  • Payments CSV export: In the Stripe Dashboard, go to Payments, filter by date range, click the export icon, and download a CSV you can drop straight into Sheets. This is fine for monthly bookkeeping but it’s a snapshot, not a live feed.
  • Stripe Sigma: A built-in SQL-based reporting tool with ready-made templates (daily sales, refunds, payouts). It’s a paid add-on — check Stripe’s Sigma page for current pricing — and it reports inside Stripe, not inside Sheets, though Sigma reports can be exported to CSV.
  • Stripe Apps: Stripe’s app marketplace has changed over time; check the Stripe App Marketplace to see whether a current Sheets integration exists before assuming you need a third-party connector.

The export route costs nothing and requires no code, but every number is stale the moment you download it. If you only need weekly or monthly totals, stop here — you’re done.

Option 2: No-code connectors (Zapier, Make, Zapier alternatives)

The fastest path to a live sheet:

  1. In Zapier or Make, create a new workflow with Stripe as the trigger. Choose New Payment or New Checkout Session Completed.
  2. Authenticate by connecting your Stripe account (OAuth — you don’t handle API keys yourself).
  3. Add an action: Google Sheets → Create Spreadsheet Row.
  4. Map fields: amount, currency, customer email, payment ID (pi_...), description, timestamp.
  5. Turn it on and run a test transaction.

The catch is cost and task counting. Zapier bills per “task” (each row written is one task) — its free plan allows 100 tasks per month, with paid plans scaling by volume, so a busy store can outgrow a starter plan quickly. Make is generally cheaper per operation. If you want to understand why these tools exist and what they replace, What Is a Webhook, and How Does It Connect Your Tools Without Zapier Fees? explains the mechanics — and the DIY alternative we’re building next is exactly the “without the fees” version.

advertisement

Option 3: DIY with Apps Script

This is the setup we’ll build in detail. There are two variants, and it’s important to pick the right one:

  • Pull (recommended): A time-driven script calls Stripe’s API every 15 minutes and appends any new payments. No public URL, no signature handling, nothing for strangers to poke at.
  • Push (webhook): Stripe POSTs an event to your script’s web app URL in real time. The catch: Stripe signs every webhook delivery with a Stripe-Signature header, and Apps Script web apps don’t expose request headers — doPost(e) gives you the body, parameters, and content length, but not the signature. That means you cannot verify the signature inside Apps Script. Stripe’s own libraries do this verification with the raw body and the endpoint secret, but there’s no official Stripe library for Apps Script. If you need real-time push, either put a small verifying relay (for example, a Cloudflare Worker that checks the signature and then forwards to your sheet) in front of the script, or treat the webhook as an untrusted “ping” and re-fetch the event from Stripe’s API by ID before logging anything.

For most small businesses, the pull variant is the better DIY route: simpler, private, and at most 15 minutes behind. We’ll build it first.

Step 1: Create the spreadsheet and columns

Create a new Google Sheet. Name the first tab Payments and put these headers in row 1:

ColumnFieldExample
AEvent / Charge IDch_3P9x…
BPayment Intent IDpi_3P9x…
CCheckout Session ID (if any)cs_test_…
DAmount (cents)12500
EAmount (dollars)125.00
FCurrencyusd
GCustomer emailbuyer@example.com
HDescription / productWidget, large
IStatussucceeded
JSourcecharge.pulled
KCreated timestamp2026-11-25 14:03 UTC

Log amounts in cents as well as dollars. Stripe reports every amount in the smallest currency unit (cents for USD), and keeping the raw integer makes reconciliation with Stripe’s own totals exact — floating-point math on dollars is how spreadsheets drift.

Step 2: Create a restricted Stripe API key

Go to Developers → API keys → Create restricted key in the Stripe Dashboard, and grant it Read-only access to Charges, Payment Intents, Checkout Sessions, and Refunds — plus Events (read) if you use the ping-and-fetch webhook pattern below, since that pattern re-fetches each event by ID. Nothing else. Restricted keys exist precisely so a script that only needs to read payments can’t issue refunds or move money if the key ever leaks. Never use a full-access sk_live_ key for a read-only job.

Step 3: The pull script

In your Google Sheet: Extensions → Apps Script. Delete the placeholder and paste:

const API_KEY_PROP = 'STRIPE_READ_KEY';

function pullRecentPayments() {
  const key = PropertiesService.getScriptProperties().getProperty(API_KEY_PROP);
  const lastRun = PropertiesService.getScriptProperties().getProperty('LAST_RUN') || 0;
  const url = 'https://api.stripe.com/v1/charges?created[gt]=' + lastRun + '&limit=100';
  const resp = UrlFetchApp.fetch(url, {
    headers: { Authorization: 'Bearer ' + key }
  });
  const data = JSON.parse(resp.getContentText());
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Payments');
  data.data.forEach(function (ch) {
    sheet.appendRow([ch.id, ch.payment_intent, '', ch.amount, ch.amount / 100,
      ch.currency.toUpperCase(), ch.receipt_email || '', ch.description || '',
      ch.status, 'charge.pulled', new Date(ch.created * 1000).toISOString()]);
  });
  if (data.data.length) {
    PropertiesService.getScriptProperties()
      .setProperty('LAST_RUN', String(Math.max.apply(null, data.data.map(c => c.created))));
  }
}

Step 4: Store the key in Script Properties — never in a cell or in code

Run this once from the editor (or use Project Settings → Script Properties):

function setKey() {
  PropertiesService.getScriptProperties()
    .setProperty('STRIPE_READ_KEY', 'rk_live_your_read_only_key_here');
}

Then delete the key value from any code. Script Properties aren’t visible to people who can view the sheet, only to script editors.

Step 5: Set the trigger

In Apps Script, go to Triggers → Add Trigger, choose pullRecentPayments, time-based, every 15 minutes. That’s it — the sheet fills itself.

Two quota notes before you scale this up: Apps Script executions are capped at 6 minutes per run, with daily totals for triggers of 90 minutes on consumer accounts and 6 hours on Workspace, and URL Fetch calls are limited to 20,000 per day on consumer accounts. At one call per 15 minutes you’re nowhere near any limit; if you ever process more than 100 charges per interval, add pagination to the fetch loop.

The push variant (webhooks), done safely

If you need real-time rows, the safest pattern that stays inside Apps Script is ping-and-fetch: the webhook tells your script that something happened, and the script re-fetches the event from Stripe’s API by ID before logging it. Stripe’s own guidance is to retrieve the object from the API rather than trust the payload, so you’re following the vendor’s recommended pattern anyway.

const SHEET_NAME = 'Payments';
const API_KEY_PROP = 'STRIPE_READ_KEY';

function doPost(e) {
  const ping = JSON.parse(e.postData.contents);
  const key = PropertiesService.getScriptProperties().getProperty(API_KEY_PROP);
  // Re-fetch the event from Stripe — never trust the posted body
  const resp = UrlFetchApp.fetch('https://api.stripe.com/v1/events/' + ping.id, {
    headers: { Authorization: 'Bearer ' + key }
  });
  const event = JSON.parse(resp.getContentText());
  if (event.type === 'checkout.session.completed' || event.type === 'charge.succeeded') {
    logEvent(event);
  }
  return ContentService.createTextOutput('OK');
}

function logEvent(event) {
  const d = event.data.object;
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(SHEET_NAME);
  const amountMinor = d.amount;
  const row = [
    event.id,
    d.payment_intent || d.id,
    d.id && d.id.startsWith('cs_') ? d.id : '',
    amountMinor,
    amountMinor != null ? amountMinor / 100 : '',
    d.currency ? d.currency.toUpperCase() : '',
    d.customer_details ? d.customer_details.email : (d.receipt_email || ''),
    d.description || '',
    d.status || 'succeeded',
    event.type,
    new Date(event.created * 1000).toISOString()
  ];
  // Skip duplicates: same event ID already logged?
  const ids = sheet.getRange(2, 1, Math.max(sheet.getLastRow() - 1, 1), 1).getValues();
  if (ids.flat().includes(event.id)) return;
  sheet.appendRow(row);
}

Because the script re-fetches every event from Stripe using your authenticated key, a forged POST to your script URL can’t inject fake rows — the worst it can do is make you look up an event ID that doesn’t exist. Deploy via Deploy → New deployment → Web app, execute as Me, access Anyone (Stripe must reach it), then in Stripe go to Developers → Webhooks → Add endpoint, paste the script.google.com/macros/s/.../exec URL, and select your events. Pick one event as your primary to avoid double-logging the same sale — if you use Checkout, log checkout.session.completed only; if you take raw card payments via Payment Intents, log charge.succeeded only. Then click Send test webhook and check your sheet.

If you want true signature verification at the edge, the cleaner architecture is a small relay (such as a Cloudflare Worker) that verifies the Stripe-Signature header and only then forwards the payload to your script. That’s more moving parts, but it’s the right call if the sheet feeds anything sensitive.

Handling refunds

Refunds arrive as their own events (charge.refunded / refund.created) or, in the pull variant, via https://api.stripe.com/v1/refunds. Log them as negative-amount rows with status refunded, keyed to the original charge ID. Two rules that save headaches later:

  • Never delete the original row. Append a refund row instead. Your sheet becomes an append-only ledger, which matches how Stripe itself works.
  • Sum column E (dollars) for net sales. With refunds as negatives, one SUM() gives you net revenue.

Reconciling with payouts

The number small-business owners actually need to close the books is Stripe’s payout — the lump sum that lands in your bank account, minus Stripe’s fees. Your per-transaction sheet will not match your bank deposits, because Stripe batches and fees sit on top. To reconcile:

  1. Once a month, export Payouts from the Stripe Dashboard (or add the payout.paid event to your webhook).
  2. In a second tab, list payout ID, arrival date, and amount.
  3. Compare each payout’s amount against the sum of your logged charges in that payout window, minus refunds, minus fees. Stripe’s payout JSON includes balance_transaction IDs that tie fees to individual charges if you want to go line-by-line.

If the numbers don’t match, the usual culprits are: a webhook delivery that failed during an outage (Stripe retries failed deliveries for up to three days in live mode — check Developers → Webhooks → your endpoint → attempts), a duplicate row from logging both event types, or a test-mode event landing in your live sheet. Use separate spreadsheets or a livemode column to keep test data out — test-mode events look identical to live ones, so tag or filter them deliberately.

One more caution: don’t treat the sheet as your books. It’s a convenience view. Your source of truth for taxes is Stripe’s own records and your accounting software; the sheet is for watching sales in real time.

Which route should you pick?

  • Under ~20 sales/month, bookkeeping only: Option 1 (manual CSV exports). Free, zero maintenance.
  • Want it live, no code, modest budget: Option 2 (Zapier/Make). Expect a recurring cost that scales with sales volume.
  • Comfortable pasting code, want free forever: Option 3. The pull variant is the recommended starting point — private and simple; the webhook variant is real-time but needs the ping-and-fetch pattern or a verifying relay.

All three log the same underlying Stripe data, so you can start with exports today and graduate to the script later without losing history — just keep the same column layout so old and new rows stay compatible.

Three arrows from Stripe to Google Sheets: CSV export is free and manual, Zapier or Make is paid and live, and Apps Script is free and live

CSV export, a paid connector, or a free Apps Script. All three write the same columns. Graphic: Ctrl Alt Orion.

Sources

5 refs
  1. Stripe: Verify webhook signaturesdocs.stripe.com
  2. Stripe: API keys (restricted keys)docs.stripe.com
  3. Google Apps Script: Web appsdevelopers.google.com
  4. Google Apps Script: Quotasdevelopers.google.com
  5. Stripe Sigmastripe.com

← All articles

comments

loading comments…

^ consulting ⌥ building ⌘ shipping