Skip to content

feat: add Stripe integration with 9 tables and 5 report templates#78

Merged
Empreiteiro merged 1 commit intomainfrom
feature/stripe-integration
Mar 18, 2026
Merged

feat: add Stripe integration with 9 tables and 5 report templates#78
Empreiteiro merged 1 commit intomainfrom
feature/stripe-integration

Conversation

@Empreiteiro
Copy link
Copy Markdown
Owner

Summary

  • Add Stripe as a new data source integration (source type: stripe)
  • Supports 9 resource tables: customers, subscriptions, invoices, charges, products, prices, refunds, payouts, disputes
  • Includes 5 built-in report templates: MRR & Revenue, Subscription Analytics, Payment Health, Customer Insights, Payout Summary
  • Auth via Bearer token (Stripe Secret API Key sk_...)
  • Cursor-based pagination using starting_after / has_more
  • Uses LLM + SQLite pattern consistent with other integrations (REST API, etc.)
  • Frontend form with test connection, resource discovery, and table selection
  • i18n translations for EN, PT, ES

New files

  • backend/app/scripts/ask_stripe.py - Q&A logic with Stripe API fetching, SQLite loading, and LLM interaction
  • backend/app/routers/stripe_router.py - FastAPI endpoints: test-connection, discover, refresh-metadata
  • src/components/StripeSourceForm.tsx - React form component with password input, test button, resource preview

Modified files

  • backend/app/routers/ask.py - Route stripe source type to ask_stripe
  • backend/app/routers/crud.py - Add stripe to valid source types
  • backend/app/main.py - Register stripe_router
  • src/components/AddSourceModal.tsx - Add Stripe to source options and render form
  • src/services/apiClient.ts - Add stripeTestConnection, stripeDiscover, stripeRefreshMetadata
  • src/contexts/LanguageContext.tsx - Add i18n keys for EN, PT, ES

Test plan

  • Verify npm run typecheck passes (confirmed)
  • Test connection with a Stripe test API key (sk_test_...)
  • Verify resource discovery lists all 9 tables with sample counts
  • Connect Stripe source and ask natural language questions about payments/subscriptions
  • Verify report templates generate meaningful answers
  • Test with empty Stripe account (no data) - should handle gracefully

Closes #66

🤖 Generated with Claude Code

Add full Stripe integration allowing users to connect their Stripe
account and query customers, subscriptions, invoices, charges, products,
prices, refunds, payouts, and disputes using natural language.

New files:
- backend/app/scripts/ask_stripe.py: Q&A engine for Stripe data
- backend/app/routers/stripe_router.py: test-connection, discover, refresh endpoints
- src/components/StripeSourceForm.tsx: frontend form with API key input and resource discovery

Modified files:
- backend/app/routers/ask.py: route Stripe source type to ask_stripe
- backend/app/routers/crud.py: add "stripe" to valid source types
- backend/app/main.py: register stripe_router
- src/components/AddSourceModal.tsx: add Stripe to source picker
- src/services/apiClient.ts: add stripeTestConnection, stripeDiscover, stripeRefreshMetadata
- src/contexts/LanguageContext.tsx: add Stripe i18n keys for EN, PT, ES

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Empreiteiro Empreiteiro force-pushed the feature/stripe-integration branch from f9872e8 to b384dd0 Compare March 18, 2026 21:45
@Empreiteiro Empreiteiro merged commit 5c91c9e into main Mar 18, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Stripe integration with fixed schema and report templates

1 participant