- 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
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)
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:Open the PayPal Developer Dashboard
Open Apps & Credentials
Open or create a REST app
Copy the client ID and secret
Step 2: Connect PayPal to Lovable
Use a sandbox REST app for the first connection, so you can try payments without moving real money.Open PayPal in Connectors
Add a connection
Name the connection
PayPal Sandbox or PayPal Live when you keep a connection for each environment. The name is only used inside Lovable to identify the connection.Configure the connection
- Environment: select Sandbox (testing) or Live (production). Sandbox (testing) is selected by default. Use a REST app from that same environment.
- 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.
- Secret: paste the secret from the same REST app.
Choose who can use this connection
Connect
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.Client ID must be at least 20 letters, numbers, underscores, or hyphens
Client ID must be at least 20 letters, numbers, underscores, or hyphens
Secret must be 16-512 characters with no spaces
Secret must be 16-512 characters with no spaces
PayPal could not be reached. Try again in a moment.
PayPal could not be reached. Try again in a moment.
PayPal did not validate your credentials.
PayPal did not validate your credentials.
My app can't list recent PayPal transactions
My app can't list recent PayPal transactions
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.