HPP API: Read the HPP Session

When you have created an HPP Session you will have the ability to read its content by using the session_url that you got back in the create session response . For that, you only to make a request to the endpoint and you will get data that lets you track the update of the session.

Endpoint description

DescriptionGets the status of the HPP Session
Description
Reference
Gets the status of the HPP Session
For a full list of returned values, please read API Reference.
Description
Url structure
Gets the status of the HPP Session
https://{endpoint}/hpp/v1/sessions/{session_id}
Description
Operation
Gets the status of the HPP Session
GET
Description
Example
Gets the status of the HPP Session
curl https://api.klarna.com/hpp/v1/sessions/<session_id> --header "Authorization: Basic <token> " --header "Content-Type: application/json" --header “Cache-Control: no-cache”
Field KeyTypeDescription
Field Key
session_id
Type
String
Description
Identifier of the session that was read.
Field Key
status
Type
String
Description
The current status of the Session. You can read more about statuses in our session lifecycle article .
Field Key
updated_at
Type
Date
Description
Last time this session was updated. Dates format is described here.
Field Key
expires_at
Type
Date
Description
Date when this session will not be able for the consumer to pay anymore. You can read more about lifetime in our session lifetime article . Dates format is described here.
Status nameStatus description
Status name
WAITING
Status description
Session is created and Consumer has not entered the Payment Page yet
Status name
IN_PROGRESS
Status description
Consumer has entered the Payment Page on updated_at
Status name
COMPLETED
Status description
Consumer has successfully gotten an Authorization from the Payment system on updated_at, Authorization Token is contained in the authorization_token field.
Status name
FAILED
Status description
Consumer was not able to completely fulfil the payment on updated_at
Status name
CANCELLED
Status description
Consumer has pressed the Back button on updated_at
Status name
ERROR
Status description
Consumer encountered an error while paying on updated_at
Status name
DISABLED
Status description
Session was disabled by API Call on the Merchant initiative on updated_at

Happy flow examples

These are the responses that an integration layer will get when polling the HPP Session during its fulfilment.

Newly created HPP Session

1
2
3
4
5
6
{
    "session_id": "39a1c773-bafd-754d-af1f-b30c592f1267",
    "status": "WAITING",
    "updated_at": "2019-05-13T14:51:46.288Z",
    "expires_at": "2019-05-15T13:51:43.507Z"
}

Consumer has loaded the HPP Session

1
2
3
4
5
6
{
    "session_id": "39a1c773-bafd-754d-af1f-b30c592f1267",
    "status": "IN_PROGRESS",
    "updated_at": "2019-05-13T14:52:57.540Z",
    "expires_at": "2019-05-15T13:51:43.507Z"
}

Completed HPP Session

Klarna Payments

1
2
3
4
5
6
7
{
    "session_id": "39a1c773-bafd-754d-af1f-b30c592f1267",
    "status": "COMPLETED",
    "authorization_token": "a1a8f727-2756-6058-bd3c-40069be0994b",
    "updated_at": "2019-05-13T14:54:04.675Z",
    "expires_at": "2019-05-15T13:51:43.507Z"
}

Klarna Checkout

1
2
3
4
5
6
{
    "session_id": "39a1c773-bafd-754d-af1f-b30c592f1267",
    "status": "COMPLETED",
    "updated_at": "2019-05-13T14:54:04.675Z",
    "expires_at": "2019-05-15T13:51:43.507Z"
}