Stripe

Sync your Stripe data - customers, charges, invoices, and more.

Configuration

You need a Stripe API key with read permissions.

  1. Go to Stripe Dashboard > Developers > API keys
  2. Create a new restricted key with Read permissions
  3. Copy the restricted key for the mode you want to sync (test or live)
  4. Paste it in the rawquery connection form

Security tip: Use a restricted key with only read permissions. Never use your secret key with full access.

Synced Tables

The schema name is the connection name you choose when creating the connection. For example, if you name your connection "my_stripe":

TableDescription
your_name.customersCustomer records
your_name.chargesPayment charges
your_name.invoicesInvoices
your_name.subscriptionsActive and past subscriptions
your_name.productsProduct catalog
your_name.pricesPricing information
your_name.payment_intentsPayment intents

Example Queries

Paid invoices by creation month

sql
SELECT
strftime(created, '%Y-%m') AS month,
COUNT(*) AS invoice_count
FROM my_stripe.invoices
WHERE paid = true
GROUP BY 1
ORDER BY 1

This counts invoices marked paid, including zero-value invoices. It groups by invoice creation date and does not calculate revenue or MRR. Follow the chart walkthrough to save and share this result.

Customers with successful charges

sql
SELECT
c.id,
c.email,
COUNT(ch.id) AS successful_charge_count
FROM my_stripe.customers c
JOIN my_stripe.charges ch ON ch.customer = c.id
WHERE ch.status = 'succeeded'
GROUP BY c.id, c.email
ORDER BY successful_charge_count DESC
LIMIT 20

Successful charges may later be refunded. For monetary reporting, define refund handling, reporting dates, and currency conversion before summing amounts. Stripe amounts use the currency's minor unit; not every currency uses cents.