> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamly.watch/llms.txt
> Use this file to discover all available pages before exploring further.

# PayPal Plugin

> PayPal subscriptions for Streamly — Client ID/secret, webhook ID, sandbox vs live, and billing flow.

**PayPal** (`payments.paypal`) is a Streamly **plugin** in the **payment** category.

PayPal adds a second checkout rail beside Stripe. Use sandbox credentials first, then switch `environment` to `live` with a live webhook ID.

## Learn the service

Watch this overview of the vendor platform (helpful before you paste keys into Streamly).

<Frame caption="Postman and the Orders API with PayPal Developers — PayPal Developer.">
  <iframe src="https://www.youtube.com/embed/_J74gOsyf7M" title="Postman and the Orders API with PayPal Developers" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen />
</Frame>

## At a glance

| | |
| - | - |
| **Plugin ID** | `payments.paypal` |
| **Category** | payment · `external_service` |
| **Status** | Wired |
| **Webhook** | `POST /api/webhooks/paypal` |

## Capabilities

* `payments.checkout`
* `payments.subscriptions`
* `payments.webhooks`

## When to use it

* Markets where buyers prefer PayPal wallets
* Second payment rail next to Stripe

## How it works

Viewer selects PayPal → Streamly creates a PayPal order/subscription → PayPal notifies `/api/webhooks/paypal` → Streamly grants access.

`environment` selects sandbox vs live API hosts.

<Note>
  Webhook endpoint: `POST /api/webhooks/paypal`
</Note>

## Activation keys

Configure in `/admin/plugins` → **PayPal** → Configure. Secret fields stay server-side — never commit them or expose as `NEXT_PUBLIC_*` unless the key is intentionally public (e.g. Stripe publishable key).

| Key | Label | Required | Secret | Notes | Docs |
| - | - | - | - | - | - |
| `clientId` | Client ID | Yes | No | REST app Client ID | [Auth](https://developer.paypal.com/api/rest/authentication/) |
| `clientSecret` | Client secret | Yes | Yes | REST secret | [Auth](https://developer.paypal.com/api/rest/authentication/) |
| `webhookId` | Webhook ID | Optional\* | Yes | **Required for live** verification | [Webhooks](https://developer.paypal.com/api/rest/webhooks/rest/) |
| `environment` | Environment | Optional | No | `sandbox` or `live` | [Sandbox](https://developer.paypal.com/api/rest/sandbox/) |

\* Treat as required before production.

Env fallbacks: `PAYPAL_CLIENT_ID`, `PAYPAL_CLIENT_SECRET`, `PAYPAL_WEBHOOK_ID`, `PAYPAL_ENVIRONMENT`.

## Setup guide

<Steps>
  <Step title="Create a REST app">
    [PayPal Developer](https://developer.paypal.com/) → Apps → create → copy sandbox Client ID/Secret.
  </Step>

  <Step title="Configure plugin">
    `/admin/plugins` → **PayPal** → keys + `environment=sandbox`.
  </Step>

  <Step title="Webhook">
    Point to `https://YOUR_HOST/api/webhooks/paypal` and paste Webhook ID.
  </Step>

  <Step title="Go live">
    Live credentials + `environment=live` + live webhook.
  </Step>
</Steps>

## Admin & Settings paths

| Path | Purpose |
| - | - |
| `/admin/plugins` | Configure |
| `/admin/subscriptions` | Entitlements |
| `/dashboard/settings` | Tenant entrypoint |

## Official vendor documentation

* [REST authentication](https://developer.paypal.com/api/rest/authentication/)
* [Webhooks](https://developer.paypal.com/api/rest/webhooks/rest/)
* [Sandbox](https://developer.paypal.com/api/rest/sandbox/)

## FAQ

<AccordionGroup>
  <Accordion title="Live payments fail verification">
    Missing or wrong `webhookId` is the usual cause.
  </Accordion>
</AccordionGroup>

## Related

* [Stripe](/plugins/stripe)
* [Bank Transfer](/plugins/bank-transfer)
* [Payments / Billing](/configuration/stripe)
* [Plugins Overview](/plugins/overview)


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