Instant shopping is deprecated. Use Express button instead.
During the next steps you will learn how to use Instant Shopping Button outside your domain, aka offsite. Relevant use cases are:
The idea is that you create an Instant Shopping button key that includes already all the information necessary for the purchase flow. Then, you leverage the direct links that Klarna offers to distribute and advertise. Those links lead to a page that is hosted by Klarna and offers a simple and smoooth purchase flow.
You complete this step leveraging the Instant Shopping Button Keys API from your server-side
After you complete this step you will have a static Button key ready to be used anywhere and offer a purchase flow through Instant Shopping. The button is static in the sense that it includes all the information necessary to:
An example of a request to the service in order to obtain a Button key is given below. Note that the order_amount and order_tax_amount will be calculated by the service. If the product you want to sell comes in variations (of colors, sizes) it is advised that you configure the button key with all the product variations using the items property.
Read aboutKlarna’s API URLsto know the base URL, and aboutAuthenticationto know how to authenticate when calling our REST API. More detailed documentation on the Instant Shopping orders API is available in theAPI documentation.
Button key generationTo generate a functioning button key for offsite the request must contain the following fields depending on the use case:
Upon success the response of this service will provide you the button key.
In the response body you will also find the distribution links offered by Klarna.
This is a link to a page hosted by Klarna, where your customers can buy the specific product inside the Instant Shopping flow.
An example is shown in the image below:
This is a link to page page where you can print the QRcode to the above mentioned hosted purchase page by Klarna.
An example is shown in the image below:
The recommended use of these links is for offline campaigns and/or selling online when you do not necessary need to own the webpage and UI.
Here are some ideas where you can use the links you obtained from the previous step:
When customers have followed those distributions links and placed an order through Instant Shopping then you will receive a ping at the endpoint specified by the button key setup option merchant_urls.place_order.
You then decide whether to approve or deny the purchase. It is expected that you will run all necessary validations (stock, shipping capabilities, prices, etc.) on your side. Once those are done, approve or deny the order following the guidelines below.
Deny the order
If you need to deny the purchase you need to perform a DELETE call though our API and provide some information in the request body. Note that you need to use your API credentials to authenticate.
Below you may find an example of how a deny requests may look:
Place the order
If you accept the order, then you need to place the order with our REST API. You do so by performing an HTTP POST in our API for the specific authorization_token and passing to the request body the complete Order. Note that you need to use your API credentials to authenticate.
Here is an example of how the request to approve/ place the order looks:
When the purchase is completed the consumer sees a view which summarizes what has been purchased and offers a way to buy again.
An example is shown in the image below:
After the order is created, you can manage the order either manually via our Merchant Portal or through our Order Management API.