Last updated

Read Session with Hosted Payment Page - API Details


This page provides details on how to read a Hosted Payment Page (HPP) session using Klarna Checkout's API.

Endpoint description

This section describes the endpoint for retrieving HPP session status.

Reference

For a complete list of returned values, refer to the API Reference.

Url structure

https://{endpoint}/hpp/v1/sessions/{session_id}

Operation

GET

Example

curl https://api.klarna.com/hpp/v1/sessions/<session_id> --header "Authorization: Basic <token>" --header "Content-Type: application/json" --header “Cache-Control: no-cache”

Happy flow examples

These examples demonstrate typical responses when polling an HPP session.

Newly created HPP Session

{
    "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

{
    "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 - Default value for place_order_mode

{
    "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"
}

With place_order_mode as PLACE_ORDER or CAPTURE_ORDER

{
    "session_id": "39a1c773-bafd-754d-af1f-b30c592f1267",
    "status": "COMPLETED",
    "order_id": "a1a8f727-2756-6058-bd3c-40069be0994b",
    "klarna_reference": "X438HG0Q",
    "updated_at": "2019-05-13T14:54:04.675Z",
    "expires_at": "2019-05-15T13:51:43.507Z"
}

Important Considerations: