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

# Een PayPal-uitbetaalmethode koppelen

> Voeg PayPal toe als uitbetaalmethode door de accounthouder bij PayPal te laten inloggen, zodat uitbetalingen alleen naar een geverifieerd account op diens naam gaan.

Zorg ervoor dat uitbetalingen alleen terechtkomen op een PayPal-account dat eigendom is van de houder. De houder logt in bij PayPal in plaats van een e-mailadres te typen, en Whop slaat het e-mailadres van PayPal op zodra de naam overeenkomt met de uitbetalingsinstellingen van de houder.

| | Inloggen met PayPal (deze gids) | Getypt e-mailadres |
| - | - | - |
| **E-mailadres voor uitbetaling** | Van PayPal | Getypt door de houder |
| **Bewijst dat de houder eigenaar is** | Ja | Nee |
| **Integratie** | Een redirect en een returnpagina | Eén API-aanroep |

> [!NOTE]
>
> Voordat je begint, heb je het volgende nodig:
>
> * Een API-sleutel met de scopes `payout:destination:read` en `payout:create_destination`.
> * Inloggen met PayPal ingeschakeld op het account. Neem contact op met Whop om dit in te schakelen. Tot die tijd is `supports_paypal_login` `false` en retourneert stap 2 een `403`.
> * Voltooide [uitbetalingsinstellingen](https://docs.whop.com/nl/developer/verification/overview.md). Whop vergelijkt de naam daarin met het PayPal-account.
> * Een `https`-pagina waarnaar PayPal de houder kan terugsturen, op een domein dat is toegevoegd aan het account of het platform daarvan. Voeg het toe met [Create Domain](https://docs.whop.com/nl/api-reference/domains/create-domain.md) en `verification: {}`. De verificatie hoeft niet te zijn afgerond. `https://localhost` werkt om te testen.
> * Whop SDK 2.5.0 of hoger, als je een SDK gebruikt.

## Hoe de redirect werkt

Alles gebeurt in de browser van de houder, in één tabblad. Je roept PayPal nooit rechtstreeks aan.

1. Je server start een sessie en krijgt een `authorize_url` bij PayPal.
2. De browser van de houder gaat daarheen, waar de houder inlogt en toestemming geeft.
3. PayPal stuurt de browser terug naar Whop, dat het e-mailadres, de naam en de verificatiestatus van het account uitleest.
4. Whop stuurt de browser naar je `return_url` met `?paypal_link_token=…` of `?error=…`.
5. Je server geeft het token door aan Whop, dat de naam controleert en de methode opslaat.

## Zoek de uitbetaalmethode

[Vraag de ondersteunde uitbetaalmethoden op](https://docs.whop.com/nl/api-reference/payouts/list-supported-payout-methods.md) en bewaar de `id` van de methode met `supports_paypal_login: true`. De SDK's bladeren voor je door alle resultaten.

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

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

const supportedMethods = await client.payouts.supportedMethods.list({
	account_id: "biz_xxxxxxxxxxxxx",
	destination_currency: "usd",
});

let paypalMethodId: string | undefined;
for await (const method of supportedMethods) {
	if (method.supports_paypal_login) {
		paypalMethodId = method.id;
		break;
	}
}
if (!paypalMethodId) throw new Error("PayPal login is not enabled for this account");
```

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

from whop_sdk import Whop

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

supported_methods = client.payouts.supported_methods.list(
    account_id="biz_xxxxxxxxxxxxx",
    destination_currency="usd",
)

paypal_method_id = next(
    (method.id for method in supported_methods if method.supports_paypal_login),
    None,
)
if paypal_method_id is None:
    raise RuntimeError("PayPal login is not enabled for this account")
```

```ruby Ruby theme={null}
require "whop_sdk"

client = Whop_sdk::Client.new(token: ENV.fetch("WHOP_API_KEY"))

paypal_method = client.payouts.supported_methods
  .list(account_id: "biz_xxxxxxxxxxxxx", destination_currency: "usd")
  .find(&:supports_paypal_login)
raise "PayPal login is not enabled for this account" if paypal_method.nil?

paypal_method_id = paypal_method.id
```

```go Go theme={null}
import (
	"context"
	"fmt"
	"log"
	"os"

	whopsdk "github.com/whopio/whopsdk-go/v2"
	"github.com/whopio/whopsdk-go/v2/client"
	"github.com/whopio/whopsdk-go/v2/option"
	"github.com/whopio/whopsdk-go/v2/payouts"
)

ctx := context.TODO()
client := client.NewWhop(option.WithToken(os.Getenv("WHOP_API_KEY")))

page, err := client.Payouts.SupportedMethods.List(ctx, &payouts.ListSupportedMethodsRequest{
	AccountID:           whopsdk.String("biz_xxxxxxxxxxxxx"),
	DestinationCurrency: whopsdk.String("usd"),
})
if err != nil {
	log.Fatal(err)
}

var paypalMethodID string
methods := page.Iterator()
for methods.Next(ctx) {
	method := methods.Current()
	if method.SupportsPaypalLogin != nil && *method.SupportsPaypalLogin {
		paypalMethodID = method.ID
		break
	}
}
if err := methods.Err(); err != nil {
	log.Fatal(err)
}
if paypalMethodID == "" {
	log.Fatal("PayPal login is not enabled for this account")
}
```

```bash cURL theme={null}
curl "https://api.whop.com/api/v1/payouts/supported_methods?account_id=biz_xxxxxxxxxxxxx&destination_currency=usd" \
  -H "Authorization: Bearer $WHOP_API_KEY"
```

## Start het inloggen

[Maak een PayPal-koppelsessie aan](https://docs.whop.com/nl/api-reference/payouts/create-paypal-link-session.md) en stuur de houder door naar de `authorize_url` ervan. De sessie verloopt na 15 minuten, op `expires_at`.

```typescript TypeScript theme={null}
const session = await client.payouts.paypalLinkSessions.create({
	account_id: "biz_xxxxxxxxxxxxx",
	supported_payout_method_id: paypalMethodId,
	destination_currency: "usd",
	return_url: "https://yourapp.example/settings/payouts",
});

// Redirect the holder's browser to this URL
console.log(session.authorize_url);
```

```python Python theme={null}
session = client.payouts.paypal_link_sessions.create(
    account_id="biz_xxxxxxxxxxxxx",
    supported_payout_method_id=paypal_method_id,
    destination_currency="usd",
    return_url="https://yourapp.example/settings/payouts",
)

# Redirect the holder's browser to this URL
print(session.authorize_url)
```

```ruby Ruby theme={null}
session = client.payouts.paypal_link_sessions.create(
  account_id: "biz_xxxxxxxxxxxxx",
  supported_payout_method_id: paypal_method_id,
  destination_currency: "usd",
  return_url: "https://yourapp.example/settings/payouts",
)

# Redirect the holder's browser to this URL
puts session.authorize_url
```

```go Go theme={null}
session, err := client.Payouts.PaypalLinkSessions.Create(ctx, &payouts.CreatePaypalLinkSessionsRequest{
	AccountID:               whopsdk.String("biz_xxxxxxxxxxxxx"),
	SupportedPayoutMethodID: paypalMethodID,
	DestinationCurrency:     whopsdk.String("usd"),
	ReturnURL:               "https://yourapp.example/settings/payouts",
})
if err != nil {
	log.Fatal(err)
}

// Redirect the holder's browser to this URL
fmt.Println(session.AuthorizeURL)
```

```bash cURL theme={null}
curl "https://api.whop.com/api/v1/payouts/paypal_link_sessions" \
  -H "Authorization: Bearer $WHOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "biz_xxxxxxxxxxxxx",
    "supported_payout_method_id": "podst_xxxxxxxxxxxxx",
    "destination_currency": "usd",
    "return_url": "https://yourapp.example/settings/payouts"
  }'
```

De browser keert terug naar je `return_url` met een van de volgende:

| Querystring | Betekenis | Volgende stap |
| - | - | - |
| `?paypal_link_token=…` | De houder heeft ingelogd | Sla de methode binnen 15 minuten op |
| `?error=paypal_login_canceled` | De houder heeft afgehaakt | Bied aan om opnieuw te beginnen |
| `?error=paypal_login_failed` | PayPal heeft geweigerd, de link is hergebruikt of de uitwisseling is mislukt | Start een nieuwe sessie |

Als de houder klaar is na `expires_at`, of nadat het domein van de `return_url` uit het account is verwijderd, kan Whop de houder niet terugsturen. De houder ziet dan een pagina "Invalid or expired link".

## Sla de uitbetaalmethode op

[Maak op je server de opgeslagen uitbetaalmethode aan](https://docs.whop.com/nl/api-reference/payouts/create-saved-payout-method.md) met `paypal_link_token` in plaats van `fields`. Gebruik dezelfde `account_id`, `supported_payout_method_id` en `destination_currency` als de sessie, want het token werkt alleen daarmee. Whop slaat het e-mailadres van PayPal op en vernoemt de methode ernaar.

```typescript TypeScript theme={null}
// paypalLinkToken is the paypal_link_token from your return_url's query string
const method = await client.payouts.methods.create({
	account_id: "biz_xxxxxxxxxxxxx",
	supported_payout_method_id: paypalMethodId,
	destination_currency: "usd",
	paypal_link_token: paypalLinkToken,
});

console.log(method.id);
```

```python Python theme={null}
# paypal_link_token is the value from your return_url's query string
method = client.payouts.methods.create(
    account_id="biz_xxxxxxxxxxxxx",
    supported_payout_method_id=paypal_method_id,
    destination_currency="usd",
    paypal_link_token=paypal_link_token,
)

print(method.id)
```

```ruby Ruby theme={null}
# paypal_link_token is the value from your return_url's query string
method = client.payouts.methods.create(
  account_id: "biz_xxxxxxxxxxxxx",
  supported_payout_method_id: paypal_method_id,
  destination_currency: "usd",
  paypal_link_token: paypal_link_token,
)

puts method.id
```

```go Go theme={null}
// paypalLinkToken is the paypal_link_token from your return_url's query string
method, err := client.Payouts.Methods.Create(ctx, &payouts.CreateMethodsRequest{
	AccountID:               whopsdk.String("biz_xxxxxxxxxxxxx"),
	SupportedPayoutMethodID: paypalMethodID,
	DestinationCurrency:     whopsdk.String("usd"),
	PaypalLinkToken:         whopsdk.String(paypalLinkToken),
})
if err != nil {
	log.Fatal(err)
}

fmt.Println(method.ID)
```

```bash cURL theme={null}
curl "https://api.whop.com/api/v1/payouts/methods" \
  -H "Authorization: Bearer $WHOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "biz_xxxxxxxxxxxxx",
    "supported_payout_method_id": "podst_xxxxxxxxxxxxx",
    "destination_currency": "usd",
    "paypal_link_token": "'"$PAYPAL_LINK_TOKEN"'"
  }'
```

De response is de nieuwe uitbetaalmethode, ingekort:

```json theme={null}
{
	"object": "payout_method",
	"id": "potk_xxxxxxxxxxxxx",
	"nickname": "PayPal j•••@example.com",
	"institution_name": "PayPal",
	"destination_currency": "usd"
}
```

Je kunt nu [een uitbetaling versturen](https://docs.whop.com/nl/developer/platforms/manual-payouts.md) naar deze methode.

### Als Whop het account weigert

Whop antwoordt met `400` en een `message` voor de houder, bijvoorbeeld bij een niet-overeenkomende naam. Toon die melding ongewijzigd.

* **Het token blijft geldig na een weigering**, dus probeer een tijdelijke fout opnieuw met hetzelfde token.
* **Als de melding zegt dat PayPal opnieuw moet worden gekoppeld**, start dan een nieuwe sessie zodra de houder het probleem heeft opgelost.
* **Een niet-geverifieerd PayPal-account of een niet-bevestigd e-mailadres wordt toch opgeslagen.**

## Wat de houder ziet

Het toestemmingsscherm van PayPal noemt Whop als de app die om het e-mailadres, de naam en de verificatiestatus vraagt. Elke redirect blijft in het tabblad dat PayPal heeft geopend, dus als je een pop-up gebruikt, moet je returnpagina het venster dat de pop-up heeft geopend op de hoogte stellen en zichzelf sluiten.

## Volgende stappen

> [card] [Een uitbetaling versturen](https://docs.whop.com/nl/developer/platforms/manual-payouts.md)
>
> Betaal uit naar de PayPal-methode die je zojuist hebt opgeslagen

> [card] [API-referentie voor uitbetalingen](https://docs.whop.com/nl/api-reference/payouts/payout)
>
> Alle endpoints voor uitbetalingen en uitbetaalmethoden
