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

# PayPal

> Accept PayPal payments and subscriptions in your website.

You can set up PayPal payments entirely through Lumi's chat. Name PayPal in your request and describe what you want to sell:

* "Let people pay for my e-book with PayPal, \$15 one-time."
* "Add a \$9.99/month membership billed through PayPal."

With your PayPal app credentials, Lumi works directly in your PayPal business account and builds the whole payment flow in your website:

* **One-time payments**: a PayPal button that takes the buyer to PayPal to approve the payment, then records the completed payment in your database.
* **Subscriptions**: Lumi creates the product and subscription plan in your PayPal account (reusing existing ones with the same name and price), adds a subscribe button, and keeps each subscription's status up to date.
* **Webhook**: Lumi registers a webhook so your website is notified when payments complete, are refunded, or when subscriptions are activated, cancelled, suspended or fail to renew.
* **Pricing page and gating**: paid content is only shown to customers who have paid.

You can also ask Lumi about your PayPal account at any time, for example "Show my recent transactions," "List my subscription plans," "Refund this order," or "Cancel this subscription."

> [!NOTE]
>
> PayPal is available for web projects. If you don't name a payment provider, Lumi uses [Stripe](https://docs.lumi.new/en/features/stripe.md).

## Connect your PayPal credentials

**1. Create a REST app in PayPal**

In the PayPal Developer Dashboard, go to **Apps & Credentials** and create or open a REST app. Use the **Sandbox** tab for testing, or the **Live** tab for real payments. Copy the app's **Client ID** and **Secret key**.

**2. Enter the credentials in Lumi**

Either fill in the PayPal credentials card that Lumi shows in the chat, or open the **Tools** tab in your workspace and click the **PayPal** card. Enter the **PayPal client ID** and **PayPal client secret**, choose the **Environment** (**Sandbox (testing)** or **Live**), then click **Save** and **Verify**.

> [!WARNING]
>
> Never paste your credentials into a chat message. They are saved securely in your project's [Secrets](https://docs.lumi.new/en/features/secrets.md). Sandbox credentials only work with the Sandbox environment, and Live credentials only with Live. A mismatch is the most common reason PayPal rejects the credentials.

### Control what Lumi can change

On the **PayPal** card in the Tools tab, every action that changes your PayPal account has an approval setting: **Always allow**, **Ask each time** or **Never allow**. By default, creating products and plans is allowed, while **refunds** and **cancelling subscriptions** ask for your approval each time. Read-only actions, such as listing transactions, are always allowed.

## Test and go live

**1. Test in the sandbox**

With Sandbox credentials, no real money moves. On the PayPal page, log in with a sandbox buyer account (PayPal Developer Dashboard → **Testing Tools** → **Sandbox Accounts** → the email and password of a Personal account). After paying, check that the payment or subscription record appears in [Cloud → Data](https://docs.lumi.new/en/features/databases.md) and that your page shows the purchase.

**2. Switch to live**

Create a Live app in PayPal, then on the **PayPal** card enter its Client ID and Secret and set the Environment to **Live**. Ask Lumi to switch to live: products and plans from the sandbox don't carry over, so Lumi recreates them in your live account and registers the webhook again.

**3. Final test and launch**

Test once more with a low-priced item, then publish your website and share it.

If something goes wrong at any step, tell Lumi. It checks your PayPal account and your functions' logs to find and fix the problem.


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