After creating a Payment Session, you can create a hosted payment page session, allowing consumer access to the payment interface without iframe integration.
When you have created a Payment Session with the Payment Provider’s API, you will be able to create an HPP Session. This HPP Session will let you show the Payment Provider’s interface to the Consumer without any iframe integration on your website.
The HPP Session is deeply linked to the Payment Session, both Sessions will have a tied lifecycle meaning that the HPP Session will expire 1 hour before the Payment Session, see session lifetime. Additionally, when the Payment Session status is updated, HPP Session’s one is too.
Multiple *HPP Sessions *can be linked to the same *KP Session *if you need to have multiple customization at the same time, although it is considered as a bad practice.
All the customization of the appearance of the Hosted Payment Page is done in this call, see ourcustomization guide.
Description
Creates a session with HPP-API
Reference
For a full explanation of required and accepted (optional) parameters, check HPP Create Session Options below.
The integration layer should use the URLs sent back in the create session call when interacting with the HPP Session as the structure of the URLs may change. Do not recreate URLs by generating a made up structure.
After creating the KP Session you need to compute the corresponding URL to one of them. To do so, simply use the URL that you are using to access them via API.
Merchant URLs are used to redirect the Consumer’s browser to your website after a successful payment, a rejection or a cancellation by the Consumer.
When you let success, cancel or failure empty or null, the Consumer will be shown a generic action confirmation page. See our customization guide to get to see how these pages look like. When error is empty or null, the failure definition will be used.
On all of these links you can use placeholders to get more context on the transaction, for example the {{session_id}} tag will be replaced by the identifier of the HPP Session.
Name
Requirement
Usage
success
Optional
Consumer will get redirected there after a successful authorization of payment for KP. When using KP as Payment Provider, a place holder will be required to get the KP Authorization Token to place the order.
Consumer will get redirected there when payment is refused by Klarna. If an error occurs and noerrorURL was given, then the consumer will also get redirect to this URL.
error
Optional
Consumer will get redirected there when an error occurred in the flow. If this parameter is not set and afailureURL is present, the Consumer will get redirected there.
You can use optional parameters to customize the look and feel of the Hosted Payment Page to better match your own brand. Please refer to our customization page.
All customization parameters are described in our customization guide for the Hosted Payment Page.
The Klarna Payments integration has some specific parameters that you can pass to the HPP Session creation call to better configure what the consumer will see. Please read our KP integration guide.
The HPP Session is created on a successful response. It contains different URLs that you may use to interact with depending on the way you intend to distribute the Payment Page.
It is recommended to use these links directly and to avoid recreating them in your backend as the way they are defined may change without notice.
Field Key
Type
Description
session_id
String
Generated identifier for the Session, referenced as HPP Session ID afterwards.
session_url
API Endpoint URL
Use this URL to read the HPP Session you just created. This endpoint requires Merchant Credentials to accept requests.
distribution_url
API Endpoint URL
Use this URL to distribute to your Consumer the HPP Session you just created by Email or SMS. Learn more in the distribution of the HPP Session chapter. This endpoint requires Merchant Credentials to accept requests.
redirect_url
Public URL
Use this URL to redirect directly the Consumer’s browser to the Payment Page or the HPP Session you just created. Learn more in the distribution of the HPP Session chapter.
qr_code_url
Public URL
Use this URL to display a QR Code to your Consumer, so that they will access the Payment Page or the HPP Session you just created by scanning it with their phone. Learn more in the distribution of the HPP Session chapter.