> ## 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

> Sælg køb i appen og abonnementer i din iOS-app med Whop-betalinger i USA og StoreKit alle andre steder.

Whop iOS Checkout SDK lader dig sælge køb i appen og abonnementer i din native iOS-app. I USA bruger det automatisk Whops betalingsbehandling (2,7 % + \$0,30 mod Apples 15-30 %). Andre steder falder det tilbage til Apples StoreKit for global dækning.

For at modtage betalinger for fysiske varer og tjenester kan du i stedet bruge SDK'ets Apple Pay-knap til at [modtage engangsbetalinger](https://docs.whop.com/da/developer/guides/ios/accept-one-time-payments.md).

> [!TIP]
>
> SDK'et konfigureres med en afgrænset `iap:read`-API-nøgle, som er sikker at levere i dit app-bundle. Se [Opret en API-nøgle](https://docs.whop.com/da/developer/guides/ios/installation.md#step-3-create-an-api-key) for opsætning.

> [!NOTE]
>
> Produkter og varianter er de aktuelle handelsressourcer. iOS-SDK'et eksponerer stadig kompatibilitetssymboler som `plans`, `CheckoutPlan`, `planMappings` og `planId`. Disse symboler refererer alle til varianter.

## Hvad du kan bygge

> [card] [Byg en betalingsmur](https://docs.whop.com/da/developer/guides/ios/build-a-paywall.md)
>
> Vis abonnementsvarianter, og håndter køb i din app

> [card] [Tjek rettigheder](https://docs.whop.com/da/developer/guides/ios/check-entitlements.md)
>
> Verificer abonnementsstatus, og begræns adgangen til premiumindhold

## Relaterede iOS-SDK'er

Whop leverer også separate SDK'er til indlejrede experiences:

> [card] [Indlejret chat](https://docs.whop.com/da/developer/guides/chat/quickstart.md)
>
> Tilføj Whop-chatkanaler direkte i din app

> [card] [Wallet-elementer](https://docs.whop.com/da/elements/latest/getting-started.md)
>
> Vis en kontos saldi og aktivitet med Swift-wallet-elementerne

## Hurtigt eksempel

Her er et komplet eksempel, der viser SDK'et i aktion:

```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")
                }
            }
        }
    }
}
```

## Kom i gang

**1. Installér SDK'et**

Tilføj WhopCheckout-pakken til dit Xcode-projekt via Swift Package Manager.

[Installationsguide →](https://docs.whop.com/da/developer/guides/ios/installation.md)

**2. Hent din API-nøgle**

Opret en API-nøgle med tilladelsen `iap:read` i dine [udviklerindstillinger](https://whop.com/dashboard/developer). [Hvorfor det er sikkert at indlejre →](https://docs.whop.com/da/developer/guides/ios/installation.md#step-3-create-an-api-key)

**3. Konfigurer SDK'et**

Initialiser SDK'et med dit konto-ID, din API-nøgle og dine variantmappings via kompatibilitetsegenskaben `planMappings` på `Checkout.shared.configure()`.

**4. Byg din betalingsmur**

Vis varianter, og håndter køb. SDK'et bruger automatisk Whop-checkout i USA og StoreKit andre steder.

[Byg en betalingsmur →](https://docs.whop.com/da/developer/guides/ios/build-a-paywall.md)

## Reference

> [card] [API-reference](https://docs.whop.com/da/developer/guides/ios/checkout-reference.md)
>
> Komplet API-dokumentation for alle Checkout-klasser, -metoder og -typer

## Krav

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


## Related topics

- [Reference til iOS Checkout SDK](https://docs.whop.com/da/developer/guides/ios/checkout-reference.md)
- [Modtag betalinger](https://docs.whop.com/da/developer/guides/accept-payments.md)
- [Installér Whops iOS-SDK'er](https://docs.whop.com/da/developer/guides/ios/installation.md)
