On this page
No Headings
Last updated: July 13, 2026
Estimated time: 20 minutes
Use this guide to upgrade your existing Pay Later messaging integration to the JavaScript SDK v6 to use modular components, a custom <paypal-message> web component, and flexible configuration patterns.
This upgrade is recommended. SDK v5 continues to receive security patches but no new features. PayPal has not announced a sunset date.
What's new in v6:
paypal-messages component instead of bundling all SDK features. This can result in smaller payloads and faster page rendering.<paypal-message> Lit-based element replaces the v5 data-pp-message div pattern, providing improved lifecycle visibility, encapsulation from the containing page, and auto-bootstrap support.createInstance() (no server-side setup) or a server-generated client token, depending on your integration needs.onTemplateReady and onContentReady callbacks.Review these prerequisites and compatibility notes before you start the migration.
This upgrade applies to you if:
<script> tag with a client-id query parameter in the URL (for example, sdk/js?client-id=CLIENT_ID&components=messages).paypal.Messages() or a div with the data-pp-message attribute to render Pay Later messages.This upgrade does not apply if:
https://www.paypal.com/web-sdk/v6/core as your SDK script source.How to check your current version: Open your browser DevTools, go to the Network tab, and look for the SDK script URL. If it contains sdk/js?client-id=, you are on v5.
Unchanged:
Deprecated but still works:
paypal.Messages() JavaScript interface from v5 is not available in v6. Replace it with createPayPalMessages() and fetchContent(). No grace period has been announced.Removed:
data-pp-message attribute on div elements is removed in v6. Use the <paypal-message> custom element instead.sdk/js?client-id=...&components=messages) is replaced by the modular v6 core script (/web-sdk/v6/core).Complete the following steps to update your Pay Later messaging integration from v5 to v6.
The v5 SDK loads through a single script tag with your client ID and component list as URL query parameters. In v6, the SDK uses a separate core script and initializes components through JavaScript.
What changes:
sdk/js?client-id=CLIENT_ID&components=messages to /web-sdk/v6/core.components array in createInstance().createInstance() configuration object.<script
src="https://www.sandbox.paypal.com/sdk/js?client-id=CLIENT_ID&components=messages,buttons"
data-namespace="PayPalSDK">
</script>If you use a server-generated client token instead of a client ID, pass clientToken in place of clientId:
const sdkInstance = await window.paypal.createInstance({
clientToken: "YOUR_SERVER_GENERATED_TOKEN",
components: ["paypal-messages"],
});"paypal-messages" to your existing components array.In v5, you rendered Pay Later messages using a div with the data-pp-message attribute, or by calling paypal.Messages().render() in JavaScript. In v6, you use the <paypal-message> custom HTML element.
What changes:
div with data-pp-message attribute is replaced by the <paypal-message> custom element.logo-type instead of the v5 style object).auto-bootstrap attribute simplifies initialization by handling content fetching automatically.<div data-pp-message
data-pp-amount="300.00"
data-pp-style-logo-type="primary"
data-pp-style-text-color="black">
</div>The <paypal-message> element renders as invisible until the SDK fills it with content. If you set auto-bootstrap, PayPal's data layer automatically picks up the component and fetches content without additional JavaScript. If you omit auto-bootstrap, call fetchContent() manually in Step 3.
In v5, you called paypal.Messages().render() to render the message into a target element. In v6, you create a PayPalMessages instance and either rely on auto-bootstrap or call fetchContent() to retrieve and show message content.
What changes:
paypal.Messages({...}).render('#container') is replaced by sdkInstance.createPayPalMessages() and fetchContent().onReady, onTemplateReady, and onContentReady callbacks.content.update() or setAttribute().paypal.Messages({
amount: 300.00,
placement: 'product',
style: {
layout: 'text',
logo: { type: 'primary', position: 'left' },
text: { color: 'black', size: 12 }
}
}).render('#pay-later-message');<paypal-message
auto-bootstrap
amount="300.00"
logo-type="MONOGRAM"
text-color="BLACK">
</paypal-message>// After SDK initialization from Step 1
const messagesInstance = sdkInstance.createPayPalMessages({
currencyCode: "USD",
});With auto-bootstrap, no additional fetchContent() call is required. The SDK handles content fetching automatically.
If your v5 integration updates the message when the cart total changes, update your amount-change logic to use the v6 pattern.
What changes:
setAttribute() (HTML configuration) or content.update() (JavaScript configuration) for in-place updates without full re-renders.// Re-render the entire message with a new amount
paypal.Messages({
amount: newAmount,
placement: 'product',
style: { layout: 'text', logo: { type: 'primary' } }
}).render('#pay-later-message');function updateMessageAmount(newAmount) {
const messageElement = document.querySelector('paypal-message');
messageElement.setAttribute('amount', newAmount);
}
quantityInput.addEventListener('change', (event) => {
const newAmount = calculateTotal(event.target.value);
updateMessageAmount(newAmount);
});If your v5 integration includes a Learn More modal, update it to use the v6 createLearnMore() method.
What changes:
paypal.Messages(). No separate setup was needed.createLearnMore() initialization and an event listener on the <paypal-message> element.// In v5, Learn More was built into paypal.Messages() -- no separate code needed
paypal.Messages({
amount: 300.00,
style: { layout: 'text' }
}).render('#pay-later-message');
// Clicking the message automatically opened the Learn More modalIf you use auto-bootstrap, Learn More opens automatically when a shopper selects the message. You only need explicit createLearnMore() if you want to customize the presentation mode or add callbacks like onShow, onApply, or onClose.
After you complete all the steps, a fully upgraded integration using the HTML configuration pattern looks like this:
<head>
<script
async
src="https://www.sandbox.paypal.com/web-sdk/v6/core"
onload="onPayPalWebSdkLoaded()">
</script>
</head>
<body>
<paypal-message
auto-bootstrap
amount="300.00"
logo-type="MONOGRAM"
text-color="MONOCHROME">
</paypal-message>
<script>
async function onPayPalWebSdkLoaded() {
try {
const sdkInstance = await window.paypal.createInstance({
clientId: "YOUR_CLIENT_ID",
components: ["paypal-messages"],
});
const messagesInstance = sdkInstance.createPayPalMessages({
currencyCode: "USD",
});
// Update amount when cart changes
function triggerAmountUpdate(amount) {
const messageElement = document.querySelector('paypal-message');
messageElement.setAttribute('amount', amount);
}
// Optional: customize Learn More presentation
const learnMore = await messagesInstance.createLearnMore({
presentationMode: "POPUP",
});
const messageElement = document.querySelector('paypal-message');
messageElement.addEventListener('paypal-message-click', (event) => {
event.preventDefault();
learnMore.open(event.detail.config);
});
} catch (error) {
console.error(error);
}
}
</script>
</body>After you complete the steps, run these scenarios in the PayPal sandbox to confirm the upgrade works.
https://www.sandbox.paypal.com/web-sdk/v6/core and https://www.sandbox.paypal.com/web-sdk/v6/paypal-messages.<paypal-message> element is visible on the page with a financing message (for example, "Pay in 4 payments of $75.00"). Actual messaging and terms depend on buyer eligibility and approval.Expected outcome: The Pay Later message shows the correct installment amount. Changing the cart total updates the message without a full page reload. Both SDK network requests return HTTP 200 OK status codes.
sdk/js in the network request list.sdk/js?client-id=.web-sdk/v6/core.window.paypal and verify createInstance is a function (this method only exists in v6).Expected outcome: No v5 SDK script loads. The v6 core script loads successfully. window.paypal.createInstance is defined as a function.
presentationMode setting) opens with financing details.Expected outcome: Selecting the message opens a Learn More presentation showing financing options. The presentation mode matches your configuration (MODAL, POPUP, or REDIRECT). Closing the overlay returns focus to the page without errors in the console.
If you encounter issues after upgrading, use the solutions in this section to diagnose and resolve them, or roll back to v5.
You can typically roll back to v5 while v5 remains supported. If you need to revert:
<script src="https://www.sandbox.paypal.com/sdk/js?client-id=CLIENT_ID&components=messages"></script><paypal-message> element with your original div using the data-pp-message attribute.createInstance, createPayPalMessages, fetchContent) with your original paypal.Messages().render() calls.