Confirm the Purchase

In this tutorial you will learn how to confirm that you have received and created an order in your system. This confirmation is needed in response to a push notification from Klarna, indicating that the customer has completed a purchase.

Use Case

A customer has completed a purchase and you want to create the associated order in your system.


A customer has completed a purchase with Klarna Checkout.

1. Handle the POST Request

Once a customer has completed a purchase, Klarna will notify you by sending a POST request. The POST request will be sent to the push notification URL that you provided when you created the checkout order.

Note: There is approximately a 2 minute delay before the order-confirmation push to the merchants is attempted.

For instance with these merchant urls:

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

You would receive a POST request to the URL with the placeholder {} replaced with the correct order_id and an empty body.

For example:

2. Request the Order from Klarna

You should now use the order id found in the query parameter checkout_uri to fetch the order from the Order Management API.

GET /ordermanagement/v1/orders/order_id
Authorization: Basic pwhcueUff0MmwLShJiBE9JHA==
Content-Type: application/json

3. Backup Order Creation

The confirmation page might fail to load for a number of reasons, even though the purchase is confirmed by Klarna. However, once you receive a POST request at the push confirmation endpoint, you can be assured that the purchase was successful and you should make sure that you have created the order and create if it doesn't exist. The full resource structure of an order can be found in the API Reference.

4. Acknowledge the Order

You should now send a request to Klarna saying that you've acknowledged the order.
Note: Klarna will send the push notifications every two hours for a total of 48 hours or until you confirm that you have received the order. After 48 hours we will stop sending notifications, but the order is still open and can be captured or updated as normal.

POST /ordermanagement/v1/orders/order_id/acknowledge
Authorization: Basic pwhcueUff0MmwLShJiBE9JHA==
Content-Type: application/json

Order Creation and the Order Confirmation Push

  1. There should be an attempt to acknowledge the order on the confirmation page.
  2. The order confirmation push should be implemented as a backup.
  3. If the order doesn't exist when the push is received the order should be created. If there is no intention to ship the order, it should be canceled.
  4. Every order should either be acknowledged or canceled. Orders which will not be shipped should be canceled immediately.

Ship and Capture the Order to Finalize the Payment

At this point, the order has been confirmed and you can proceed with the next steps. Once you have shipped the product, you need to capture the order in order to finalize the payment. The order can be found at Klarna's Merchant Portal or you can integrate with our Order Management platform using the APIs provided.


What's next?

  • You now know how to create and read a checkout order. We encourage you to take a look at the next step in the tutorial where you will test your integration to make sure everything works as expected.
  • In order to finalize the payment, and initiate the payout to you, you need to capture the order after you have shipped it to the consumer. You can either use our APIs for managing orders, or you can perform this action manually each time in our Merchant Portal.
  • A very detailed guide explaining some "gotchas", in case you get stuck, can be found in the best practices guide.