# Stripe Integration

> Stripe billing events as a signal source. Trial-to-paid conversions, plan upgrades, payment failures, churn — joined with product behavior for sharper signals.

*Source: [https://www.getbeton.ai/integrations/stripe/](https://www.getbeton.ai/integrations/stripe/)*

**Category:** source
**Vendor URL:** https://stripe.com

## How it works

1. **Add a Stripe restricted key** — Generate a restricted API key (read-only on customers, subscriptions, invoices, charges, events). Paste it into Beton — no webhook setup required.
2. **Beton joins billing with product behavior** — Subscription state changes, plan switches, failed charges, and trial conversions are joined with PostHog/Postgres events on email or domain. Signals carry both contexts.
3. **Backtest revenue-grade hypotheses** — Hypotheses like "trialists who hit feature X within 3 days convert at Y%" are validated against actual paid conversions in your Stripe history.

## Features

- Restricted-key OAuth — read-only, scoped, revocable
- Subscription, invoice, charge, and customer events ingested
- Auto-joined with product analytics on email and domain
- Trial-conversion and expansion hypotheses validated on real revenue outcomes
- Failed-payment and downgrade signals route to CRM as churn-risk
- Works with Stripe test mode for staging environments

## Use cases

- Detect trial users likely to convert before the trial ends
- Spot accounts about to upgrade based on usage + billing trajectory
- Catch payment-failure churn signals and route to CS
- Validate "feature X drives expansion" claims against actual MRR data

## Sample payload

```json
{
  "signal_type": "trial_about_to_convert",
  "confidence": 0.88,
  "sources": ["stripe", "posthog"],
  "account": { "email": "jane@acme.com", "domain": "acme.com" },
  "stripe": {
    "subscription_status": "trialing",
    "trial_end": "2026-05-04",
    "plan_amount": 4900
  },
  "product_events": ["workspace_invited_teammate", "api_key_created", "workflow_published"]
}
```
