Skip to main content
The iOS WhopIAP SDK is coming soon. This documentation is a preview.
Whop In-App Purchases let you accept payments directly in your iOS app while avoiding Apple’s 15-30% App Store fees. Instead, you pay Whop’s standard processing fees (2.9% + $0.30 for cards). See fee details.

Before You Begin

Make sure you have the following ready before starting:
You’ll need your App ID and API Key from the Whop Developer Settings.
  1. Go to Whop Developer Settings
  2. Create a new app or select an existing one
  3. Copy your App ID (starts with app_)
  4. Generate an API Key and store it securely
Never expose your API Key in client-side code. It should only be used on your backend.
Create a product and plan in your Whop Dashboard:
  1. Go to your Whop Dashboard
  2. Navigate to Products and create a product (or use an existing one)
  3. Add at least one Plan with pricing (subscription or one-time)
  4. Note your Product ID (starts with prod_) and Plan ID (starts with plan_)
Your backend needs the Whop SDK to generate access tokens:
npm install @whop/sdk

Quick Start

Once configured, accepting payments is just a few lines of code:
struct ContentView: View {
    @Environment(WhopIAP.self) var whop

    var body: some View {
        if whop.isSubscribed() {
            Text("Welcome, premium user!")
        } else {
            Button("Upgrade") {
                Task {
                    try? await whop.purchase("plan_xxxxxxxxxxxxxx")
                }
            }
        }
    }
}

Get Started

Follow the setup guide to install the SDK and configure your backend

How It Works

1

Configure your backend

Create an endpoint that generates Whop access tokens with the iap:client scope.
2

Initialize the SDK

Pass your company ID, product IDs, and token provider to configure().
3

Check membership status

Use isSubscribed() or hasAccess(to:) to gate premium content.
4

Present checkout

Call purchase() to display a payment sheet. The SDK handles the rest.

Features

FeatureDescription
Lower fees2.9% + $0.30 vs Apple’s 15-30%
Subscriptions & one-timeSupport for recurring and single payments
Guest purchasesUsers can buy before creating an account
Cross-device syncMemberships sync when users log in
SwiftUI nativeBuilt with @Observable for seamless integration

Guides

Requirements

  • iOS 17.0+
  • Xcode 15.0+
  • Swift 5.9+