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

# PayPal

> Configure PayPal as your payment gateway

# PayPal

The PayPal gateway uses the PayPal Subscriptions API v1 for recurring billing.

## Configuration

```php theme={null}
// config/subscribd.php
'gateways' => [
    'paypal' => [
        'driver'                       => \Pixelworxio\Subscribd\Gateways\PaypalGateway::class,
        'client_id'                    => env('PAYPAL_CLIENT_ID'),
        'client_secret'                => env('PAYPAL_CLIENT_SECRET'),
        'webhook_id'                   => env('PAYPAL_WEBHOOK_ID'),
        'mode'                         => env('PAYPAL_MODE', 'live'),
        'token_refresh_buffer_seconds' => env('PAYPAL_TOKEN_REFRESH_BUFFER', 60),
    ],
],
```

## Environment variables

```env theme={null}
PAYPAL_CLIENT_ID=...
PAYPAL_CLIENT_SECRET=...
PAYPAL_WEBHOOK_ID=...
PAYPAL_MODE=live
```

Set `PAYPAL_MODE=sandbox` for development and testing.

## Webhooks

Register `https://yourapp.com/subscribd/webhook/paypal` as a webhook endpoint in the [PayPal Developer Dashboard](https://developer.paypal.com/developer/applications). Enable:

* `BILLING.SUBSCRIPTION.ACTIVATED`
* `BILLING.SUBSCRIPTION.UPDATED`
* `BILLING.SUBSCRIPTION.CANCELLED`
* `BILLING.SUBSCRIPTION.SUSPENDED`
* `PAYMENT.SALE.COMPLETED`
* `PAYMENT.SALE.DENIED`
* `PAYMENT.SALE.REVERSED`

Copy the **Webhook ID** from the dashboard and set it as `PAYPAL_WEBHOOK_ID`.

## Limitations

* `interval_count` must be `1`. PayPal does not support billing cycles greater than one interval unit.
* Trial extension is not supported natively. `ExtendTrial` updates the local `trial_ends_at` only.
* Proration is handled by Subscribd's built-in `ProrationEngine`, not natively by PayPal.

## Next steps

* **[Braintree](/gateways/braintree)** — PayPal's card-native gateway
* **[Webhooks](/advanced/webhooks)** — Full webhook reference
