# Superwall: Subscription Infrastructure for iOS, Android, and Web

Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue.

## Pricing

- **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge.
- **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed.

Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0.

## Scale

$1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow.

## Infrastructure capabilities

- **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN
- **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows
- **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe
- **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan

Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation.

## Migration

Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code).

## Paywall product (optional, separately billable)

One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release.

## Architecture

Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost.

## Docs

* Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall
* Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse
* Webhooks: https://superwall.com/docs/integrations/webhooks
* Pricing: https://superwall.com/pricing

# Restoring Purchases

Let users restore App Store and Google Play purchases with Superwall: add a Restore button to a paywall, call restorePurchases() from your app, customize the failure alert, and restore with a purchase controller.

Restoring gives a user back access they already paid for, for example after they reinstall your app or move to a new phone. Superwall can restore from a button on your paywall, or from anywhere in your app with one SDK call. Apple requires apps with in-app purchases to offer a way to restore them.

## Add a Restore button to a paywall

1. In the paywall editor, select the button or text you want users to tap.
2. Under **Tap Behavior**, choose **Restore**.
3. Publish the paywall.

When the user taps it, the SDK shows a loading state and restores their purchases with the App Store or Google Play:

* **If the restore gives the user an active entitlement**, the SDK tracks a `restoreComplete` event and dismisses the paywall. To keep the paywall open, set `automaticallyDismiss` to `false` in `SuperwallOptions.paywalls`.
* **If it doesn't**, the SDK tracks a `restoreFail` event and shows an alert: "No Subscription Found. We couldn't find an active subscription for your account."

A restore counts as successful only when the user ends up with an active entitlement, so a user whose subscription has expired gets the alert.

## Restore from your app

To restore from your own settings screen or purchase UI, call `restorePurchases()`:

## Tab

```swift iOS
let result = await Superwall.shared.restorePurchases()
```

## Tab

```kotlin Android
val result = Superwall.instance.restorePurchases()
```

## Tab

```dart Flutter
final result = await Superwall.shared.restorePurchases();
```

## Tab

```tsx Expo
const { restorePurchases } = useSuperwall();
const result = await restorePurchases();
```

The result says whether the restore itself succeeded, not whether the user is subscribed. Check the user's [subscription status](/docs/sdk/quickstart/tracking-subscription-state) after it returns. If you don't use a purchase controller and the user has no active entitlement, the SDK shows the same alert as the paywall's Restore button.

Restoring can ask the user to sign in to their App Store or Google account, so only restore when the user asks to.

## Customize the failure alert

Change the alert's text with `restoreFailed` in `SuperwallOptions.paywalls`:

## Tab

```swift iOS
let options = SuperwallOptions()
options.paywalls.restoreFailed.title = "No purchases found"
options.paywalls.restoreFailed.message = "Sign in with the account you used to subscribe."
options.paywalls.restoreFailed.closeButtonTitle = "OK"
Superwall.configure(apiKey: "MY_API_KEY", options: options)
```

## Tab

```kotlin Android
val options = SuperwallOptions()
options.paywalls.restoreFailed.title = "No purchases found"
options.paywalls.restoreFailed.message = "Sign in with the account you used to subscribe."
options.paywalls.restoreFailed.closeButtonTitle = "OK"
Superwall.configure(this, apiKey = "MY_API_KEY", options = options)
```

For the other SDKs, see [SuperwallOptions](/docs/sdk/guides/configuring#custom-restore-failure-message).

## Restore with a purchase controller

If you handle purchases yourself with a [purchase controller](/docs/sdk/guides/advanced-configuration), the SDK calls your controller's `restorePurchases()` when the user taps **Restore**. Restore with your own code, update the user's subscription status, and then return the result:

## Tab

```swift iOS
func restorePurchases() async -> RestorationResult {
  // Restore with StoreKit or your purchase SDK, then set
  // Superwall.shared.subscriptionStatus before returning.
  return .restored // Or .failed(error)
}
```

## Tab

```kotlin Android
override suspend fun restorePurchases(): RestorationResult {
  // Restore with Google Play Billing or your purchase SDK, then set
  // Superwall.instance.setSubscriptionStatus(...) before returning.
  return RestorationResult.Restored() // Or RestorationResult.Failed(error)
}
```

Set the subscription status before you return `restored`. The SDK checks it right away, and if the user has no active entitlement yet, it treats the restore as failed and shows the alert.

If you use RevenueCat, see [Using RevenueCat](/docs/sdk/guides/using-revenuecat).

## Restoring web checkout purchases

If your app sells through [Web Checkout](/docs/web-checkout), a store restore doesn't find web purchases. When the store restore doesn't cover the paywall's products, the SDK asks the user whether they'd like to restore on the web. Turn this alert off with `shouldShowWebRestorationAlert` in `SuperwallOptions.paywalls`. For how web purchases are restored, see [Restoring & Managing Purchases](/docs/web-checkout/web-checkout-managing-memberships).

## Test a restore

* In test mode ([iOS](/docs/ios/guides/test-mode), [Android](/docs/android/guides/test-mode)), tapping **Restore** lets you pick which entitlements to restore, without a sandbox account.
* On iOS, sandbox purchases can stay active after you reset a test account. See [Sandbox Entitlements Persist After Reset](/docs/support/troubleshooting/troubleshooting-sandbox-entitlements-persist).
* If a free trial doesn't show after reinstalling in sandbox, restore first. See [Sandbox Free Trial Isn't Appearing](/docs/support/troubleshooting/troubleshooting-sandbox-free-trial-not-showing).

## Related

* [Tracking Subscription State](/docs/sdk/quickstart/tracking-subscription-state)
* [Customer Center](/docs/ios/guides/customer-center), a screen where users can restore and manage their purchases
* [Styling Elements: Tap Behaviors](/docs/dashboard/dashboard-creating-paywalls/paywall-editor-styling-elements#tap-behaviors)