Build a Paywall
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
- Install the SDK
- A Whop company with at least one product and plan
- An API key scoped to
iap:read— see Create an API key for setup
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:
- Presents a checkout sheet with the Whop payment flow
- Handles payment processing
- Dismisses the sheet when complete
- Returns the result or throws an error
Complete example
Here’s a full paywall implementation:

