Tracking the HPP Session and its Status

Each HPP Session is following a state machine to map the Consumers action to a certain state, which allows any integrator to act depending on the current state. To get the current state, integrators have two way, either by reading the HPP Session using an API Endpoint or by using the callback mechanism .

Both system can be used at the same time and it is advised to have a batch running in case there was a loose in communication between systems while the callbacks were sent. As described in the callbacks reference , the callback mechanism will try to reach the integrator system with a retry mechanism, but will stop doing so if your system is not answering after a few times.

All tracking mechanism can be used in the same way with Klarna Payments and Klarna Checkout.

When integrating with Klarna Payments, as soon as the Consumer gets an authorization, you will be able to extract the Authorization Token of the KP Session from the server response, which will let you place the order. This field is not present in a KCO integration. Please see KP integration guide .

HPP Session Lifecycle

HPP Session LifecycleHPP Session Lifecycle

Status nameFinalStatus description
Status name
WAITING
Final
No
Status description
Session is created and Consumer has not entered the Payment Page yet.
Status name
IN_PROGRESS
Final
No
Status description
Consumer has entered the Payment Page on updated_at.
Status name
COMPLETED
Final
Yes
Status description
Consumer has successfully gotten an Authorization from the Payment system on updated_at. The Authorization Token is contained in the authorization_token field in a Klarna Payments integration.
Status name
FAILED
Final
No
Status description
Consumer has been declined for the Payment on updated_at. Session is still open for them to retry.
Status name
CANCELLED
Final
Yes
Status description
Consumer has cancelled the HPP Session on updated_at. This cancellation is definitive.
Status name
BACK
Final
No
Status description
Consumer has pressed the Back button on updated_at. Session is still open for them to retry. This
Status name
ERROR
Final
No
Status description
Consumer has encountered an error while paying on updated_at. Session is still open for them to retry.
Status name
DISABLED
Final
Yes
Status description
Session was disabled by API Call on the Merchant initiative on updated_at.

Reading the HPP Session updates by polling an endpoint

The HPP Session can be read by the integrator using a specific endpoint of the API . You will get the URL of the read session endpoint back from the create session call , it is the session_url parameter.

You can for example use a polling mechanism to check the status of the session and update your data depending on the payload. Although we suggest that you use the callbacks mechanism.

See our reference of the Read Session endpoint .

Getting the HPP Session updates by using the callback mechanism

When creating the HPP Session an integrator can pass an URL that will be called by our systems whenever the status of the session is updated. This is really handy to create interaction whenever something happens and avoid to have a costly polling mechanism.

See our reference of the callbacks mechanism .