# Stripe Integration (/docs/revenue/stripe)



## Setup [#setup]

Stripe connects via Stripe Connect OAuth, initiated from the project's
Revenue layer settings:

1. Install the Revenue layer on the project.
2. In layer settings, click **Connect Stripe**.
3. You're redirected to Stripe's OAuth flow, where you authorize the
   Layers platform to read subscription data from your Stripe account.
4. On callback, Layers stores the connected-account reference as a
   `stripe_connect_accounts` row linked to the project.

## Webhook setup [#webhook-setup]

Layers exposes `POST /api/webhooks/stripe-revenue` and verifies
requests using Stripe's standard signature scheme. Subscription and
charge events are stored in revenue events, keyed by `event.account`
to route to the correct connected account.

The webhook endpoint is registered once at the Layers platform level
and routes events across all connected accounts.

## What gets synced [#what-gets-synced]

An hourly Stripe sync runs per connected account, pulling subscription
state and writing into Layers' metrics tables:

* MRR, ARR, active subscribers, active trials.
* Churn rate, LTV.
* 7-day and 30-day revenue and new-subscriber totals.

## Multi-account [#multi-account]

Stripe Connect supports multiple connected accounts per Layers project
(each creates its own `stripe_connect_accounts` row). Filter the
dashboard by account in the top-nav picker.

## Disconnect [#disconnect]

From the layer settings, click **Disconnect**. The connection is
revoked on Layers' side. Historical metrics already written to Layers
remain visible.
