# App Store

> How WinWinKit tracks revenue directly from the Apple App Store.

WinWinKit supports tracking revenue from the [App Store](https://apps.apple.com) directly via **App Store Server Notifications V2** — real-time webhooks delivered by Apple as transactions happen.

## App Store Server Notifications

Once the integration is configured, Apple sends a notification to WinWinKit each time a relevant event occurs in your app:

- **Initial purchase** — A user buys a subscription or in-app purchase for the first time.
- **Renewal** — A subscription auto-renews.
- **Refund** — Apple issues a refund for a previous purchase.
- **Trial** — A user starts a free trial.

## What Gets Tracked

Each App Store transaction recorded in WinWinKit includes:

- **Type** — Purchase, renewal, refund, or trial.
- **Amount** — Gross revenue (the actual amount paid by the user), normalized to USD.
- **Original transaction ID** — Used to link renewals and refunds back to the original purchase.
- **Product identifier** — The App Store product the user bought.
- **Environment** — Sandbox or production.

## User Attribution

App Store transactions are attributed to a WinWinKit user via the **original transaction ID** and, when available, Apple's **`appAccountToken`**.

## Setup

To enable App Store revenue tracking:

1. In the WinWinKit dashboard, go to **Settings → Integrations → App Store Server Notifications** and follow the on-screen instructions to obtain the App Store Server Notifications V2 URL.
2. In [App Store Connect](https://appstoreconnect.apple.com), set that URL as the **Production Server URL** (and **Sandbox Server URL**, if you want sandbox transactions to appear) for your app.
3. In your app, use the WinWinKit SDK's method for registering or syncing transactions after a purchase completes, so WinWinKit can associate the transaction with the user.

<Info>
  If your app uses RevenueCat and you prefer tracking revenue from the App
  Store directly, you do not need to change the Server Notifications URL in
  App Store Connect. Instead, set the WinWinKit webhook URL in the RevenueCat
  dashboard — RevenueCat will forward the underlying App Store events to
  WinWinKit.
</Info>

## No-Code Integration

For the [Affiliates](/docs/affiliates/introduction/) feature, App Store apps can be configured for revenue tracking and attribution without any SDK or backend code changes — the entire flow runs through Apple's own Offer Code redemption and the App Store Connect API.

See the [No-Code Integration guide](/docs/affiliates/no-code/) for requirements, limitations, and setup steps.
