Integrate the Ivy Flow into your web app in different ways.



  • You have retrieved your Ivy API Secrets
  • You have created a new Checkout Session and have the redirectUrl

JavaScript Library


Include the Ivy script for integrating the Ivy Button on each page of your site. It must always be loaded directly from, rather than included in a bundle or hosted yourself.

<script src=""></script>

Start Flow

First, you must create a data or a checkout session by calling the Ivy API directly. You will be returned a redirectUrl, which you need to start the flow.

When you have created the session and received the redirectUrl successfully, call the startIvyCheckout() function.

redirectUrlStringReceived in the response after creating a data or checkout session.
abortStrategyEnumOne of close, redirect. By default close. If close is chosen, the popup will always just close without redirection. If redirect is chosen, the popup will close, and the user will be redirected to the given errorCallbackUrl.

After calling the function, the Ivy flow will open in a modal popup or a redirect, depending on whether it is in mobile or desktop web view.

End of Flow

When the user finishes the flow, the SDK will send them back automatically to either the errorCallbackUrl or successCallbackUrl specified in the request to create the session.

Embed as iFrame

Configure URL

Append the URL parameter &iframe=true to the redirectUrl . This will make sure that the callbacks are sent via postMessage to the parent window.

// data is the response payload of /checkout/session/create
const newUrl = data.redirectUrl + '&iframe=true'

Add URL to an iframe element

Add the adapted redirectUrl as the src parameter of an <iframe> HTML element.

<iframe src=newUrl />

To allow the iframe to seamlessly adapt its size to the containing element, make sure to apply appropriate sizing either by css or inline-styles. Using the width attribute will give the iframe a static width, which is not recommended when targeting mobile devices.

<!–– ❌ not recommended for mobile devices ––>
<iframe src=newUrl width="400" />

<!–– ✅ adapt to the size of the parent element ––>
<iframe src=newUrl style="width:100%;" />



If you are using sandboxing, you need to at minimum add the following flags allow-scripts, allow-same-origin, allow-popups, allow-forms, allow-popups-to-escape-sandbox, and allow-top-navigation

Add a listener to your app

All communication between an iframed Ivy Checkout and the parent host is done via postMessage. Register a listener to start receiving messages. How you do this is up to you, but the code below shows the basics.

window.addEventListener('message', receiveMessage, false);

function receiveMessage(event) {
  const { source, type, value, redirectUrl, referenceId } = JSON.parse(;
  if (source !== 'ivy' || type !== 'iframe') {
  if (value === 'success') {
    // Handle success response
    // Use the referenceId to retrieve any more specific results with a server to server call
    console.log("User paid successfully", referenceId, redirectUrl);
  } else if (value === 'error') {
    // Handle error response
    console.log("User closed Ivy Checkout");
  } else {
    // Something went wrong

Callback body

The postMessage has the below format:

  source: 'ivy',
  type: 'iframe',
  value: 'success' | 'error', 
  redirectUrl: 'redirectUrl', // The redirectUrl according to the settings of the Checkout
  referenceId?: 'referenceId', // The referenceId passed when creating a Checkout

UI Components


Include the Ivy script for integrating the Ivy Button on each page of your site. It must always be loaded directly from, rather than included in a bundle or hosted yourself.

<script src=""></script>


Embed the UI Banner on your page simply with this HTML component. You can adapt the component to your needs by setting the parameters data-locale and data-market:

data-localeStringThe current language of the page.
data-marketStringThe current market, this will affect which banks are shown.

You can re-initialize the component by calling window.initIvy() .

Data Session

It is possible to load the Ivy Web Integration in an iframe on your website. This way, the user does not have to leave your website to authenticate with their bank.


  1. Add the SDK to your website by adding the following script tag to your code.
<script src=""></script>
  1. After creating the data session successfully, use the redirectUrl from the response to load the iframe using the following function: