Skip to content

Kustom Checkout in a mobile app

Embed Kustom Checkout in iOS, Android or React Native apps with the Mobile SDK. Set up the return URL, handle events and errors or migrate from Klarna.

The Kustom Mobile SDK embeds Checkout in iOS, Android and React Native apps. Your server creates the order, and the SDK renders its html_snippet and reports checkout events. Choose a platform guide for setup; shared behavior is documented below.

Your backend, not the app, creates the order. The SDK never holds your API credentials. Expose an endpoint that creates the order and returns its html_snippet, and have the app fetch from there. The platform pages call it <YOUR-URL>.

Choose a native checkout view or attach the SDK to an existing web view.

Native. The SDK renders Checkout in its own view. The platform guides use this approach:

  1. Fetch a Kustom Checkout html_snippet from your server.
  2. Set the snippet on a KustomCheckoutView and display it.
  3. Handle the events the view dispatches.

Hybrid. The SDK attaches to a web view that already displays your checkout page:

  1. Initialize the SDK with your web view.
  2. Present your web page as usual.
  3. Notify the SDK about the web view’s navigation events.
  4. Handle the events the SDK dispatches.

Some payment methods open a bank or wallet app for authorization. Set the return URL to a custom scheme your app handles, such as myapp://, so the customer can return. Every platform requires it.

The third-party app handles the return; you don’t need a separate handler when your app reopens.

BankID may not return the customer automatically. After authenticating with BankID, the customer might have to switch back to your app themselves.

The SDK reports through two callbacks: one for product events and one for errors. The names are the same on every platform.

A product event (KustomProductEvent) carries:

FieldTypeDescription
actionstringThe event’s name.
paramsmap of string to anyThe event’s parameters.

Product actions:

actionparamsWhat it means
completeuriThe customer has paid. uri is the confirmation URL to load next.
externaluriThe customer chose an external payment method. uri is where to send them.
validation_errorerror_type, error_textA validation error you’ve opted to handle yourself.

An error (KustomMobileSDKError) carries:

FieldTypeDescription
namestringThe error’s name.
messagestringA description of the error.
isFatalbooleanWhether the error stops the checkout.
sessionIdstringThe session the error occurred in.

If isFatal is set, checkout can’t continue. Navigate away from the checkout view.

KustomMobileSDK is built on the Klarna Mobile SDK and has feature parity with it for Kustom Checkout. It was branched from these versions:

PlatformKlarna Mobile SDK version it was migrated from
Android2.6.29
iOS2.7.0
React Native2.4.10

You can migrate directly from older Klarna versions without upgrading through the versions listed above:

  1. Swap the dependency for KustomMobileSDK, as shown on your platform page.
  2. Rename KlarnaCheckoutView to KustomCheckoutView wherever you construct or reference it. The event and error types follow the same rename.

This page is also available as Markdown — append .md to its URL — and is indexed in llms.txt.