Show Purchase Confirmation

This tutorial will guide you through the process of retrieving a checkout order and rendering the confirmation HTML snipped on your confirmation page. Once the customer has completed the purchase, they will be redirected to the confirmation page as specified by the merchant_urls.confirmationproperty you used when you created the checkout order.

For instance with these merchant urls:

"merchant_urls": {
  "terms": "",
  "checkout": "{}",
  "confirmation": "{}",
  "push": "{}"

the users would be redirected to:

1. Retrieve the Checkout Order

You should now use the checkout order id found in the query parameter sid from the merchant-confirmation url to fetch the order from Klarna.

GET /checkout/v3/orders/order_id
Authorization: Basic pwhcueUff0MmwLShJiBE9JHA==
Content-Type: application/json

2. Create an Order in Your System

You should now create the order in your system with the order data that you want to store. The full resource structure of an order can be found in the Order Management API.

3. Render the Confirmation Snippet

The checkout order now contains an updated HTML snippet under the html_snippet property. You should extract the HTML snippet and display it on your confirmation page. Note: You should remove any browser session references to the checkout order after you have rendered the confirmation snippet.

String htmlSnippet = "<div id=\"klarna-checkout-container\"...";
System.out.println(String.format("<div>%s</div>", htmlSnippet));

Example Image. In different regions this looks different.Example Image. In different regions this looks different.

What’s next?

You have now integrated Klarna Checkout into your confirmation page.

The next step is to learn how to confirm purchase .

Best practices

Any custom styling won’t be applied to the confirmation page since there are no merchant customizable components on it. Buttons on this page are intentionally kept in the Klarna colours so that the consumers understand that it is an interaction with Klarna.