Token-based initialisation

Initialise the SDK with an order token to access card payment methods.

Token-based initialisation creates a RevolutCheckoutInstance for a specific order. Use this method when you create orders on your server before showing the checkout, and you need card field or card popup functionality.

Payment methods available:

Payment methodReferenceIntegration guide
Card fieldSDK referenceGuide
Card pop-upSDK referenceGuide

Type signature

function RevolutCheckout(
token: string,
mode?: 'prod' | 'sandbox'
): Promise<RevolutCheckoutInstance>

Parameters

ParameterDescriptionTypeRequired
tokenOrder token from the Create an order responsestringYes
modeAPI environment. Default: 'prod''prod' | 'sandbox'No
Tip

The mode parameter must match the environment used to create the order.

Returns

Returns a Promise<RevolutCheckoutInstance> with the following methods:

interface RevolutCheckoutInstance {
createCardField: (options?: CardFieldOptions) => RevolutCheckoutCardField
payWithPopup: (options?: PopupOptions) => RevolutCheckoutInstance
setDefaultLocale: (locale: Locale) => void
destroy: () => void
}

Example

import RevolutCheckout from '@revolut/checkout'

const instance = await RevolutCheckout('order_token_here', 'prod')
Was this page helpful?