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

# PayPal 지급 수단 연결하기

> 계정 소유자가 PayPal에 로그인하도록 하여 PayPal을 지급 수단으로 추가하면, 지급이 소유자 명의의 인증된 계정으로만 전송됩니다.

지급이 소유자 본인의 PayPal 계정으로만 전달되도록 하세요. 소유자는 이메일을 입력하는 대신 PayPal에 로그인하며, Whop은 PayPal 계정의 이름이 지급 설정과 일치하면 PayPal의 이메일을 저장합니다.

| | PayPal로 로그인(이 가이드) | 직접 입력한 이메일 |
| - | - | - |
| **지급 이메일** | PayPal에서 가져옴 | 소유자가 입력 |
| **소유자 본인 소유 증명** | 예 | 아니요 |
| **통합** | 리디렉션 한 번과 반환 페이지 | API 호출 한 번 |

> [!NOTE]
>
> 시작하기 전에 다음이 필요합니다:
>
> * `payout:destination:read` 및 `payout:create_destination` 범위가 있는 API 키.
> * 계정에서 PayPal 로그인 활성화. 활성화하려면 Whop에 문의하세요. 그 전까지는 `supports_paypal_login`이 `false`이며 2단계에서 `403`이 반환됩니다.
> * 완료된 [지급 설정](https://docs.whop.com/ko/developer/verification/overview.md). Whop은 지급 설정의 이름을 PayPal 계정과 대조합니다.
> * 계정 또는 그 플랫폼에 추가된 도메인에 있는, PayPal이 소유자를 돌려보낼 `https` 페이지. [Create Domain](https://docs.whop.com/ko/api-reference/domains/create-domain.md)과 `verification: {}`으로 추가하세요. 인증이 완료될 필요는 없습니다. 테스트에는 `https://localhost`를 사용할 수 있습니다.
> * SDK를 사용하는 경우 Whop SDK 2.5.0 이상.

## 리디렉션 작동 방식

모든 과정은 소유자의 브라우저에서 하나의 탭 안에서 이루어집니다. PayPal을 직접 호출할 필요는 없습니다.

1. 서버가 세션을 시작하고 PayPal의 `authorize_url`을 받습니다.
2. 소유자의 브라우저가 그곳으로 이동하고, 소유자가 로그인해 승인합니다.
3. PayPal이 브라우저를 Whop으로 돌려보내고, Whop은 계정의 이메일, 이름, 인증 상태를 읽습니다.
4. Whop이 `?paypal_link_token=…` 또는 `?error=…`와 함께 브라우저를 `return_url`로 보냅니다.
5. 서버가 토큰을 Whop에 전달하면 Whop이 이름을 확인하고 수단을 저장합니다.

## 지급 수단 찾기

[지원되는 지급 수단을 나열](https://docs.whop.com/ko/api-reference/payouts/list-supported-payout-methods.md)하고 `supports_paypal_login: true`인 항목의 `id`를 보관하세요. SDK가 모든 결과의 페이지를 자동으로 넘깁니다.

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

## 로그인 시작하기

[PayPal 연결 세션을 생성](https://docs.whop.com/ko/api-reference/payouts/create-paypal-link-session.md)하고 소유자를 해당 `authorize_url`로 리디렉션하세요. 세션은 15분 후 `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"
  }'
```

브라우저는 다음 중 하나와 함께 `return_url`로 돌아옵니다:

| 쿼리 문자열 | 의미 | 다음 단계 |
| - | - | - |
| `?paypal_link_token=…` | 소유자가 로그인함 | 15분 이내에 수단 저장 |
| `?error=paypal_login_canceled` | 소유자가 취소함 | 다시 시작하도록 안내 |
| `?error=paypal_login_failed` | PayPal이 거부했거나, 링크가 재사용되었거나, 교환이 실패함 | 새 세션 시작 |

소유자가 `expires_at` 이후에 완료하거나, `return_url` 도메인이 계정에서 제거된 후에 완료하면 Whop은 소유자를 돌려보낼 수 없습니다. 소유자에게는 "Invalid or expired link" 페이지가 표시됩니다.

## 지급 수단 저장하기

서버에서 `fields` 대신 `paypal_link_token`을 사용해 [저장된 지급 수단을 생성](https://docs.whop.com/ko/api-reference/payouts/create-saved-payout-method.md)하세요. 토큰은 세션과 같은 값에서만 작동하므로 세션과 동일한 `account_id`, `supported_payout_method_id`, `destination_currency`를 사용하세요. Whop은 PayPal의 이메일을 저장하고 이를 따라 수단의 이름을 지정합니다.

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

응답은 새 지급 수단입니다(축약됨):

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

이제 이 수단으로 [지급을 보낼](https://docs.whop.com/ko/developer/platforms/manual-payouts.md) 수 있습니다.

### Whop이 계정을 거부하는 경우

Whop은 이름 불일치 같은 소유자용 `message`와 함께 `400`으로 응답합니다. 그대로 표시하세요.

* **토큰은 거부 후에도 유효하므로** 일시적인 오류는 같은 토큰으로 재시도하세요.
* **메시지가 PayPal을 다시 연결하라고 안내하면** 소유자가 문제를 해결한 후 새 세션을 시작하세요.
* **인증되지 않은 PayPal 계정이나 확인되지 않은 이메일도 저장됩니다.**

## 소유자에게 표시되는 화면

PayPal의 동의 화면에는 소유자의 이메일, 이름, 인증 상태를 요청하는 앱으로 Whop이 표시됩니다. 모든 리디렉션은 PayPal을 연 탭 안에서 이루어지므로, 팝업을 사용한다면 반환 페이지가 팝업을 연 창에 알리고 닫혀야 합니다.

## 다음 단계

> [card] [지급 보내기](https://docs.whop.com/ko/developer/platforms/manual-payouts.md)
>
> 방금 저장한 PayPal 수단으로 지급합니다

> [card] [Payouts API 레퍼런스](https://docs.whop.com/ko/api-reference/payouts/payout)
>
> 모든 지급 및 지급 수단 엔드포인트


## Related topics

- [Payouts API](https://docs.whop.com/ko/api-reference/payouts/payout.md)
- [Elements 시작하기](https://docs.whop.com/ko/elements/latest/getting-started.md)
- [Create PayPal Link Session](https://docs.whop.com/ko/api-reference/payouts/create-paypal-link-session.md)
