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

# Connect a PayPal Payout Method

> Add PayPal as a payout method by having the account holder log in to PayPal, so payouts only go to a verified account in their name.

## Before you start

You need:

* An API key with the `payout:destination:read` and `payout:create_destination` scopes.
* PayPal login enabled on the account. Contact Whop to turn it on. While it's off, `supports_paypal_login` is `false` and `POST /payouts/paypal_link_sessions` returns `403`.
* A completed [payout setup](/developer/verification/overview). Whop matches the PayPal account holder's name against the name collected there.
* An `https` page on your site where PayPal sends the user back.

This flow is optional. `POST /payouts/methods` still accepts a typed PayPal email through `fields`. Use this flow when the payout method should be verified before it's saved.

## How the redirect works

The whole login happens in the account holder's browser, in one tab. You never talk to PayPal directly and you register nothing with PayPal.

1. You start a PayPal login and send the browser to the returned `authorize_url`. This is a PayPal page.
2. The holder logs in and consents. PayPal redirects the browser to Whop's callback, `https://api.whop.com/api/v3/redirects/paypal_login`.
3. Whop exchanges the code with PayPal, reads the account's email, name and verification status, and mints a `paypal_link_token`.
4. Whop redirects the browser to your `return_url` with either `?paypal_link_token=…` or `?error=…` appended.
5. Your page reads the query string and calls Whop to save the payout method.

Whop verifies the account at step 3. Step 5 only saves the result and can run from your backend.

## 1. Find the payout method

[List supported payout methods](/api-reference/beta/payouts/list-supported-payout-methods) and pick the one with `supports_paypal_login: true`.

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

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

  const methods = await client.payouts.supportedMethods.list({
  	account_id: "biz_xxxxxxxxxxxxx",
  	destination_currency: "usd",
  });
  const paypal = methods.data.find((method) => method.supports_paypal_login);
  if (!paypal) throw new Error("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"
  ```
</CodeGroup>

## 2. Start the login

[Create a PayPal link session](/api-reference/beta/payouts/create-paypal-link-session) and send the account holder to the returned `authorize_url`. It stops working at the returned `expires_at`, 15 minutes later.

<CodeGroup>
  ```typescript TypeScript theme={null}
  const login = await client.payouts.paypalLinkSessions.create({
  	account_id: "biz_xxxxxxxxxxxxx",
  	supported_payout_method_id: paypal.id,
  	destination_currency: "usd",
  	return_url: "https://yourapp.example/settings/payouts",
  });
  // redirect the browser to login.authorize_url
  ```

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

The browser arrives at your `return_url` with `paypal_link_token` or `error` added to its query string:

| Query string | Meaning |
| - | - |
| `?paypal_link_token=…` | Logged in. Spend the token in the next call. |
| `?error=paypal_login_canceled` | The holder backed out. Let them start again. |
| `?error=paypal_login_failed` | PayPal refused, the link was reused, or the exchange failed. Start again. |

The token is single use and lasts 15 minutes. If the holder opens `authorize_url` after `expires_at`, Whop shows a plain "Invalid or expired link" page instead of redirecting.

## 3. Save the payout method

[Create the saved payout method](/api-reference/beta/payouts/create-saved-payout-method) with the token in place of `fields`. Use the same `account_id`, `supported_payout_method_id` and `destination_currency` the session started with. The token is bound to them. Whop saves the email PayPal returned and names the method.

<CodeGroup>
  ```typescript TypeScript theme={null}
  const paypalLinkToken = new URL(request.url).searchParams.get("paypal_link_token");
  if (!paypalLinkToken) throw new Error("PayPal login did not complete");

  const method = await client.payouts.methods.create({
  	account_id: "biz_xxxxxxxxxxxxx",
  	supported_payout_method_id: paypal.id,
  	destination_currency: "usd",
  	paypal_link_token: paypalLinkToken,
  });
  ```

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

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

If Whop refuses the account, the call returns `400` with a `message` written for the holder. Show it as is. The token survives a refusal, so a transient error can be retried. A verification or name refusal needs a fresh login once they fix it.

The method now works like any other and can receive a [payout](/developer/platforms/manual-payouts).

## What your user sees

PayPal's consent screen names Whop as the app requesting their email, name, and verified status. The redirects back to your `return_url` all happen in the same tab, so if you opened PayPal in a pop-up, your return page must notify its opener and close.


## Related topics

- [Create PayPal Link Session](/api-reference/beta/payouts/create-paypal-link-session.md)
- [Payouts](/api-reference/beta/payouts/payout.md)
- [PaymentRequest](/elements/beta/payments/paymentRequest.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.