If you have an Express Checkout integration, PayPal recommends upgrading to PayPal Checkout using the JavaScript SDK. The JavaScript SDK has the following benefits:
Visit the Eligibility Page to learn more about the countries, currencies, and card brands that PayPal Checkout supports.
If your current integration is Express Checkout - Billing Agreement, you must upgrade to PayPal Checkout. You can use your site’s branding with PayPal Checkout, allowing customers to pay with PayPal, Pay Later options, Venmo, and alternative payment methods.
Locate the endpoint URLs in your code that manage starting, reviewing, and completing paymetns. Check the API requests for the following METHOD parameter values:
SetExpressCheckout
, GetExpressCheckoutDetails
, CreateBillingAgreement
, DoReferenceTransaction
Review the core API calls from your current integration and make a list of the parameters, such as PAYMENTREQUEST_0_AMT.
Map these parameters to the new API using our parameter mapping tool in our PayPal API Transformer.
If you don't already have one, sign up for a PayPal developer account.
Follow this onboarding document to get a client ID and secret, access token, and your sandbox account credentials.
Follow this account configuration document to set up your sandbox account and test purchases before going live in your live account.
Set up your front end to use PayPal payment buttons in PayPal Checkout. Select your upgrade path: choose 'For NVP/SOAP API-only integration' if you currently have an API-only integration, or choose 'For NVP/SOAP API and JavaScript SDK v4' if you're currently using checkout.js.
PayPal's JavaScript Web SDK supports how you want to accept payments on your website. Our SDK handles displaying the buttons for PayPal and other payment methods, so your customers can pay with whatever method they choose. See Getting started for more information.
1. Follow steps in the Integrate PayPal Web SDK guide to set up and customize your PayPal payment buttons with JavaScript Web SDK v6.
If you are using a previous version of PayPal's JavascriptSDK (checkout.js), upgrade your SDK to access the full range of features offered by PayPal Checkout.
Step 1: Update the SDK Script
First, you'll need to replace the old checkout.js
script tag with the new v6 SDK script.
12345678910
12345678910
Note: For production, use the production URL: https://www.paypal.com/web-sdk/v6/core.js
Step 2: Generate a clientToken
(server-side)
In v6, you no longer pass your client-id
directly in the script tag. Instead, your server must generate a short-lived, browser-safe clientToken
.
You will need to create a dedicated endpoint on your server that your frontend can call to fetch this token.
Here’s a conceptual example using Node.js with Express:
1. Create a server endpoint to handle the token request from your frontend.
12345678910
2. Create a helper function to generate a clientToken
. This function will securely call the PayPal API.
12345678910
For more detailed information, please refer to the official v6 JS Web SDK authentication documentation or see our example repo here.
Step 3: Initialize the SDK and render buttons (client-side)
On your frontend, you’ll fetch the clientToken
from your server and use it to initialize the PayPal SDK.
1. Add containers for your payment buttons
12345678910
12345678910
2. Fetch the clientToken, create an instance of the PayPal SDK, check for eligible payment methods and handle checkout flow on button click.
12345678910
By following these steps, you can successfully migrate your legacy integration to the new v6 JS Web SDK and take advantage of its modern features and improvements. For more detailed information, please refer to the official v6 JS Web SDK documentation.
If you have an Express Checkout integration, you must set up server-side processing. You'll need to generate a client token, upgrade your NVP/SOAP API integraiton to the Orders v2 API, and set up a listener to handle API responses.
For billing agreements without immediate purchase, merchants call SetExpressCheckout with ZERO AMOUNT and billing type parameters, redirect customers to PayPal for authorization, then use CreateBillingAgreement to establish the recurring payment authorization WITHOUT processing an immediate payment.
After customer approval, merchants process recurring payments using DoReferenceTransaction with the stored billing agreement ID. This API accepts variable amounts, making it suitable for usage-based billing, installments, or subscriptions with changing prices. The system requires merchant approval from PayPal for production use and operates under specific transaction limits based on account verification status.
The modern PayPal Recurring Checkout system revolutionizes recurring payments through a REST-based architecture centered on three core components: the Payment Method Tokens API v3 for secure payment storage, the Orders API v2 for transaction processing, and Smart Payment Buttons for optimized checkout experiences.
The vault architecture securely stores encrypted payment methods using a two-phase token system. Setup tokens (temporary, 3-day expiry) capture initial customer consent and payment method details. These convert to payment method tokens (permanent) that merchants store for recurring transactions. This approach eliminates raw payment data from merchant systems while supporting multiple payment methods per customer, including PayPal wallets, credit cards, and alternative payment options like Venmo.
Once established, payment method tokens enable frictionless recurring transactions through the Orders API. The system supports sophisticated billing scenarios including trial periods, setup fees, and variable amounts. Each transaction includes stored credential indicators for proper authorization routing and supports immediate capture or authorization-capture workflows based on business requirements.
Use the Payment Method Tokens v3 API to create and manage vaulted payment methods, and use the Orders v2 API for processing recurring transactions. The following table shows how a billing agreement setup request in NVP/SOAP API maps to a PayPal Checkout request in the Payment Method Tokens v3 REST API:
NVP/SOAP API | Orders v2 REST API |
METHOD=SetExpressCheckout (with AMT=0) |
POST /v3/vault/setup-tokens |
METHOD=GetExpressCheckoutDetails |
POST /v3/vault/setup-tokens/{setup_toekn_id} |
METHOD=CreateBillingAgreement |
POST /v3/vault/payment-tokens
|
METHOD=DoReferenceTransaction
|
POST /v2/checkout/orders with vault_id |
To help you construct the request body to support the Orders v2 format, copy and paste your NVP/SOAP reqeuset body into our API Transformer tool.
The NVP/SOAP integration uses the CreateBillingAgreement API to establish a billing agreement without an immediate payment. When setting up a billing agreement for future recurring payments without an initial charge, you set the amount to ZERO in SetExpressCheckout, obtain customer approval, then call CreateBillingAgreement to establish the recurring payment authorization.
To create a billing agreement without immediate payment using PayPal Checkout, you need to make calls to the Payment Method Tokens v3 API: a Create setup token POST request to initiate the vault process, and after customer approval, a Create payment token request to finalize the vault storage.
The following are examples of NVP/SOAP API request payloads and how they map to PayPal Checkout requests in the Payment Method Tokens v3 REST API:
12345678910
12345678910
12345678910
12345678910
12345678910
12345678910
12345678910
12345678910
Create a handleResponse
function to set up a listener that returns an HTTP status code from the API response.
handleResponse
function to make a POST
call to the /api/orders
endpoint and return an HTTP status code response.errorMessage
object to show an error message when handleResponse
returns an error code.For more information about Orders V2 error scenarios, see OrdersV2 Error Messages page.
This example shows a handleResponse()
function:
12345678910
Replace IPN(Instant Payment Notification) to webhooks for asynchronous event processing.
/webhook
) to receive events.
PAYMENT.CAPTURE.COMPLETED
).
PAYMENT.CAPTURE.COMPLETED
).
See the Orders v2 API reference to configure the details of your integration.
Before going live, test your integration in the sandbox environment. Learn more about card testing, simulating successful payments using test card numbers and generating card error scenarios using rejection triggers.
Note: Use the credit card generator to generate test credit cards for sandbox testing.
Follow this checklist to take your application live:
See Move your app to production for more details