Express button solution has been deprecated. If you're interested in the a Express Checkout experience for Klarna payments, you can learn about our new solution Klarna Express Checkout
Start by adding the script
tag inside the head
tag of your website’s HTML source code.
Take a look at the attributes you have to specify inside the script tag.
Attribute | Required | Description |
---|---|---|
src | Yes | The URL of the Express button JavaScript library. This URL is the same for playground and production environments. |
data-id | Yes | The unique merchant identifier (MID). The MID is different in playground and production. |
data-environment | No | The environment where Express button is used. The supported values are production and playground . If not set, this attribute is set to production by default. |
Make sure to only include the script once, even when adding multiple buttons on a page. Referring to the script multiple times can cause unwanted behavior.
Add the klarna-express-button
element inside the body tag of your cart page or product page, wherever you want the button to appear.
Attribute | Required | Description |
---|---|---|
data-locale | Yes | The language of the checkout page. See the list of supported locales. |
data-theme | No | The button’s color theme. Supported values are default , dark , and light . |
After the customer signs in to their Klarna account, the asynchronous callback will return their personal details. You can then use this data to prefill billing information in your checkout.
In response to the callback, you get the personal details of the authenticated user.