On this page
No Headings
Last updated: June 10, 2026
Deprecation notice: New integrations should use the PayPal JavaScript SDK v6.
This integration uses the PayPal JavaScript SDK v5, and it's to troubleshoot existing integrations only.
Integrate PayPal Checkout to accept PayPal, Venmo, Pay Later, and all major credit cards.
When a buyer reaches checkout, the PayPal buttons component renders the payment methods they're eligible for. Which buttons appear depends on the configuration you set in the JavaScript SDK.
When the buyer selects a payment method, a pop-up launches and walks them through the following steps:
<script> tag fetches the PayPal SDK when your checkout page renders.createOrder callback tells your server to initiate an order with PayPal's server.createOrder callback, prompting the SDK to launch the checkout window for the order ID.onApprove callback launches after payment is confirmed.Take the following steps to set up your development environment in Node.js.
This sample integration uses the npm package manager.
Navigate to the root folder of your project, then enter npm install to run the sample application. For more information, visit npm's documentation.
In your project root folder, set up your integration by running npm install @paypal/paypal-server-sdk@1.0.0 dotenv express body-parser to install the following 4 libraries at the same time:
This sample integration uses PayPal's Server SDK v1.0.0. For more details, visit the PayPal Server SDK documentation and log in to your account.
The following code sample shows a typical package.json file for a PayPal integration. If you rename your server file from server.js to something else, update the filename references in the package.json script.
{
"name": "paypal-checkout-integration-backend-node",
"version": "1.0.0",
"private": true,
"type": "module",
"dependencies": {
"@paypal/paypal-server-sdk": "^1.0.0",
"body-parser": "^1.20.3",
"dotenv": "^16.3.1",
"express": "^4.18.2"
},
"scripts": {
"server-dev": "nodemon server.js",
"start": "npm run server-dev",
"prod": "node server.js",
"format": "npx prettier --write **/*.{js,jsx,md}",
"format:check": "npx prettier --check **/*.{js,jsx,md}"
},
"devDependencies": {
"concurrently": "^8.2.1",
"nodemon": "^3.0.1"
}
}If you have trouble with your app, reinstall your local library and package files using npm install.
If you have an error about loading an ES module, add "type": "module" in your package.json file. This field isn't automatically added when package.json is created.
Store your PayPal client ID and client secret in an .env file at the root of your project:
PAYPAL_CLIENT_ID=your_app_client_id_here
PAYPAL_CLIENT_SECRET=your_app_client_secret_hereThe dotenv package loads these values into your app at runtime. Never commit your .env file to version control. Add it to your .gitignore before your first commit.
PayPal checkout supports one-time payments and recurring payments.
| Payment option | Description |
|---|---|
| One-time payments | Buyers can make one-time purchases without manually entering payment information. |
| Recurring payments | Set up automatic payments at regular intervals. |