Skip to main content
PayPal is a checkout service for taking payments online. The PayPal connector lets your Lovable app create checkouts, capture approved orders (take the money after the buyer approves), issue refunds, and read order details in a PayPal account you already have. It’s designed for apps that charge buyers through PayPal Checkout. PayPal is available as an app + chat connector: one shared connection that works in the project chat while you build and in your published apps. With PayPal, your app can:
  • Create a checkout for an order
  • Capture the order after the buyer approves it
  • Refund a capture, in full or in part
  • Read an order’s status
  • List recent transactions after you enable Transaction Search
This page is about the PayPal connector, where you connect a PayPal account you already have. Looking for payments Lovable sets up for you? See Payments. The two are different features. Built-in payments use Stripe or Paddle.

Common use cases and example apps

These examples show what you can build with PayPal, each with a prompt to start from.

How to connect PayPal

Who can create PayPal connections depends on your plan and workspace settings. App + chat connectors are available by default. On Business and Enterprise plans, Who can create connections and clients starts at Admins. Some Enterprise workspaces start at No one, which disables the connector. An admin or owner changes it in Connectors → Admin settings → App + chat connectors. You can create multiple PayPal connections using different REST apps, which is useful for separating sandbox and live payments. A REST app is the app you create in the PayPal Developer Dashboard. Each REST app has its own client ID and secret. When the connection is created, you can link it to the projects where you want to use it. Anyone building in a project can ask Lovable in chat to link their project to it.

Prerequisites

Before connecting PayPal, make sure you have:
  • A PayPal account. A live PayPal REST app needs a verified PayPal business account.
  • A REST app on Apps & Credentials, in sandbox or in live
  • Permission to create connections in your Lovable workspace (see Who can create connections and clients)
Payments made through this connector go to your PayPal account. PayPal charges its fees directly, and billing is handled by PayPal, not Lovable.

Step 1: Get your PayPal client ID and secret

A REST app has a client ID and a secret. The client ID identifies the REST app. The secret lets Lovable call PayPal for that REST app. Sandbox and live each have their own REST apps, so copy both values from the REST app in the environment you want. To get a client ID and secret:
1

Open the PayPal Developer Dashboard

2

Open Apps & Credentials

Go to Apps & Credentials. Select Sandbox to test payments, or Live to take real payments.
3

Open or create a REST app

New accounts include a default REST app under REST API apps. To add a REST app, click Create App, enter an App Name, select Merchant, and click Create App. Merchant is the type for taking payments in your own app. Platform is for taking payments on behalf of other businesses.
4

Copy the client ID and secret

On the REST app page, copy the client ID and the secret from that same REST app. Store the secret securely.
The secret functions like a password. Keep it secure and never share it publicly. You will need the client ID and the secret in the next step.
See PayPal’s documentation for more: Get started with PayPal REST APIs.

Step 2: Connect PayPal to Lovable

Use a sandbox REST app for the first connection, so you can try payments without moving real money.
1

Open PayPal in Connectors

Open Connectors and select PayPal. For the other places to open the catalog from, see Where to find connectors.
2

Add a connection

Click Connect on the connector page. The form is split into collapsible sections, Details, Configure connection, and Sharing.
3

Name the connection

Under Details, Lovable fills in a name for the connection, which you can change, for example to PayPal Sandbox or PayPal Live when you keep a connection for each environment. The name is only used inside Lovable to identify the connection.
4

Configure the connection

Under Configure connection, enter:
  1. Environment: select Sandbox (testing) or Live (production). Sandbox (testing) is selected by default. Use a REST app from that same environment.
  2. Client ID: paste the client ID from that REST app. Sandbox and live REST apps are separate. Open Apps & Credentials next to the field opens the Apps & Credentials page.
  3. Secret: paste the secret from the same REST app.
5

Choose who can use this connection

Under Sharing, the connection is private to you by default and shows a Private label. To share it, click Share with others. Then add workspace members by email, or click Invite entire workspace to make the connection available to everyone in your Lovable workspace.See Who can use connections and clients for more information.
6

Connect

Click Connect at the bottom of the form. Lovable verifies the client ID and secret against the PayPal API before saving the connection.
When connected, anyone building in a project can ask Lovable in chat to link their project to PayPal (based on configured connection-level access). Your Lovable apps can then create checkouts, capture approved orders, and issue refunds.

How checkout works

The buyer approves the payment in PayPal. Your app captures the order on the server after that approval. Your app marks the order paid when the capture succeeds. The secret does not appear in the browser. Requests go through Lovable’s connector gateway. PayPal can tell your app when a payment completes. Lovable builds the check that confirms each message really came from PayPal before your app acts on it. Your app reads recent transactions from PayPal. PayPal can take up to 3 hours to include a new transaction in that list. The list needs Transaction Search enabled on the REST app.

Test a payment in sandbox

To pay in sandbox, open Testing Tools, then Sandbox Accounts, in the PayPal Developer Dashboard. Sign in with a personal sandbox account. Sandbox payments stay inside PayPal’s test accounts.

Go live

Create a second connection with the client ID and secret from your live REST app. Set Environment to Live (production). Then unlink the sandbox connection from the project and link the live connection.

Limitations

The PayPal connector cannot:
  • Give each person who uses your app a separate PayPal business account. Each connection is one PayPal REST app, shared across the projects linked to it. Buyers still pay with their own PayPal accounts at checkout.

Troubleshooting

Use these checks when connecting fails, or when your app cannot list transactions.
Lovable rejected the client ID before calling PayPal. Paste the client ID again from Apps & Credentials. It must be at least 20 letters, numbers, underscores, or hyphens.
Lovable rejected the secret before calling PayPal. A space, including one at the end of a paste, causes this. Copy the secret again with no spaces. It must be 16 to 512 characters.
Lovable could not reach PayPal, so the credentials were not checked. Click Connect again in a moment.
PayPal rejected the client ID and secret. In the PayPal Developer Dashboard, open Apps & Credentials and copy the client ID and secret from the same sandbox or live REST app as the Environment you selected. Click Show error to see PayPal’s response.
The REST app needs Transaction Search before PayPal will list transactions. Open the REST app on Apps & Credentials, enable Transaction Search, and save. The change can take several hours to take effect, so try the listing again later. Checkout, capture, and refunds work without Transaction Search.

Manage your PayPal connection

Connections are managed from Connectors: select PayPal, then open the connection.
  • Unlink projects to remove PayPal access from specific projects while keeping the connection available for others. See Unlink projects from a connection for the steps.
  • Delete the connection to remove it from the workspace entirely. Deleting is permanent. It removes the credentials from all linked projects, and app features that use PayPal stop working until a new connection is added. See Delete a connection for the steps and who can delete.