The RevolutCheckout.upsell
module of the Revolut Checkout Widget lets you display Revolut's promotional banner during and after checkout. Customers who eventually join Revolut will receive a reward and will be able to use their Revolut account to pay via Revolut Pay (if it's available on your checkout) in the future.
You have two options to display the promotional banner:
This tutorial will cover how to display the promotional banner when implementing a non-Revolut payment gateway. For more information about how to display the promotional banner with the Revolut Checkout Widget, see:
The promotionalBanner
module in the Revolut Upsell Widget allows you to display and customise a promotional banner on your checkout page after a customer made a payment. With the banner, you can invite customers to join Revolut and offer new-joiners to receive a reward after registration.
Begin with installing the RevolutCheckout.js NPM package to your project by running:
npm install @revolut/checkout
Then, import the RevolutCheckout
package into your project.
import RevolutCheckout from '@revolut/checkout'
Alternatively, you can add the embed script directly to your page where you want to use the RevolutCheckout
package. For more information, see: Install the widget: Adding the embed script.
Use the .upsell()
method to load the upsell module.
const { promotionalBanner } = await RevolutCheckout.upsell({
locale: 'auto', // Optional, defaults to 'auto'
mode: 'sandbox', // Optional, defaults to 'prod'
publicToken: '<yourPublicApiKey>', // Merchant public API key
})
Configure and customise the promotional banner by defining the bannerOptions
object with details like the transaction ID, currency, and reward amount.
const bannerOptions = {
transactionId: '<uniqueTransactionId>', // Replace with the transaction ID from your system corresponding to the promotional offer
currency: 'GBP', // Set the currency to be displayed on the banner
amount: 500, // Maximum reward amount displayed on the banner (optional)
}
Optionally, you can provide further information about your customer using the bannerOptions.customer
object.
For a complete list of parameters and their function, see: Upsell.promotionalBanner.
Optionally, you can customise the appearance of the banner using the style
object within the bannerOptions
.
bannerOptions.style = {
border: '1px solid black',
borderRadius: '0',
backgroundColor: 'white',
primaryColor: '#007681',
}
Finally, mount the banner to a target element on your page with the bannerOptions
you defined.
promotionalBanner.mount(document.getElementById('promotional-banner'), bannerOptions)
import RevolutCheckout from '@revolut/checkout'
const { promotionalBanner } = await RevolutCheckout.upsell({
publicToken: '<yourPublicApiKey>'
})
const bannerOptions = {
transactionId: '<uniqueTransactionId>',
currency: 'GBP'
}
promotionalBanner.mount(document.getElementById('promotional-banner'), bannerOptions)
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)