# RevenueCat

> How WinWinKit tracks revenue via the RevenueCat integration.

WinWinKit supports tracking revenue via [RevenueCat](https://revenuecat.com) — a third-party subscription management platform that aggregates revenue across the App Store, Google Play, and Stripe.

## RevenueCat Webhooks

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

- **Initial purchase** — A user makes their first purchase.
- **Renewal** — A subscription renews.
- **Non-renewing purchase** — A one-off, non-subscription purchase.
- **Refund / Cancellation** — A previous purchase is refunded or cancelled.
- **Expiration** — A subscription lapses.

## What Gets Tracked

Each RevenueCat transaction recorded in WinWinKit includes:

- **Type** — Initial purchase, renewal, refund, non-renewing purchase, or trial.
- **Amount** — Gross revenue (the actual amount paid by the user), normalized to USD.
- **Store** — The underlying platform reported by RevenueCat (App Store, Google Play, Stripe, etc.).
- **Product identifier** — The product the user purchased.
- **Environment** — Sandbox or production.

## User Attribution

RevenueCat transactions are attributed to a WinWinKit user via the **App User ID** sent by RevenueCat in the webhook event.

## Setup

To enable RevenueCat revenue tracking:

1. In the WinWinKit dashboard, go to **Settings → Integrations → RevenueCat** and follow the on-screen instructions to obtain the WinWinKit webhook URL and authentication header.
2. In the [RevenueCat dashboard](https://app.revenuecat.com), add that URL as a webhook for your project.
3. Use the same App User ID in RevenueCat and WinWinKit so transactions can be matched to the right user.
