Stripe
Sync your Stripe data - customers, charges, invoices, and more.
Configuration
You need a Stripe API key with read permissions.
- Go to Stripe Dashboard > Developers > API keys
- Create a new restricted key with Read permissions
- Copy the key (starts with
sk_live_orsk_test_) - 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":
| Table | Description |
|---|---|
| your_name.customers | Customer records |
| your_name.charges | Payment charges |
| your_name.invoices | Invoices |
| your_name.subscriptions | Active and past subscriptions |
| your_name.products | Product catalog |
| your_name.prices | Pricing information |
| your_name.payment_intents | Payment intents |
Example Queries
Monthly Recurring Revenue
sql
SELECT DATE_TRUNC('month', created) AS month, SUM(amount) / 100.0 AS mrrFROM my_stripe.chargesWHERE status = 'succeeded'GROUP BY 1ORDER BY 1 DESCSELECT DATE_TRUNC('month', created) AS month, SUM(amount) / 100.0 AS mrrFROM my_stripe.chargesWHERE status = 'succeeded'GROUP BY 1ORDER BY 1 DESCTop Customers by Revenue
sql
SELECT c.email, c.name, COUNT(ch.id) AS charge_count, SUM(ch.amount) / 100.0 AS total_revenueFROM my_stripe.customers cJOIN my_stripe.charges ch ON ch.customer = c.idWHERE ch.status = 'succeeded'GROUP BY c.id, c.email, c.nameORDER BY total_revenue DESCLIMIT 20SELECT c.email, c.name, COUNT(ch.id) AS charge_count, SUM(ch.amount) / 100.0 AS total_revenueFROM my_stripe.customers cJOIN my_stripe.charges ch ON ch.customer = c.idWHERE ch.status = 'succeeded'GROUP BY c.id, c.email, c.nameORDER BY total_revenue DESCLIMIT 20