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

# SDK de Checkout para iOS

> Vende compras dentro de la app y suscripciones en tu app de iOS, con pagos de Whop en EE. UU. y StoreKit en el resto del mundo.

El SDK de Checkout de Whop para iOS te permite vender compras dentro de la app y suscripciones en tu app nativa de iOS. En Estados Unidos, usa automáticamente el procesamiento de pagos de Whop (2.7% + \$0.30 frente al 15-30% de Apple). En el resto del mundo, recurre a StoreKit de Apple para ofrecer cobertura global.

Para cobrar pagos en persona, usa en su lugar el botón de Apple Pay del SDK para [aceptar pagos únicos](https://docs.whop.com/es/developer/guides/ios/accept-one-time-payments.md).

> [!TIP]
>
> El SDK se configura con una clave de API restringida a `iap:read` que es seguro incluir en el bundle de tu app. Consulta [Crea una clave de API](https://docs.whop.com/es/developer/guides/ios/installation.md#step-3-create-an-api-key) para configurarla.

> [!NOTE]
>
> Products y Variants son los recursos de comercio actuales. El SDK de iOS sigue exponiendo símbolos de compatibilidad como `plans`, `CheckoutPlan`, `planMappings` y `planId`. Todos esos símbolos se refieren a variantes.

## Qué puedes crear

> [card] [Crea un paywall](https://docs.whop.com/es/developer/guides/ios/build-a-paywall.md)
>
> Muestra variantes de suscripción y gestiona compras en tu app

> [card] [Comprueba los entitlements](https://docs.whop.com/es/developer/guides/ios/check-entitlements.md)
>
> Verifica el estado de la suscripción y restringe el contenido premium

## SDKs de iOS relacionados

Whop también ofrece SDKs independientes para experiencias integradas:

> [card] [Chat integrado](https://docs.whop.com/es/developer/guides/chat/quickstart.md)
>
> Añade canales de chat de Whop directamente en tu app

> [card] [Wallet Elements](https://docs.whop.com/es/elements/latest/getting-started.md)
>
> Muestra los saldos y la actividad de una cuenta con los wallet elements de Swift

## Ejemplo rápido

Este es un ejemplo completo que muestra el SDK en acción:

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

## Primeros pasos

**1. Instala el SDK**

Añade el paquete WhopCheckout a tu proyecto de Xcode mediante Swift Package Manager.

[Guía de instalación →](https://docs.whop.com/es/developer/guides/ios/installation.md)

**2. Obtén tu clave de API**

Crea una clave de API con el permiso `iap:read` en tu [configuración de desarrollador](https://whop.com/dashboard/developer). [Por qué es seguro incluirla →](https://docs.whop.com/es/developer/guides/ios/installation.md#step-3-create-an-api-key)

**3. Configura el SDK**

Inicializa el SDK con el ID de tu cuenta, la clave de API y las asignaciones de variantes mediante la propiedad de compatibilidad `planMappings` en `Checkout.shared.configure()`.

**4. Crea tu paywall**

Muestra variantes y gestiona las compras. El SDK usa automáticamente el checkout de Whop en EE. UU. y StoreKit en el resto del mundo.

[Crea un paywall →](https://docs.whop.com/es/developer/guides/ios/build-a-paywall.md)

## Referencia

> [card] [Referencia de la API](https://docs.whop.com/es/developer/guides/ios/checkout-reference.md)
>
> Documentación completa de la API para todas las clases, métodos y tipos de Checkout

## Requisitos

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


## Related topics

- [Referencia del SDK de Checkout para iOS](https://docs.whop.com/es/developer/guides/ios/checkout-reference.md)
- [Instala los SDKs de Whop para iOS](https://docs.whop.com/es/developer/guides/ios/installation.md)
- [Crea un paywall para iOS](https://docs.whop.com/es/developer/guides/ios/build-a-paywall.md)
