# Stripe payment platform - Docs

When using revenue analytics, you can connect Stripe to PostHog as a source of revenue data. Revenue analytics will automatically use the data from Stripe to build your [revenue dashboard](/docs/revenue-analytics/dashboard.md).

**Already have a Stripe-connected source?**

If you already have a Stripe-connected source, you can access the [revenue analytics settings](https://app.posthog.com/data-management/revenue) page and turn on the **Stripe** toggle to connect to your Stripe data.

![Turn on Stripe in revenue analytics settings](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/pasted_image_2025_09_15_T19_19_35_872_Z_c1dc6ac4dc.png)![Turn on Stripe in revenue analytics settings](https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/pasted_image_2025_09_15_T19_19_10_100_Z_b2634feed1.png)

The Stripe connector can link charges, customers, invoices, prices, products, subscriptions, and balance transactions to PostHog.

## Creating a Stripe API key

You need a [Stripe API key](https://dashboard.stripe.com/apikeys) to create a connector. Head to your Stripe dashboard > **Developers** > **API keys**, under **Restricted keys**, click [\+ Create a restricted key](https://dashboard.stripe.com/apikeys/create).

You need to give your API key the following **Read** permissions in the **Permissions** column:

| Resource Type | Required Read Permissions |
| --- | --- |
| Core | Balance transaction sources, Charges, Customers, Disputes, Payouts, Products |
| Billing | Credit notes, Invoices, Prices, Subscriptions |
| Connect | Click Read in the Connect header |

If you aren't concerned with giving us more permissions than necessary, you can also simply click **Read** on the **Core**, **Billing**, and **Connect** headers to give us the necessary permissions.

If your Stripe account is in a language other than English, we suggest you update it to English before following the steps above to guarantee the correct permissions are set.

## Adding a data source

1.  In PostHog, go to the [Data pipeline page](https://app.posthog.com/data-management/sources) select the **Sources** tab.
2.  Click **\+ New source** button and select Stripe by clicking the **Link** button.
3.  In Stripe, get your Account ID by going to **Settings** > **Business**, selecting the [Account details](https://dashboard.stripe.com/settings/account) tab, and clicking your **Account ID** or pressing `⌘` + `I` to copy your ID.
4.  Get your API key from the [previous section](#creating-a-stripe-api-key)
5.  *Optional:* Add a prefix to your table names
6.  Click **Next**

> For Stripe tables, incremental syncs only sync new records and don't update existing records. This is a limitation of the Stripe API. To get real-time updates including changes to existing records, [set up webhooks](#setting-up-webhooks-for-real-time-syncing).

The data warehouse then starts syncing your Stripe data. You can see details and progress in the [data pipeline sources tab](https://app.posthog.com/data-management/sources).

## Setting up webhooks for real-time syncing

By default, Stripe data syncs on a schedule. You can set up webhooks to get real-time updates instead, including changes to existing records.

To set up a webhook:

1.  Go to your Stripe source in the [data pipeline sources tab](https://app.posthog.com/data-management/sources).
2.  Click the **Webhook** tab.
3.  Click **Create webhook**.

PostHog automatically creates and registers the webhook on your Stripe account. Once set up, you can view the webhook status, including both PostHog's internal status and the Stripe-side webhook status, from the **Webhook** tab.

## How is the data stored?

Your data will be imported and transformed into a set of [managed views](/docs/revenue-analytics/managed-views.md). Revenue analytics will use these views to build your [revenue dashboard](/docs/revenue-analytics/dashboard.md) automatically.

You can also use these views in the [SQL editor](/docs/data-warehouse/query.md) to run custom queries and visualize the data.

## Deferred revenue

PostHog will automatically defer revenue recognition to match your accounting practices. This means we spread the revenue across all the months a charge is relevant for. You can read more about this on the [deferred revenue](/docs/revenue-analytics/deferred-revenue.md) page.

## Connect to customers

You can link your Stripe customers to your [persons](/docs/data/persons.md) and [groups](/docs/product-analytics/group-analytics.md) in PostHog. This helps you identify your top customers and see how much revenue they're generating.

You can learn more about this on the [connect to customers](/docs/revenue-analytics/connect-to-customers.md) page.

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better