> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# iOS Checkout SDK

> iOS 앱에서 인앱 구매와 구독을 판매하세요. 미국에서는 Whop 결제를, 그 외 지역에서는 StoreKit을 사용합니다.

Whop iOS Checkout SDK를 사용하면 네이티브 iOS 앱에서 인앱 구매와 구독을 판매할 수 있습니다. 미국에서는 자동으로 Whop의 결제 처리(Apple의 15-30% 대비 2.7% + \$0.30)를 사용합니다. 그 외 지역에서는 전 세계를 지원하기 위해 Apple의 StoreKit으로 대체합니다.

대면 결제를 받으려면 대신 SDK의 Apple Pay 버튼을 사용해 [일회성 결제를 받으세요](https://docs.whop.com/ko/developer/guides/ios/accept-one-time-payments.md).

> [!TIP]
>
> SDK는 앱 번들에 포함해도 안전한, 범위가 제한된 `iap:read` API 키로 구성됩니다. 설정 방법은 [API 키 만들기](https://docs.whop.com/ko/developer/guides/ios/installation.md#step-3-create-an-api-key)를 참고하세요.

> [!NOTE]
>
> 상품과 변형이 현재의 커머스 리소스입니다. iOS SDK는 여전히 `plans`, `CheckoutPlan`, `planMappings`, `planId` 같은 호환성 심볼을 노출합니다. 이 심볼은 모두 변형을 가리킵니다.

## 만들 수 있는 것

> [card] [페이월 만들기](https://docs.whop.com/ko/developer/guides/ios/build-a-paywall.md)
>
> 앱에서 구독 변형을 표시하고 구매를 처리하세요

> [card] [이용 권한 확인하기](https://docs.whop.com/ko/developer/guides/ios/check-entitlements.md)
>
> 구독 상태를 확인하고 프리미엄 콘텐츠에 대한 접근을 제한하세요

## 관련 iOS SDK

Whop은 임베드 경험을 위한 별도의 SDK도 제공합니다:

> [card] [임베드 채팅](https://docs.whop.com/ko/developer/guides/chat/quickstart.md)
>
> 앱에 Whop 채팅 채널을 직접 추가하세요

> [card] [지갑 요소](https://docs.whop.com/ko/elements/latest/getting-started.md)
>
> Swift 지갑 요소로 계정의 잔액과 활동을 표시하세요

## 빠른 예제

다음은 SDK가 작동하는 모습을 보여주는 전체 예제입니다:

```swift theme={null}
import SwiftUI
import WhopCheckout

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
                .environment(Checkout.shared)
                .task {
                    try? await Checkout.shared.configure(
                        // companyId: find in Dashboard URL (starts with biz_)
                        companyId: "biz_xxxxxxxxxxxxxx",
                        // apiKey: create in Dashboard > Developer with iap:read permission
                        apiKey: "your_api_key_here",
                        planMappings: [
                            .init(whopId: "plan_xxxxx", appleId: "monthly_sub")
                        ]
                    )
                }
        }
    }
}

struct ContentView: View {
    @Environment(Checkout.self) var checkout

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

## 시작하기

**1. SDK 설치하기**

Swift Package Manager를 통해 Xcode 프로젝트에 WhopCheckout 패키지를 추가하세요.

[설치 가이드 →](https://docs.whop.com/ko/developer/guides/ios/installation.md)

**2. API 키 받기**

[개발자 설정](https://whop.com/dashboard/developer)에서 `iap:read` 권한이 있는 API 키를 만드세요. [임베드해도 안전한 이유 →](https://docs.whop.com/ko/developer/guides/ios/installation.md#step-3-create-an-api-key)

**3. SDK 구성하기**

`Checkout.shared.configure()`의 호환성 속성 `planMappings`를 통해 계정 ID, API 키, 변형 매핑으로 SDK를 초기화하세요.

**4. 페이월 만들기**

변형을 표시하고 구매를 처리하세요. SDK는 미국에서는 자동으로 Whop 체크아웃을, 그 외 지역에서는 StoreKit을 사용합니다.

[페이월 만들기 →](https://docs.whop.com/ko/developer/guides/ios/build-a-paywall.md)

## 레퍼런스

> [card] [API 레퍼런스](https://docs.whop.com/ko/developer/guides/ios/checkout-reference.md)
>
> 모든 Checkout 클래스, 메서드, 타입에 대한 전체 API 문서

## 요구 사항

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


## Related topics

- [iOS Checkout SDK 레퍼런스](https://docs.whop.com/ko/developer/guides/ios/checkout-reference.md)
- [결제 받기](https://docs.whop.com/ko/developer/guides/accept-payments.md)
- [Whop iOS SDK 설치하기](https://docs.whop.com/ko/developer/guides/ios/installation.md)
