On this page
No Headings
Last updated: June 26, 2026
The Pay Later Messaging Configurator is a drop-in JavaScript module that you can add to your admin panel. Merchants can access the admin panel and use the Messaging Configurator to set up, customize, and preview Pay Later messaging. Based on the merchant's configuration, you can display the Pay Later messages to buyers.
Important: Provision the Messaging Configurator only for merchants belonging to PayPal Global Pay Later countries such as:
Ensure that your admin panel meets the following minimum-width requirements of the Messaging Configurator:
Note: The minimum-width requirements for Pay Later messages to be successfully displayed on the website are as follows:
The JavaScript bundle merchant-configurator.js, required for rendering and using the Messaging Configurator, is hosted in the PayPal Content Delivery Network (CDN). Go to the HTML file that defines the admin-panel page and in the <head> or <body> section, use the following sample code to load merchant-configurator.js.
<script src="https://www.paypalobjects.com/merchant-library/merchant-configurator.js" defer>
</script><body> section use the following code to define a container for the Messaging Configurator:<div id="messaging-configurator"></div><body> section, under a <script> tag, include the Messaging() method as shown in the following syntax and sample to initiate and render the Messaging Configurator.window.merchantConfigurators?.Messaging({
config: {<Pass saved configuration for return merchants. Pass empty object for merchants using Messaging Configurator for the first time. Pass empty object for merchants whose configuration is not saved>},
locale: '<Enter preferred language to render Messaging Configurator>',
merchantIdentifier: '<Enter merchant's client ID – for first-party partners; merchant's payer ID – for third-party partners>',
partnerClientId: '<Enter partner's client ID>',
partnerName: '<Enter partner's name>',
bnCode: '<Enter build-notation code that identifies a PayPal partner>',
onSave: <Enter callback-function name; callback-function can save the merchant configuration, inject configured messages into selected placements on the merchant website>,
placements: [<Enter the locations you want to offer to merchants for displaying dynamic pay-later messages, as an array of strings>]
});Note: For information on how to retrieve merchant client or payer ID, partner client ID, and BN code, see Credential reference.
Messaging() accepts an object as the input parameter and renders the Messaging configurator based on the values of the object properties. The object properties are as follows.
| Input parameter | Description |
|---|---|
config (object, optional) | For new merchants or for merchants whose messaging configuration is not saved: When rendering the Messaging Configurator for new merchants, pass an empty object - {} - as the config property's value.For return merchants: After merchants configure their dynamic Pay Later messaging using the admin panel, they publish their configuration. This triggers the onSave event and the configuration being saved is passed to the callback function corresponding to the event. When rendering the Messaging Configurator for return merchants, their saved configuration can be displayed as the default configuration. To do this, pass the saved configuration as the config value when you initiate the Messaging Configurator. The config property's structure depends on the merchant's initial configuration.For information on the config structure, see config object properties. |
locale (string, required) | Preferred language for rendering the Messaging Configurator. |
merchantIdentifier (string, required) | First-party partners: Merchant's client ID. Third-party partners: Merchant's payer ID. For information on how to retrieve the merchant client or payer ID, see Credential reference. |
partnerClientId (string, required) | Partner client ID. For information on how to retrieve the partner client ID, see Credential reference. |
partnerName (string, required) | Partner name. |
bnCode (string, required) | Build-notation code used to uniquely identify the entity placing an API call as a PayPal partner and enable tracking all transactions that originate from the PayPal partner. |
onSave (function, required) | Callback function that is called when the merchant selects Publish in the admin panel triggering the onSave event. The merchant's messaging configuration is passed as an object to the callback function. The function can save the configuration and inject appropriate messages into the merchant's website, based on the specified configuration. |
placements (array of strings, required) | List of locations that the partner displays in the Messaging Configurator. By passing a subset of the possible locations in placements[], partners regulate the locations where merchants display Pay Later messages. Possible values:
Important: All eligible merchants can display Pay Later messages in the product description page, the view cart items page, and the checkout page. So, the minimum configuration for placements[] is placements['checkout', 'product', 'cart']. Partners can additionally allow a merchant to place Pay Later messages in the other possible locations |
The following image shows the Messaging Configurator rendered when a partner passes all possible placement locations to the Messaging() method.
You can override the default styling of the Messaging Configurator to adhere to a style compatible with the admin panel. To do this,
<style> tag containing the override class names.<style>.buttonOverride {
margin: 10px;
}
.headerOverride {
color: blue;
}
</style>styleOverrides property as part of the input parameter to the Messaging() method.Messaging({
styleOverrides: {
button: 'buttonOverride',
header: 'headerOverride'
},
bnCode: 'CreditMerchantTesting',
merchantIdentifier: 'SAMPLE_identifier1234',
partnerClientId: 'PARTNER_SAMPLE_iden3456',
partnerName: 'PartnerABC',
onSave: MessagingConfigHandler,
placements: ['homepage', 'cart_preview', 'category', 'checkout', 'product', 'cart', 'product_preview']
});Notes:
After the merchant configures the Pay Later messages in the Messaging Configurator and selects Publish, the onSave event is triggered. The merchant's messaging configuration is passed as a config object to the callback function. You can program the callback function to,
Messaging().config property value. This renders the Messaging Configurator with the merchant's saved configuration as the default configuration, when the merchant returns to the admin panel.In the HTML file that corresponds to the admin-panel page, under the <script> tag where the Messaging() method is included, use the following sample and define the callback function (for example, MessagingConfigHandler) corresponding to the onSave event.
<script>
const MessagingConfigHandler = (data) => {
console.log('Messaging Config', data);
};
Messaging({
bnCode: 'CreditMerchantTesting',
merchantIdentifier: 'SAMPLE_identifier1234',
partnerClientId: 'PARTNER_SAMPLE_iden3456',
partnerName: 'PartnerABC',
onSave: MessagingConfigHandler,
placements: ['homepage', 'cart_preview', 'category', 'checkout', 'product', 'cart', 'product_preview']
});
</script>The callback function accepts the config object as the input parameter (data).
The object properties depend on the merchant's configuration. Using the Messaging Configurator, a merchant can configure text and banner messages. The merchant can configure text messages for the following placements:
The merchant can configure banner messages for the following placements:
Example 1: Sample config object when the merchant configures text messages for product, cart, and checkout placements.
{
"product": {
"layout": "text",
"logo-type": "inline",
"placement": "product",
"status": "enabled",
"text-color": "black",
"text-size": "12"
},
"cart": {
"layout": "text",
"logo-type": "inline",
"placement": "cart",
"status": "enabled",
"text-color": "black",
"text-size": "12"
},
"checkout": {
"layout": "text",
"logo-type": "inline",
"placement": "checkout",
"status": "enabled",
"text-color": "black",
"text-size": "12"
},
"product_preview": {
"layout": "text",
"logo-type": "inline",
"placement": "product_preview",
"status": "disabled",
"text-color": "black",
"text-size": "12"
},
"cart_preview": {
"layout": "text",
"logo-type": "inline",
"placement": "cart_preview",
"status": "disabled",
"text-color": "black",
"text-size": "12"
},
"homepage": {
"layout": "flex",
"placement": "homepage",
"status": "disabled",
"color": "black",
"ratio": "8x1"
},
"category_page": {
"layout": "flex",
"placement": "category_page",
"status": "disabled",
"color": "black",
"ratio": "8x1"
}
}Example 2: Sample config object when the merchant configures a text message for product and a banner message for homepage.
{
"product": {
"layout": "text",
"logo-type": "inline",
"placement": "product",
"status": "enabled",
"text-color": "black",
"text-size": "12"
},
"homepage": {
"layout": "flex",
"placement": "homepage",
"status": "enabled",
"color": "black",
"ratio": "8x1"
},
"cart": {
"layout": "text",
"logo-type": "inline",
"placement": "cart",
"status": "disabled",
"text-color": "black",
"text-size": "12"
},
"checkout": {
"layout": "text",
"logo-type": "inline",
"placement": "checkout",
"status": "disabled",
"text-color": "black",
"text-size": "12"
},
"product_preview": {
"layout": "text",
"logo-type": "inline",
"placement": "product_preview",
"status": "disabled",
"text-color": "black",
"text-size": "12"
},
"cart_preview": {
"layout": "text",
"logo-type": "inline",
"placement": "cart_preview",
"status": "disabled",
"text-color": "black",
"text-size": "12"
},
"category_page": {
"layout": "flex",
"placement": "category_page",
"status": "disabled",
"color": "black",
"ratio": "8x1"
}
}| Object.<placement-name>. property | Possible values | Description |
|---|---|---|
status |
| Specifies whether the placement is selected in the Messaging Configurator. |
layout |
| Type of message – light-weight text message or flexible banner message. |
placement |
| Location of the Pay Later message. |
logo-type(present in the object only if layout is text) |
| Specifies how the PayPal logo is rendered in text Pay Later messages. |
text-color(present in the object only if layout is text) |
| Logo and text colour of the Pay Later text messages. |
text-size(present in the object only if layout is text) |
| Font size of the Pay Later text message. |
color(present in the object only if layout is flex) |
| Color of the message background for Pay Later banner messages. |
ratio(present in the object only if layout is flex) |
| Width x height of the flexible banner. |
To display the Pay Later messages that the merchant customizes, in your front-end code, include the scripts necessary to render the messages. Based on your code structure, you can render the messages using HTML inline attributes or JavaScript.
Use the following merchant-configurator.js functions to auto-generate the HTML inline attributes that you can use in your front-end code:
generateHeaderScript(): Generates the script necessary to load the JS SDK messages component that helps render the Pay Later messages.generateMessagingCodeSnippet(): Uses the parameters of the input object passed to the onSave callback function and generates the upstream messaging code necessary to render the Pay Later messages, in a specific location, in the format that the merchant chooses.You can use the getEligibleCountries() function, to retrieve the list of countries where Pay Later offers are supported.
The function accepts an object as the input parameter and generates the script that must be included in the header part of your front-end code (inside the <head></head> tags), to load the JS SDK messages component. The JS SDK messages component is necessary to render the Pay Later messages.
Note: If you have already implemented the code to include the JS SDK messages component in your front-end code's header, you can skip using the generateHeaderScript() function.
window.merchantConfigurators?.generateHeaderScript({
bnCode: '<Enter build-notation code that identifies a PayPal partner>',
clientId: '<Enter merchant's client ID>',
country: '<Enter merchant's country as a two-letter country code>',
currency: '<Enter merchant's local currency as a three-letter code>'Notes:
generateHeaderScript().country is US or a country where Global Pay Later offers are not available, the function generates a script as specified in the Output script 1 tab.generateHeaderScript().country is a country where Global Pay Later offers are available, the function generates a script as specified in the Output script 2 tab.The input object properties are as follows.
| Object.property | Type | Description |
|---|---|---|
bnCode | string | Build-notation code used to uniquely identify the entity placing an API call as a PayPal partner and enable tracking all transactions that originate from the PayPal partner. |
clientId | string | First-party partners: Merchant's client ID. Third-party partners: Merchant's payer ID. For information on how to retrieve the merchant client or payer ID, see Credential reference. |
country | string | Two-letter country code corresponding to the merchant's country. Examples: US, AU, FR |
currency | string | Two-letter currency code corresponding to the merchant's local currency. Examples: USD, INR |
The function accepts an object as the input parameter and generates the upstream messaging code necessary to render the Pay Later messages, in a specific location, in the format that the merchant chooses.
Important: Ensure to use the generateMessagingCodeSnippet() function to generate the HTML inline attributes code necessary to display Pay Later messages.
window.merchantConfigurators?.generateMessagingCodeSnippet({
messageConfig: <Individual placement messaging config returned to the onSave callback function> ,
productPrice: <Price of a particular product, to be used in the message to reflect actual installment cost>
});The input object properties are as follows.
| Object.property | Type | Description |
|---|---|---|
messageConfig | object | The config object passed to the onSave callback function contains the entire merchant configuration, for multiple placements. Extract an individual placement's config details and pass them as an object in this property. Example: { "layout": "text", "logo-type": "inline", "placement": "cart", "status": "enabled", "text-color": "black", "text-size": "12" } |
productPrice | string | Product price or cart amount. Example: 500.94 |
The function returns an array of strings – each string is a two-letter country code corresponding to a country where merchants can offer Pay Later offers.
window.merchantConfigurators.getEligibleCountries()To enable testing the Messaging Configurator in the PayPal sandbox environment, in the code to render the Messaging Configurator, pass the merchant client ID retrieved from Developer dashboard > Testing Tools > Sandbox Accounts as the merchantIdentifier property value.
For information on how to retrieve the merchant client ID, see Credential reference.
Use the following checklist to validate the Messaging Configurator and the subsequent display of Pay Later messages in the appropriate webpages.
Messaging() method are populated as options in the Messaging Configurator.onSave callback is saved and used to populate the Messaging Configurator, the saved configuration overrides the default configuration.Example 1

Example 2
![]() | ![]() | ![]() |