During the next steps you will learn how to use Instant Shopping Button outside your domain, aka offsite. Relevant use cases are:
Blogs: Buy without redirects from blogs or other posts;
Ads: Buy without redirects from ads;
QR codes: Scan-and-buy experience with a hosted page by Klarna;
Email campaigns: Direct links to buy from email and newsletter campaigns;
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:
identify you as a merchant,
do the necessary setup in terms of e.g. purchase country, locale, etc.,
specify the product(s) being sold,
define the applicable shipping options.
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.
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: