View Categories

How to Connect Stripe to Google Sheets – Query Payment Data with SQL

5 min read

Query Streams connects your Stripe account to Google Sheets as SQL-queryable tables—customers, invoices, subscriptions, charges, and more, all accessible with standard SQL. No API programming, no manual exports, no CSV juggling. Just write SQL and get live Stripe data in your spreadsheet. Sign up free at QueryStreams.com and start querying your Stripe account in minutes.

15 Stripe Tables

Customers, invoices, subscriptions, charges, balance transactions, and more

Near Real-Time

Charges and payment intents sync as frequently as every 5 minutes

AES-256 Encrypted

API keys and cached data stored securely on your network—never in the cloud

Zero API Exposure

Share revenue reports with teammates without ever revealing your Stripe key

What Stripe Data Can You Access?

Query Streams syncs your Stripe API data to an AES-256 encrypted local cache, transforming it into 15 SQL-queryable tables. Every table includes a raw_data JSON column with the complete Stripe API response—including all metadata fields.

Core Business

  • customers Customer records with billing info and metadata
  • payment_intents Modern payment flow tracking
  • invoices Billing records and due dates
  • subscriptions Recurring billing subscriptions
  • charges Payment charges (legacy and current)

Financial & Reconciliation

  • balance_transactions Complete ledger (fees, payouts, transfers)
  • refunds Money returned to customers
  • payouts Bank transfer tracking
  • disputes Chargebacks and fraud cases

Catalog & Pricing

  • products Product catalog
  • prices Pricing tiers and configurations
  • coupons Discount codes and promotions

Activity & Detail

  • events Webhook backup and audit trail
  • invoice_items Line-item billing detail
  • subscription_items Multi-product subscription breakdowns

Prerequisites

1
Query Streams Account

Sign up free — no credit card required

2
Query Streams Network Agent

Windows service installed on your network. Install guide

3
Stripe Account

Any Stripe account with API access (live or test mode)

4
Stripe Secret API Key

Starts with sk_live_ or sk_test_ — from your Stripe Dashboard

5
Google Sheets

With the Query Streams add-on installed from Google Workspace Marketplace

Setup Guide

1Install Agent
2Get API Key
3Add Connector
4Sync Schedule
5Install Add-on

Step 1: Install the Query Streams Network Agent

  1. Log in to my.querystreams.com
  2. Navigate to Network Agents in the left sidebar
  3. Click Download Agent and run the Windows installer
  4. The agent installs as a Windows service and connects automatically
  5. Your agent appears as “Online” in the portal within 30 seconds

The Network Agent creates a secure, outbound-only connection — no inbound firewall ports, no VPN required. Your Stripe API key never leaves your network.

Step 2: Get Your Stripe Secret API Key

  1. Log in to your Stripe Dashboard
  2. Click Developers in the top navigation
  3. Select API keys from the left sidebar
  4. Copy your Secret key (starts with sk_live_ for production or sk_test_ for testing)
  5. Keep this key secure — it provides full read access to your Stripe data

Use the Secret key, not the Publishable key. The publishable key (starting with pk_) cannot authenticate API requests. Query Streams only performs read operations — it never modifies your Stripe data.

Step 3: Add the Stripe Connector

  1. Open the Network Agent interface at http://localhost:1823
  2. Click Add Connection and select Stripe
  3. Paste your Secret API Key into the API Key field
  4. Click Test Connection — Query Streams validates your key with Stripe
  5. On success, you’ll see confirmation of your account mode (Live or Test)
  6. Click Next to proceed to sync configuration

Step 4: Configure Your Sync Schedule

Charges / Payment IntentsEvery 5 minutes
Invoices / SubscriptionsEvery 15 minutes
Customers / RefundsEvery 15 minutes
Balance TransactionsEvery 30 minutes
Products / PricesHourly
Events / DisputesDaily

All 15 tables sync by default. Disable any table by setting its interval to Never. Click Save — the initial sync starts immediately.

Step 5: Install the Google Sheets Add-on

  1. Open Google Sheets in your browser
  2. Go to ExtensionsAdd-onsGet add-ons
  3. Search for “Query Streams”
  4. Click Install and grant the required permissions
  5. Access it via ExtensionsQuery StreamsOpen
  6. Sign in with your Query Streams account credentials
  7. Or install directly: Install Query Streams for Google Sheets

You’re connected! Open Query Streams in Google Sheets, click Saved Queries, and find your Stripe folder with pre-built queries. Select any query and click Run to pull live Stripe data into your spreadsheet.

Example Stripe SQL Queries

Monthly Revenue Summary
SELECT
    DATE_TRUNC('month', created) AS month,
    COUNT(*) AS charge_count,
    SUM(amount) / 100.0 AS gross_revenue,
    SUM(CASE WHEN refunded THEN amount_refunded ELSE 0 END) / 100.0 AS refunds,
    (SUM(amount) - SUM(CASE WHEN refunded THEN amount_refunded ELSE 0 END)) / 100.0 AS net_revenue
FROM stripe.charges
WHERE status = 'succeeded'
  AND created >= CURRENT_DATE - INTERVAL '12 months'
GROUP BY DATE_TRUNC('month', created)
ORDER BY month DESC;
Active Subscriptions by Plan
SELECT
    p.name AS product_name,
    pr.nickname AS plan_name,
    pr.interval AS billing_interval,
    pr.unit_amount / 100.0 AS price,
    COUNT(s.id) AS active_subscribers,
    COUNT(s.id) * pr.unit_amount / 100.0 AS mrr_contribution
FROM stripe.subscriptions s
JOIN stripe.subscription_items si ON si.subscription = s.id
JOIN stripe.prices pr ON pr.id = si.price
JOIN stripe.products p ON p.id = pr.product
WHERE s.status = 'active'
GROUP BY p.name, pr.nickname, pr.interval, pr.unit_amount
ORDER BY mrr_contribution DESC;
Failed Payment Analysis
SELECT
    DATE(created) AS date,
    failure_code,
    failure_message,
    COUNT(*) AS failure_count,
    SUM(amount) / 100.0 AS lost_revenue
FROM stripe.charges
WHERE status = 'failed'
  AND created >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY DATE(created), failure_code, failure_message
ORDER BY date DESC, failure_count DESC;

Share Stripe Reports Without Sharing Credentials

Open any Stripe query in the Query Builder → click the Sharing tab → enter teammate email addresses → click Share. Recipients get the query in their Google Sheets add-on only. They run it on-demand to get live data — your Stripe API key is never exposed, and they never see the SQL code.

Frequently Asked Questions

Can I use my Stripe test mode API key?
Yes. Query Streams works with both live (sk_live_) and test (sk_test_) API keys. Test mode is ideal for evaluating the integration before connecting your production account.
What is the difference between charges and payment_intents?
Charges represent individual payment transactions. Payment Intents are the modern Stripe payment flow object tracking the full payment lifecycle. For historical reporting, use charges; for new integrations, use payment_intents.
How much historical Stripe data does Query Streams sync?
By default, Query Streams syncs the most recent data for each table. You can adjust the lookback window in the connector settings. The initial sync may take several minutes for accounts with large transaction volumes.
Can I connect multiple Stripe accounts?
Yes. You can add multiple Stripe connections to a single agent — each with a different API key. Each connection appears as a separate data source in the query builder, letting you query and compare multiple Stripe accounts in the same SQL query.

Related Guides

Category: API Connectors

Tags: Stripe, Google Sheets, API, Payment Data, SQL, Revenue Analytics, Subscriptions, Real-Time Data

Meta Description: Connect Stripe to Google Sheets with SQL. Query customers, invoices, subscriptions, and charges live — no API coding required. Step-by-step setup guide.

Updated on June 3, 2026

Powered by BetterDocs