> This page is for For Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://whop.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://whop.ferndocs.com/_mcp/server.

# Overview

> Accept payments in your iOS app with lower fees

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.7% + \$0.30 for cards). [See fee details](https://docs.whop.com/fees).

## Before You Begin

Make sure you have the following ready before starting:

#### 1. Whop developer account with API credentials

You'll need an **API Key** with the `iap:read` permission from the Whop Developer Settings.

1. Go to [Whop Developer Settings](https://whop.com/dashboard/developer)
2. Create a new app or select an existing one
3. Generate an **API Key** with **only** the `iap:read` permission

> **Info**
>
> The `iap:read` permission is designed for client-side use. It's safe to include in your iOS app because it only grants access to IAP operations.

#### 2. A product with at least one plan

Create a product and plan in your Whop Dashboard:

1. Go to your [Whop Dashboard](https://whop.com/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_`)

## Quick Start

Once configured, accepting payments is just a few lines of code:

```swift
import WhopCheckout

// In your App struct
var body: some Scene {
    WindowGroup {
        ContentView()
            .environment(Checkout.shared)
            .task {
                try? await Checkout.shared.configure(
                    companyId: "biz_xxxxxxxxxxxxxx",
                    apiKey: "your_api_key_here",
                    planMappings: [
                        .init(whopId: "plan_xxxxx", appleId: "monthly_sub")
                    ]
                )
            }
    }
}

// In your views
struct ContentView: View {
    @Environment(Checkout.self) var checkout

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

#### [Get Started](/developer/guides/ios/checkout/setup)

Follow the setup guide to install and configure the SDK

## How It Works

#### Create an API key

Generate an API key with only the `iap:read` permission in your Whop
Developer Settings.

#### Initialize the SDK

Pass your company ID, API key, and plan mappings to
`Checkout.shared.configure()`.

#### Check membership status

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

#### Present checkout

Call `purchase()` to display a payment sheet. The SDK automatically uses
Whop checkout in the US (lower fees) and StoreKit elsewhere.

## Features

| Feature                      | Description                                                           |
| ---------------------------- | --------------------------------------------------------------------- |
| **Lower fees**               | Whop charges 2.7% + \$0.30 in the US vs Apple's 15-30% App Store fees |
| **Smart routing**            | Automatically uses Whop checkout in the US, StoreKit elsewhere        |
| **Apple Pay**                | Native Apple Pay support for service-based apps via PassKit           |
| **Zero backend**             | No server required—configure with just an API key                     |
| **Subscriptions & one-time** | Support for recurring and single payments                             |
| **Guest purchases**          | Users can buy before creating an account                              |
| **Cross-device sync**        | Memberships sync when users log in                                    |
| **SwiftUI native**           | Built with `@Observable` for seamless integration                     |

## Guides

#### [Setup](/developer/guides/ios/checkout/setup)

Install and initialize the SDK

#### [Purchasing](/developer/guides/ios/checkout/purchasing)

Display plans and handle the checkout flow

#### [User Management](/developer/guides/ios/checkout/users)

Handle login, logout, and membership checking

## Requirements

* iOS 17.0+
* Xcode 15.0+
* Swift 5.10+