# 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

# Migrate a Stripe Checkout to Elements Checkout

Move an existing custom Stripe Elements checkout onto Superwall in 8 steps: keep your elements and design, and delete your payment backend.

If you already run a custom checkout on Stripe Elements, you can move it onto a Superwall paywall and keep almost all of its front end. Your elements, their options and your design stay. Your `<Elements>` provider, the endpoint that creates the PaymentIntent or subscription, the `confirmPayment()` call and the webhook that grants access go: Superwall does that part.

| Your checkout today                                  | With Superwall                                                      |
| ---------------------------------------------------- | ------------------------------------------------------------------- |
| `<Elements stripe={...} options={{ clientSecret }}>` | `<StripeCheckout product="annual">`                                 |
| Elements from `@stripe/react-stripe-js`              | The same elements from `superwall/checkout/stripe`                  |
| `elements.submit()` and `stripe.confirmPayment()`    | `useCheckout().submit()` or `<PurchaseButton>`                      |
| A server endpoint that creates the PaymentIntent     | Nothing: Superwall creates the subscription                         |
| A webhook that grants access                         | Nothing: Superwall grants the entitlement and redeems it in the app |
| Metadata on the subscription                         | `stripeMetadata` on `<StripeCheckout>`                              |

## Requirements

* Your Stripe account connected and your products set up in the dashboard, see [Web Checkout](/docs/web-checkout).
* Subscription prices. One-time prices, redirect methods (iDEAL, Klarna) and bank debits (SEPA, ACH) aren't supported yet, see [Which elements work](/docs/framework/elements-checkout/reference#which-elements-work).

## Steps

## Set the mode

Set `checkout` to `elements` in `config.ts`, and list your Stripe products:```ts title="config.ts"
export default definePaywall({
  products: {
    annual: "live:price_1QxAnnual:no-trial",
  },
  checkout: { mode: "elements" },
});
```See [Products](/docs/framework/products#web-and-stripe-products) for the identifier format.

## Swap the provider

Replace `<Elements>` with `<StripeCheckout>`. Move `appearance`, `fonts`, `locale` and `paymentMethodTypes` into its `options`. Drop `clientSecret`, `mode`, `amount` and `currency`: they come from the product.```tsx
// Before
<Elements stripe={stripePromise} options={{ clientSecret, appearance, fonts }}>
  <CheckoutForm />
</Elements>

// After
import { StripeCheckout } from "superwall/checkout/stripe";

<StripeCheckout product="annual" options={{ appearance, fonts }}>
  <CheckoutForm />
</StripeCheckout>
```You don't call `loadStripe()`: Superwall loads Stripe.js with your app's key.

## Keep the elements

Change the import, nothing else. The elements take the same props:```tsx
// Before
import { PaymentElement, AddressElement } from "@stripe/react-stripe-js";

// After
import { PaymentElement, AddressElement } from "superwall/checkout/stripe";
```Import every element from `superwall/checkout/stripe`. Your own copy of `@stripe/react-stripe-js` has its own React context, so its elements can't see `<StripeCheckout>` and throw "Could not find Elements context". You can remove the package once nothing imports it.

## Swap the submit

Where you called `elements.submit()` and `stripe.confirmPayment()`, call `useCheckout().submit()`. It validates the fields, pays, runs 3D Secure and the free trial, and completes the purchase:```tsx
import { useCheckout } from "superwall/checkout";

const PayButton = () => {
  const { canSubmit, submit } = useCheckout();
  const [problem, setProblem] = React.useState<string>();
  return (
    <>
      {problem ? <p role="alert">{problem}</p> : null}
      <button
        disabled={!canSubmit}
        onClick={async () => {
          setProblem(undefined);
          const result = await submit();
          if (result.status === "incomplete") setProblem(result.error.message);
        }}
      >
        Subscribe
      </button>
    </>
  );
};
```Or render `<PurchaseButton>`, which does this and disables itself while it pays. See [`submit()` results](/docs/framework/elements-checkout/reference#submit-results).

## Collect the email

Every purchase needs an email. Keep `LinkAuthenticationElement`, or pass your own field's value as `<StripeCheckout email>`, with `""` while it's empty:```tsx
const [email, setEmail] = React.useState("");

<StripeCheckout product="annual" email={email}>
  <input type="email" value={email} onChange={(event) => setEmail(event.target.value)} />
  {/* card fields */}
</StripeCheckout>;
```Without an email, `submit()` returns `incomplete` with `email_required` and charges nothing. `<PurchaseButton>` doesn't show that error, so a form with its own email box should use its own button, as in the previous step.

## Move the metadata

What you set on the subscription goes in `stripeMetadata`:```tsx
<StripeCheckout product="annual" stripeMetadata={{ campaign: "spring", source: "web" }}>
```It's the same option as on `purchase()`, see [Custom metadata on the sale](/docs/framework/web-checkout#custom-metadata-on-the-sale).

## Delete the backend

Remove the endpoint that created the PaymentIntent or subscription, and the webhook that granted access. Superwall creates the subscription, grants the entitlement and redeems it in the app. If other systems read your old webhook, point them at [Superwall's webhooks](/docs/integrations/webhooks) instead.

## Move the reactions

Your success and error handling moves to the callbacks on `<StripeCheckout>`, or to `usePurchase()`'s:```tsx
<StripeCheckout
  product="annual"
  onComplete={() => track("subscribed")}
  onFailure={(failure) => setError(failure.message ?? "Your payment was declined.")}
  onAbandon={() => track("checkout_abandoned")}
>
```There's no return URL to handle: the form completes on the page. See [Elements Checkout Events](/docs/framework/elements-checkout/events) for which callback fires when.

## Limitations

* **Saved cards aren't offered.** The form pays as a new customer each time.
* **No shipping, tax IDs, redirect methods or bank debits.** See [Which elements work](/docs/framework/elements-checkout/reference#which-elements-work) for each one's reason.
* **Not inside the iOS app.** There, a Stripe purchase leaves for the browser, see [Where the form can't take payment](/docs/framework/elements-checkout#where-the-form-cant-take-payment).

## Related

* [Elements Checkout](/docs/framework/elements-checkout): the feature and a full build
* [Style Elements Checkout](/docs/framework/elements-checkout/styling): bring your design across
* [Elements Checkout Recipes](/docs/framework/elements-checkout/recipes): common layouts, including separate card fields