Skip to main content
This guide shows you how to build a paywall that displays your subscription plans and handles the purchase flow. By the end, you’ll have a working paywall that lets users subscribe to your product.

What you’ll build

  • A paywall screen that displays available plans with pricing
  • A purchase flow that handles payments through Whop
  • Error handling for cancelled or failed purchases

Prerequisites

The iap:read permission is designed for client-side use and only grants access to in-app purchase operations. It’s safe to embed in your app bundle. Never ship a key with broader permissions.

Step 1: Configure the SDK

Initialize the SDK in your app’s entry point with your API key:
Find your company ID in the URL of your Whop Dashboard (starts with biz_). Find your plan IDs in the Products tab under each plan (starts with plan_).

Step 2: Display available plans

Use the plans property to show available subscription options:

Step 3: Handle the purchase flow

When a user taps “Subscribe”, the SDK automatically:
  1. Presents a checkout sheet with the Whop payment flow
  2. Handles payment processing
  3. Dismisses the sheet when complete
  4. Returns the result or throws an error

Complete example

Here’s a full paywall implementation:

Next steps

Check Entitlements

Learn how to gate content based on subscription status

API Reference

Explore all available methods and properties