During the checkout, your customer can see Klarna as a payment method, select it, and go ahead with the purchase. To enable these customer interactions, you need to perform two main actions:
load() call for displaying the widget and the
authorize() call for getting the purchase authorization.
To make the call for displaying the widget, first you need to add and initialize the SDK and then place a container in your page.
Add the SDK by including the following script in the body section of your checkout page.
Initialize the SDK by making an
init() call and passing the
client_token from the Initiate a payment step.
client_token relies on the created session, which expires after 48 hours. The purchase might fail after this time.
Add a container in the HTML file of your checkout page. This container specifies where to place the widget.
The widget container should not appear on the checkout page until your customer selects Klarna as a payment method. For more details, see the Display the widget section.
The Klarna widget requires a minimum width of 280px. For more insights about placing the widget, see our Best practices guide.