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

# Migrate from Payment Method Domains

> Move Apple Pay domain setup from the deprecated payment method domains API to the domains API, with the replacement for each request.

The payment method domains API (`/api/v1/payment_method_domains`) is deprecated and stops working after December 23, 2026. The [domains API](https://docs.whop.com/api-reference/domains/domain) replaces it: every domain has an `apple_pay` capability that you add, check, and remove on the domain itself. If your integration registers checkout domains for Apple Pay and Google Pay, switch it to the domains API.

> [!NOTE]
>
> Your domains have already moved. Each payment method domain is a domain with the same ID, so you don't need to copy anything. The IDs you already stored work with `/domains/{id}`.

## Switch to the domains API

**1. Add the domain permissions to your API key**

The payment method domains API needed `company:manage_checkout`. The domains API needs `domain:read` to list and retrieve domains, and `domain:manage` to add, check, update, and remove them. Add both in **Developer → API keys**, or request them in your app's permissions. Without them, listing, adding, checking, and updating domains return `403`. Retrieving a domain still returns it, but with `apple_pay: null`, which looks the same as a domain without Apple Pay.

**2. Find your payment method domains calls**

Every response from `/payment_method_domains` carries a `Deprecation` header, a `Sunset` header with the shutdown date, and a `Link` header with `rel="successor-version"`. The `Link` URL is the domains API request that replaces it. Log responses with `Deprecation` to find every call your integration still makes.

**3. Replace each call**

Use the [request map](#request-map) to swap each request, then read [what changed](#what-changed) for the differences in fields and timing.

## Request map

| Payment method domains | Domains API | Notes |
| - | - | - |
| `GET /payment_method_domains` | [`GET /domains?apple_pay=any&order=created_at`](https://docs.whop.com/api-reference/domains/list-domains) | Filter by hostname with `domain` instead of `hostname`. `account_id` works the same way. See [List filters](#list-filters) for `status` and the date filters. |
| `GET /payment_method_domains/{id}` | [`GET /domains/{id}`](https://docs.whop.com/api-reference/domains/retrieve-domain) | Same ID. |
| `POST /payment_method_domains` | [`POST /domains`](https://docs.whop.com/api-reference/domains/create-domain) with `apple_pay: {}` | Send the hostname as `domain`, plus `account_id` for a subaccount. If the account already has the domain, call [`PATCH /domains/{id}`](https://docs.whop.com/api-reference/domains/update-domain) with `apple_pay: {}` instead. |
| `POST /payment_method_domains/{id}/verify` | [`POST /domains/{id}/check`](https://docs.whop.com/api-reference/domains/check-domain) | |
| `DELETE /payment_method_domains/{id}` | [`PATCH /domains/{id}`](https://docs.whop.com/api-reference/domains/update-domain) with `apple_pay: null` | Removes Apple Pay and keeps the domain. |

> [!WARNING]
>
> Don't replace `DELETE /payment_method_domains/{id}` with `DELETE /domains/{id}`. Deleting a domain removes the whole domain, including any website on it, not only Apple Pay.

## Examples

### Add Apple Pay to a domain

Host the [Apple Pay verification file](https://docs.whop.com/payments/apple-pay.md#self-hosted-verification) on the domain first, then add the domain with an empty `apple_pay` object.

```typescript TypeScript theme={null}
import { WhopClient } from "@whop/sdk";

const client = new WhopClient({ token: process.env.WHOP_API_KEY });

const domain = await client.domains.create({
  domain: "checkout.example.com",
  account_id: "biz_xxxxxxxxxxxxx",
  apple_pay: {},
});

console.log(domain.apple_pay?.state); // "pending" while Whop registers the domain with Apple
```

```python Python theme={null}
import os

from whop_sdk import Whop

client = Whop(token=os.environ["WHOP_API_KEY"])

domain = client.domains.create(
    domain="checkout.example.com",
    account_id="biz_xxxxxxxxxxxxx",
    apple_pay={},
)

print(domain.apple_pay.state)  # "pending" while Whop registers the domain with Apple
```

If the call returns `409` because the account already has `checkout.example.com`, find it with `GET /domains?domain=checkout.example.com` and add Apple Pay with `PATCH /domains/{id}` and `apple_pay: {}`.

### List your Apple Pay domains

```typescript TypeScript theme={null}
for await (const domain of client.domains.list({ apple_pay: "any" })) {
  console.log(domain.domain, domain.apple_pay?.state);
}
```

```python Python theme={null}
for domain in client.domains.list(apple_pay="any"):
    print(domain.domain, domain.apple_pay.state)
```

Without `account_id`, the list covers your account and its subaccounts, like `GET /payment_method_domains` did.

### Check a domain again

After you fix the verification file, register the domain with Apple again:

```typescript TypeScript theme={null}
await client.domains.check({ id: "dom_xxxxxxxxxxxxx" });
```

```python Python theme={null}
client.domains.check(id="dom_xxxxxxxxxxxxx")
```

### Remove Apple Pay from a domain

```typescript TypeScript theme={null}
await client.domains.update({ id: "dom_xxxxxxxxxxxxx", apple_pay: null });
```

```bash cURL theme={null}
curl -X PATCH https://api.whop.com/api/v1/domains/dom_xxxxxxxxxxxxx \
  -H "Authorization: Bearer $WHOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"apple_pay": null}'
```

## What changed

### List filters

`GET /domains` filters Apple Pay with `apple_pay`, which takes one state at a time.

| Payment method domains | Domains API |
| - | - |
| `status=verified` | `apple_pay=ready` |
| `status=pending` | Two requests, `apple_pay=pending` and `apple_pay=action_required`. Or list with `apple_pay=any` and keep the domains whose `apple_pay.state` is `pending` or `action_required`. |
| `provider=apple` | Drop it. Every Apple Pay domain is Apple's. |
| `hostname` | `domain` |
| `created_before`, `created_after` | No equivalent. List with `order=created_at` and stop paging once `created_at` passes your cutoff. |
| `order=created_at` (the default) | `order=created_at`. Without it, the domains API sorts by `unique_visitors_last_7_days`. |

> [!WARNING]
>
> Don't carry `status` over. `GET /domains` also has a `status` filter, but it filters the domain's own status, not Apple Pay, so `status=pending` returns different domains without an error.

### Status is `apple_pay.state`

A payment method domain had `status` and `provider`. A domain has `apple_pay.state` instead, and `apple_pay` is `null` on a domain without Apple Pay.

| Payment method domain `status` | Domain `apple_pay.state` | Meaning |
| - | - | - |
| `verified` | `ready` | Apple verified the domain. Apple Pay and Google Pay show on its checkouts. |
| `pending` | `pending` | Whop is registering the domain with Apple. |
| `pending` | `action_required` | Apple couldn't fetch the verification file. The domain's `issues` say how to fix it. Fix it, then check the domain. |
| — | `releasing` | Whop is removing the domain from Apple after you removed Apple Pay. |

`provider` is gone. Apple is the only provider, and a domain with Apple Pay ready also clears Google Pay.

### Registration runs in the background

Creating a domain or checking it returns right away with `apple_pay.state: "pending"`. Retrieve the domain until `apple_pay.state` is `ready` or `action_required`.

### Field names

| Payment method domain | Domain |
| - | - |
| `hostname` | `domain` |
| `account_id` | `account_id` |
| `status` | `apple_pay.state` |
| `created_at`, `updated_at` | `created_at`, `updated_at` |

A domain also has fields the payment method domain didn't, such as `issues`, `website`, and `metadata`. The [domain object](https://docs.whop.com/api-reference/domains/domain) lists them all.

## Next steps

> [card] [Enable Apple Pay and Google Pay](https://docs.whop.com/payments/apple-pay.md)
>
> Host the verification file and register your domain.

> [card] [Domains API](https://docs.whop.com/api-reference/domains/domain)
>
> Every field and request on a domain.


## Related topics

- [API Versions](https://docs.whop.com/developer/api/versioning.md)
- [Enable Apple Pay and Google Pay](https://docs.whop.com/payments/apple-pay.md)
- [Payments](https://docs.whop.com/elements/latest/payments/overview.md)
