Connect PayPal
Create PayPal REST app credentials for Sandbox and Live, paste them into ExtensionBill, and let it register the PayPal webhook for you.
ExtensionBill charges buyers through a PayPal REST app that you own. You need one app for Sandbox and one for Live. Buyers pay the PayPal account that owns the app; ExtensionBill never receives the funds.
Before you start
| Environment | You need |
|---|---|
| Sandbox | Any PayPal login on the PayPal developer dashboard. PayPal creates sandbox business and personal test accounts for you. |
| Live | A PayPal Business account. Every live payment settles to its balance. A Personal account must be upgraded to Business in your PayPal settings first, or open a PayPal Business account. |
Subscriptions need nothing extra: billing plans and subscriptions are available to REST apps automatically (how PayPal subscriptions work).
Create Sandbox credentials
-
Open sandbox apps. Go to PayPal sandbox apps (Apps & Credentials with the toggle on Sandbox) and log in with your PayPal account.
-
Create the app. Click Create App, choose type Merchant, name it (for example “My Extension Sandbox”) and click Create App. PayPal links it to your default sandbox business account.
-
Copy the credentials. Copy the Client ID. Under Secret key 1, click Show (or the copy icon) and copy the Secret. Stuck? PayPal guide: get your client ID and secret.
Create Live credentials
-
Open live apps. Go to PayPal live apps (Apps & Credentials with the toggle on Live) and log in with the PayPal Business account that should receive payments. No Business account yet? Open a PayPal Business account.
-
Create the app. Click Create App, choose type Merchant, name it (for example “My Extension Live”) and click Create App.
-
Copy the credentials. Copy the Client ID, then click Show under Secret key 1 and copy the Secret. More detail: PayPal guide: go live with REST.
Sandbox and Live apps have different Client IDs and Secrets, even with the same name, and each pair only works in its own environment.
Paste credentials into ExtensionBill
-
Pick the environment. In the dashboard, set the Sandbox / Live toggle in the top bar to match the app you created. Then open Settings → PayPal. (When you create an app, the onboarding wizard’s step 2, Connect PayPal (Sandbox), shows the same form.)
-
Paste the Client ID and Secret. ExtensionBill validates them a moment after you stop typing by requesting an OAuth token from PayPal. Nothing is saved until validation passes.
-
Save. The page shows Connected, the merchant email, when it was verified, the webhook status (Registered) and when the last PayPal event arrived.
That’s it. Next, create your products.
What happens when you save
- ExtensionBill verifies the credentials again with PayPal.
- It encrypts the secret with AES-256-GCM and stores it. The secret is never shown again, never logged and never returned by any API.
- It creates (or replaces) a webhook on your REST app pointing to
https://api.extensionbill.com/webhooks/paypal/<appId>/<env>. - It syncs your catalog to that PayPal environment: a catalog product and a billing plan for each recurring price. One-time prices need nothing in PayPal.
Scopes and missing scopes
Validation returns the OAuth scopes PayPal granted your app and, if anything ExtensionBill needs is absent, a missingScopes list. New Merchant apps normally include everything.
With missing scopes, some operations fail with paypal_error, for example handling disputes or managing subscriptions. Open the app in PayPal’s Apps & Credentials, enable the missing capabilities, save, and validate again.
The PayPal webhook
ExtensionBill registers the webhook and subscribes it to every event it handles: payment captures (completed, pending, denied, refunded, reversed), approved orders, the full subscription lifecycle (created, activated, updated, re-activated, suspended, cancelled, expired, payment failed), subscription sales (completed, refunded, reversed) and disputes (created, updated, resolved).
Never create this webhook by hand in PayPal or paste its URL anywhere. Every incoming event is verified with PayPal’s signature verification API using the stored webhook ID. An event that fails verification is logged as rejected and never processed.
| Status | Meaning |
|---|---|
| Registered | The webhook exists on your PayPal app and events are flowing. |
| None | No webhook yet, usually because the environment isn’t connected. |
| Error | PayPal refused to create the webhook. The error message is shown next to the status. |
If the status shows Error, or you deleted the webhook in PayPal, click Re-register webhook. ExtensionBill creates a fresh webhook and stores its new ID.
In Sandbox you can also click Send test event to have PayPal simulate an event. See Simulate PayPal webhook events.
Rotate credentials
-
Create a new secret in PayPal. Open your app in Apps & Credentials (sandbox apps or live apps) and generate a new secret, or create a new Merchant app under the same PayPal account.
-
Update ExtensionBill. In Settings → PayPal for that environment, paste the Client ID and new Secret and save. ExtensionBill verifies them, replaces the webhook and re-syncs your catalog.
-
Retire the old secret. Once the page shows Connected and Registered, disable or delete the old secret (or app) in PayPal.
Credential changes are recorded in Developers → Audit log.
Disconnect
Settings → PayPal → Disconnect removes the stored credentials for that environment. Then:
- New checkouts in that environment fail with
409 paypal_not_connected, and products with recurring prices show sync statusnot_connected. - Existing PayPal subscriptions are not canceled. They keep billing in PayPal, but ExtensionBill stops processing their renewals, cancellations and refunds until you reconnect.
- Customers, orders, entitlements and licenses already recorded stay in ExtensionBill.
Reconnecting the same PayPal account restores everything, including webhook delivery.
Troubleshooting
Invalid credentials
- Copy both values again with PayPal’s copy icon; the Secret is easy to truncate.
- Make sure the Client ID and Secret come from the same app, and that the app or secret wasn’t deleted or disabled.
- Check that the Sandbox / Live toggle in ExtensionBill matches the toggle on PayPal’s Apps & Credentials page. A sandbox app fails validation in Live, and the reverse.
- Validation is rate-limited to 20 attempts per 5 minutes. On
429 rate_limited, wait fordetails.retryAfterSec.
Webhook status is Error
- Read the error message next to the status; it comes from PayPal.
- PayPal limits how many webhooks a REST app can have. Delete unused ones in the app’s Webhooks section on developer.paypal.com, then click Re-register webhook.
- If the app was deleted in PayPal, create a new one and paste its credentials.
Payments complete but access doesn’t update
Open Developers → PayPal events. No events: re-register the webhook. Events rejected: signature verification failed, usually because the webhook was recreated outside ExtensionBill; click Re-register webhook. Events failed: open one to see the error, fix the cause, then click Replay.
Checkout says PayPal isn’t connected
409 paypal_not_connected means the key’s environment has no PayPal connection. A pk_live_ key needs Live credentials; a pk_test_ key needs Sandbox credentials.
PayPal links
| Action | PayPal page | Official guide |
|---|---|---|
| Open a Business account (Live) | Open business account | Get started |
| Create a sandbox app, copy Client ID and Secret | Sandbox apps | Get client ID and client secret |
| Create a live app, copy Client ID and Secret | Live apps | Go live with REST |
| Find sandbox test accounts | Sandbox accounts | Sandbox accounts guide |
| Webhooks (reference only; ExtensionBill registers them) | PayPal webhooks |