Merchant Web SDKs
Upsell.promotionalBanner
doc

Upsell.promotionalBanner

Revolut - Promotional banner

Display Revolut's promotional banner on your checkout page after a payment has been made to offer your customers to join Revolut, get reward and get access to Revolut Pay (if it's available on your checkout) for future purchases.

Compared to the Upsell.cardGatewayBanner, the promotionalBanner module lets you display the banner when your customer used a non-Revolut payment method.

When a customer submits their details via the banner, a request is sent to register the user for the promotional offer (given the provided data is valid).

How to mount the promotional banner

To mount the Revolut promotional banner on your page:

  1. First, import the RevolutCheckout package.
  2. Call the .upsell() method to load the upsell module.
  3. Define the bannerOptions containing the ID of the transaction associated with the current checkout session.
  4. Optionally, you can define the style object in the bannerOptions to customise the look of the banner.
  5. Initialise the promotionalBanner instance and mount the banner to allow your customer to access the upsell flow.
import RevolutCheckout from '@revolut/checkout'

const { promotionalBanner } = await RevolutCheckout.upsell({
locale: 'auto', // Optional, defaults to 'auto'
mode: 'sandbox', // Optional, defaults to 'prod'
publicToken: '<yourPublicApiKey>', // Merchant public API key
})

const bannerOptions = {
transactionId: '<uniqueTransactionId>',
amount: 500,
currency: 'GBP'
}

promotionalBanner.mount(target, bannerOptions)

Mount options

The mount method of the upsell module accepts two argument:

promotionalBanner.mount(target, bannerOptions)

Use the target to define where the promotional banner will be rendered on your page.

Use the Options object to connect the banner to the specific order associated with the current checkout session.

promotionalBanner.mount(target: HTMLElement, bannerOptions: Options)

type Options {
transactionId: String,
currency: String,
amount: Number,
customer: {
name: String,
email: String,
phone: String
},
style: {
border: String,
borderRadius: String,
backgroundColor: String,
primaryColor: String
}
}
ParameterDescriptionFormatRequired
targetDetermines where the Revolut upsell widget will be rendered on your site (e.g., a DOM node like, document.getElementById("kiwi") or a CSS selector like, "#kiwi").StringYes

Options object:

ParameterDescriptionFormatRequired
transactionIdUnique ID of the transaction associated with the current checkout session.StringYes
currencyISO 4217 currency code in uppercase displayed on the promotional banner.StringYes
amountMaximum reward amount displayed on the promotional banner, specified in minor currency units (e.g., cents for EUR).NumberNo
customerObject containing customer details the merchant already has.

note
  • If phone is passed, it is pre-filled on the banner and the user only needs to confirm their consent
  • If email is passed, instructions on how to claim the reward will be also sent to that address
ObjectNo
styleObject containing visual customisation parameters for the promotional banner.ObjectNo

customer object:

ParameterDescriptionFormatRequired
nameCustomer's name. Example: 'Firstname Lastname'StringNo
emailCustomer's email. Example: 'example@email.com'StringNo
phoneCustomer's phone number, containing country code and '+' character. Example: '+441234567890'StringNo

style object:

ParameterDescriptionFormatRequired
borderCSS string defining the border attributes of the banner.StringNo
borderRadiusCSS value for the border radius. Applies to the banner and interactive elements inside, for example, inputs and buttons.StringNo
backgroundColorCSS string defining the background colour of the banner.StringNo
primaryColorCSS string defining the primary colour of the banner.StringNo

Returns

Methods object:

ParameterDescriptionFormatRequired
destroyManually destroy the promotional widget if needed.FunctionNo

Examples

Example with minimal required parameters

import RevolutCheckout from '@revolut/checkout'

const { promotionalBanner } = await RevolutCheckout.upsell({
publicToken: '<yourPublicApiKey>'
})

const bannerOptions = {
transactionId: '<unique-transaction-id>',
currency: 'GBP'
}

promotionalBanner.mount(document.getElementById('promotional-banner'), bannerOptions)

Example with all parameters

import RevolutCheckout from '@revolut/checkout'

const { promotionalBanner } = await RevolutCheckout.upsell({
publicToken: '<yourPublicApiKey>'
})

const bannerOptions = {
transactionId: '<uniqueTransactionId>',
currency: 'GBP',
amount: 500,
customer: {
name: 'John Doe',
email: 'john.doe@example.com',
phone: '+441234567890'
},
style: {
border: '1px solid black',
borderRadius: '0',
backgroundColor: 'white',
primaryColor: '#007681'
}
}

promotionalBanner.mount(document.getElementById('promotional-banner'), bannerOptions)
Was this page helpful?