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).
To mount the Revolut promotional banner on your page:
RevolutCheckout
package..upsell()
method to load the upsell module. bannerOptions
containing the ID of the transaction associated with the current checkout session.style
object in the bannerOptions
to customise the look of the banner.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)
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
}
}
Parameter | Description | Format | Required |
---|---|---|---|
target | Determines 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" ). | String | Yes |
Options
object:
Parameter | Description | Format | Required |
---|---|---|---|
transactionId | Unique ID of the transaction associated with the current checkout session. | String | Yes |
currency | ISO 4217 currency code in uppercase displayed on the promotional banner. | String | Yes |
amount | Maximum reward amount displayed on the promotional banner, specified in minor currency units (e.g., cents for EUR ). | Number | No |
customer | Object containing customer details the merchant already has. note
| Object | No |
style | Object containing visual customisation parameters for the promotional banner. | Object | No |
customer
object:
Parameter | Description | Format | Required |
---|---|---|---|
name | Customer's name. Example: 'Firstname Lastname' | String | No |
email | Customer's email. Example: 'example@email.com' | String | No |
phone | Customer's phone number, containing country code and '+' character. Example: '+441234567890' | String | No |
style
object:
Parameter | Description | Format | Required |
---|---|---|---|
border | CSS string defining the border attributes of the banner. | String | No |
borderRadius | CSS value for the border radius. Applies to the banner and interactive elements inside, for example, inputs and buttons. | String | No |
backgroundColor | CSS string defining the background colour of the banner. | String | No |
primaryColor | CSS string defining the primary colour of the banner. | String | No |
Methods
object:
Parameter | Description | Format | Required |
---|---|---|---|
destroy | Manually destroy the promotional widget if needed. | Function | No |
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)
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)