# Stripe

> How WinWinKit tracks revenue directly from Stripe.

WinWinKit supports tracking revenue from [Stripe](https://stripe.com) directly via Stripe webhooks — real-time events delivered by your Stripe account as charges happen.

## Stripe Webhooks

Once the integration is configured, Stripe sends a webhook to WinWinKit each time a relevant event occurs:

- **Initial purchase** — A successful first-time charge for a subscription or one-off product.
- **Renewal** — A subscription invoice is paid.
- **Refund** — A previous charge is refunded.

## What Gets Tracked

Each Stripe transaction recorded in WinWinKit includes:

- **Type** — Purchase, renewal, or refund.
- **Amount** — Gross revenue (the actual amount paid by the user), normalized to USD.
- **Stripe Customer ID** — Used to link the charge to a WinWinKit user.
- **Product identifier** — The Stripe product or price the user purchased.
- **Environment** — Test or live mode.

<Warning>
  Stripe revenue tracking currently only supports charges in **USD**. Charges
  in other currencies are received but not recorded as transactions.
</Warning>

## User Attribution

Stripe transactions are attributed to a WinWinKit user via the [Stripe Customer ID](/docs/users/introduction/#stripe-customer-id) set on the WinWinKit user.

## Setup

To enable Stripe revenue tracking:

1. In the WinWinKit dashboard, go to **Settings → Integrations → Stripe** and follow the on-screen instructions to obtain the WinWinKit webhook URL and signing secret.
2. In the [Stripe dashboard](https://dashboard.stripe.com), add that URL as a webhook endpoint and subscribe it to the events listed in the WinWinKit dashboard instructions.
3. When creating or updating a WinWinKit user, set the [Stripe Customer ID](/docs/users/introduction/#stripe-customer-id) so charges can be matched to the right user.
