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

# Bir PayPal Ödeme Yöntemi Bağlayın

> Hesap sahibinin PayPal'da oturum açmasını sağlayarak PayPal'ı bir ödeme yöntemi olarak ekleyin; böylece ödemeler yalnızca onun adına kayıtlı doğrulanmış bir hesaba gider.

Ödemelerin yalnızca sahibine ait bir PayPal hesabına ulaştığından emin olun. Hesap sahibi bir e-posta yazmak yerine PayPal'da oturum açar ve Whop, PayPal'daki ad ödeme kurulumundaki adla eşleştiğinde PayPal'ın e-postasını kaydeder.

| | PayPal ile oturum açma (bu kılavuz) | Yazılan e-posta |
| - | - | - |
| **Ödeme e-postası** | PayPal'dan | Hesap sahibi tarafından yazılır |
| **Hesabın sahibine ait olduğunu kanıtlar** | Evet | Hayır |
| **Entegrasyon** | Bir yönlendirme ve bir dönüş sayfası | Tek bir API çağrısı |

> [!NOTE]
>
> Başlamadan önce şunlara ihtiyacınız var:
>
> * `payout:destination:read` ve `payout:create_destination` kapsamlarına sahip bir API anahtarı.
> * Hesapta PayPal ile oturum açmanın etkinleştirilmiş olması. Etkinleştirmek için Whop ile iletişime geçin. O zamana kadar `supports_paypal_login` değeri `false` olur ve 2. adım `403` döndürür.
> * Tamamlanmış bir [ödeme kurulumu](https://docs.whop.com/tr/developer/verification/overview.md). Whop, buradaki adı PayPal hesabıyla eşleştirir.
> * PayPal'ın hesap sahibini geri gönderebileceği, hesaba veya platformuna eklenmiş bir alan adında bulunan bir `https` sayfası. Bunu [Create Domain](https://docs.whop.com/tr/api-reference/domains/create-domain.md) ve `verification: {}` ile ekleyin. Doğrulamanın tamamlanması gerekmez. Test için `https://localhost` çalışır.
> * Bir SDK kullanıyorsanız Whop SDK 2.5.0 veya üzeri.

## Yönlendirme nasıl çalışır

Her şey hesap sahibinin tarayıcısında, tek bir sekmede gerçekleşir. PayPal'ı asla doğrudan çağırmazsınız.

1. Sunucunuz bir oturum başlatır ve PayPal üzerinde bir `authorize_url` alır.
2. Hesap sahibinin tarayıcısı oraya gider; hesap sahibi oturum açar ve onaylar.
3. PayPal tarayıcıyı Whop'a geri gönderir; Whop hesabın e-postasını, adını ve doğrulama durumunu okur.
4. Whop tarayıcıyı `?paypal_link_token=…` veya `?error=…` ile `return_url` adresinize gönderir.
5. Sunucunuz token'ı Whop'a iletir; Whop adı kontrol eder ve yöntemi kaydeder.

## Ödeme yöntemini bulun

[Desteklenen ödeme yöntemlerini listeleyin](https://docs.whop.com/tr/api-reference/payouts/list-supported-payout-methods.md) ve `supports_paypal_login: true` olanın `id` değerini saklayın. SDK'lar tüm sonuçlar arasında sizin için sayfalama yapar.

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

## Oturum açmayı başlatın

[Bir PayPal bağlantı oturumu oluşturun](https://docs.whop.com/tr/api-reference/payouts/create-paypal-link-session.md) ve hesap sahibini oturumun `authorize_url` adresine yönlendirin. Oturumun süresi 15 dakika içinde, `expires_at` zamanında dolar.

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

Tarayıcı `return_url` adresinize şunlardan biriyle geri döner:

| Sorgu dizesi | Anlamı | Sonraki adım |
| - | - | - |
| `?paypal_link_token=…` | Hesap sahibi oturum açtı | Yöntemi 15 dakika içinde kaydedin |
| `?error=paypal_login_canceled` | Hesap sahibi vazgeçti | Yeniden başlatmayı önerin |
| `?error=paypal_login_failed` | PayPal reddetti, bağlantı yeniden kullanıldı veya değişim başarısız oldu | Yeni bir oturum başlatın |

Hesap sahibi işlemi `expires_at` zamanından sonra veya `return_url` alan adı hesaptan kaldırıldıktan sonra tamamlarsa, Whop onu geri gönderemez. Hesap sahibi "Invalid or expired link" sayfasını görür.

## Ödeme yöntemini kaydedin

Sunucunuzda, `fields` yerine `paypal_link_token` ile [kaydedilmiş ödeme yöntemini oluşturun](https://docs.whop.com/tr/api-reference/payouts/create-saved-payout-method.md). Token yalnızca bunlarla çalıştığından, oturumdakiyle aynı `account_id`, `supported_payout_method_id` ve `destination_currency` değerlerini kullanın. Whop, PayPal'ın e-postasını kaydeder ve yöntemi buna göre adlandırır.

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

Yanıt, yeni ödeme yöntemidir (kısaltılmış):

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

Artık ona [bir ödeme gönderebilirsiniz](https://docs.whop.com/tr/developer/platforms/manual-payouts.md).

### Whop hesabı reddederse

Whop, hesap sahibi için bir `message` ile `400` yanıtı verir; örneğin ad uyuşmazlığı. Bunu olduğu gibi gösterin.

* **Token bir reddetmeden sonra geçerliliğini korur**, bu nedenle geçici bir hatayı aynı token ile yeniden deneyin.
* **Mesaj PayPal'ı yeniden bağlamayı söylüyorsa**, hesap sahibi sorunu düzelttikten sonra yeni bir oturum başlatın.
* **Doğrulanmamış bir PayPal hesabı veya onaylanmamış bir e-posta yine de kaydedilir.**

## Hesap sahibinin gördükleri

PayPal'ın onay ekranı, Whop'u hesap sahibinin e-postasını, adını ve doğrulanmış durumunu isteyen uygulama olarak gösterir. Her yönlendirme PayPal'ı açan sekmede kalır; bu nedenle bir açılır pencere kullanıyorsanız, dönüş sayfanız onu açan pencereyi bilgilendirmeli ve kapanmalıdır.

## Sonraki adımlar

> [card] [Bir ödeme gönderin](https://docs.whop.com/tr/developer/platforms/manual-payouts.md)
>
> Az önce kaydettiğiniz PayPal yöntemine ödeme yapın

> [card] [Payouts API referansı](https://docs.whop.com/tr/api-reference/payouts/payout)
>
> Tüm ödeme ve ödeme yöntemi uç noktaları


## Related topics

- [Alt Hesaplara Manuel Ödemeler](https://docs.whop.com/tr/developer/platforms/manual-payouts.md)
- [Checkout](https://docs.whop.com/tr/elements/latest/checkout/overview.md)
- [ExpressCheckoutElement](https://docs.whop.com/tr/elements/latest/checkout/expressCheckout.md)
