# 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

# Elements Checkout Events

Which purchase callbacks fire, in what order, for an Elements form, its wallets, Superwall's Apple Pay sheet and the payment sheet.

An Elements checkout reports its purchases through the same five callbacks as every other purchase: `onStart`, `onSubmit`, `onComplete`, `onAbandon` and `onFailure`. This page says which listener hears a purchase, and the order the callbacks fire in for each way a shopper can pay.

## Who hears what

There are two places to listen:

* **`usePurchase(options)`** hears every purchase on the paywall, whichever component started it. That includes the form's purchases and Superwall's Apple Pay sheet opened from your own button.
* **`<StripeCheckout>`'s callbacks** hear only that form's purchases: a card paid with `submit()` or `<PurchaseButton>`, and a wallet or Link paid in its `ExpressCheckoutElement`.

```tsx
const { purchase } = usePurchase({
  onAbandon: () => track("checkout_abandoned"),
});

<StripeCheckout product={plan} onFailure={(failure) => setError(failure.message)}>
  …
</StripeCheckout>;
```

The native SDK also gets the matching `stripe_checkout_*` messages, such as `stripe_checkout_start`, `stripe_checkout_complete` and `stripe_checkout_abandon`, as for the sheet and Apple Pay. A form purchase reaches the SDK's analytics, including its `transaction_abandon`.

The callbacks don't say which payment method paid. A paywall that needs to know can tell from which of its buttons the shopper used.

## In an Elements form

| What the shopper does                              | Callbacks, in order                                          |
| -------------------------------------------------- | ------------------------------------------------------------ |
| Pays with a card                                   | `onStart`, `onSubmit`, `onComplete`                          |
| Pays with an incomplete form or no email           | None: `submit()` returns `incomplete`                        |
| Card declined                                      | `onStart`, `onSubmit`, `onFailure`                           |
| Pays again after a decline                         | A new `onStart`, then as above                               |
| Fails 3D Secure                                    | `onStart`, `onSubmit`, `onFailure`                           |
| Opens Link or a wallet in `ExpressCheckoutElement` | `onStart`                                                    |
| … and pays                                         | `onSubmit`, `onComplete`                                     |
| … and closes it before authorizing                 | `onAbandon`                                                  |
| Taps Superwall's Apple Pay button and pays         | `onStart`, `onSubmit`, `onComplete`, from `usePurchase` only |
| … and closes the sheet before authorizing          | `onAbandon`, from `usePurchase` only                         |

A wallet close counts as abandoned only before the shopper authorizes the payment. Once they've authorized it, closing the wallet reports nothing: the purchase goes on and ends in `onComplete` or `onFailure`. A card payment opens no sheet, so it has nothing to close: a card form never reports `onAbandon`. A decline keeps the form open, `useCheckout().failure` holds the failure until the next payment starts, and each retry is a purchase of its own.

## Across checkout modes

The same callbacks mean slightly different things in each mode:

| Callback     | Payment sheet (`sheet`)                                    | Apple Pay (`applePay`)                            | Elements form (`elements`)                                                       |
| ------------ | ---------------------------------------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------- |
| `onStart`    | The sheet opens.                                           | The wallet opens.                                 | `submit()` starts paying, or a wallet or Link opens in `ExpressCheckoutElement`. |
| `onSubmit`   | The shopper submits payment in the sheet.                  | The shopper authorizes the payment.               | The form is read, or a wallet authorizes the payment.                            |
| `onComplete` | The purchase was paid.                                     | The purchase was paid.                            | The purchase was paid.                                                           |
| `onAbandon`  | The shopper closes the sheet without trying to pay.        | The shopper closes the wallet before authorizing. | The shopper closes a wallet or Link before authorizing. Never for a card.        |
| `onFailure`  | Each decline, while the sheet stays open for another card. | The payment fails.                                | Each failed payment; the form stays open.                                        |

Closing the sheet after a decline isn't an abandon: the purchase resolves `failed` with the latest failure. See [Callbacks](/docs/framework/payment-failures#callbacks) for each callback's timing on other hosts, and [Payment failure reasons](/docs/framework/payment-failures) for what `onFailure` receives.

## Related

* [Elements Checkout](/docs/framework/elements-checkout): build the form
* [Elements Checkout Reference](/docs/framework/elements-checkout/reference): `submit()` results and every callback prop
* [Purchases](/docs/framework/purchases#callbacks): callbacks on `usePurchase` and `purchase()`