Klarna Partner Product API - Shopping Session (release/4)

Download OpenAPI specification:Download

Authentication

klarna_api_key

Use the Klarna API key as HTTP Basic Authentication credentials

Security Scheme Type API Key
Header parameter name: Authorization

Shopping Session API

A session is referred to a shopping session initiated by a shopping at partner or sub-partner websites. The session is utilized throughout the complete shopping journey from pre-purchase, purchase and post-purchase flow by various Klarna booster products like OSM, KEC and SIWK etc. and enable interoperability between the products to provide the user a cohesive experience in all Klarna touchpoints.

Creates a shopping session

Creates a shopping session.

Request
Security:
path Parameters
account_id
required
string (AccountIdentifier)

Identifier of the Account the action is done on behalf of

Example: krn:partner:global:account:live:LWT2XJSE
Request Body schema: application/json
object (SupplementaryDataBody)

Pass supplementary data to Klarna that will be amended to the payment request.

Responses
201

Shopping session created

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

503

Service Temporarily Unavailable, the system is temporarily unavailable to process the request.

post/v1/accounts/{account_id}/shopping/sessions
Request samples
application/json
{
  • "supplementary_purchase_data": {
    }
}
Response samples
application/json
{
  • "shopping_session_id": "krn:shopping:eu1:live:session:b1de90a1-1069-414c-a119-2b8e68f9e252",
  • "created_at": "2024-01-01T12:00:00Z",
  • "expires_at": "2024-01-01T12:00:00Z"
}

Get a shopping session

Get a shopping session.

Request
Security:
path Parameters
account_id
required
string (AccountIdentifier)

Identifier of the Account the action is done on behalf of

Example: krn:partner:global:account:live:LWT2XJSE
shopping_session_id
required
string (ShoppingSessionId) [ 1 .. 255 ] characters

The session ID to read.

Example: krn:shopping:eu1:live:session:b1de90a1-1069-414c-a119-2b8e68f9e252
Responses
200

Shopping session retrieved

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

503

Service Temporarily Unavailable, the system is temporarily unavailable to process the request.

get/v1/accounts/{account_id}/shopping/sessions/{shopping_session_id}
Request samples
curl -i -X GET \
  'https://api-global.klarna.com/v1/accounts/{account_id}/shopping/sessions/{shopping_session_id}' \
  -H 'Authorization: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "shopping_session_id": "krn:shopping:eu1:live:session:b1de90a1-1069-414c-a119-2b8e68f9e252",
  • "created_at": "2024-01-01T12:00:00Z",
  • "expires_at": "2024-01-01T12:00:00Z"
}

Update a shopping session

Update a shopping session.

Request
Security:
path Parameters
account_id
required
string (AccountIdentifier)

Identifier of the Account the action is done on behalf of

Example: krn:partner:global:account:live:LWT2XJSE
shopping_session_id
required
string (ShoppingSessionId) [ 1 .. 255 ] characters

The session ID to update.

Example: krn:shopping:eu1:live:session:b1de90a1-1069-414c-a119-2b8e68f9e252
Request Body schema: application/json
object (SupplementaryDataBody)

Pass supplementary data to Klarna that will be amended to the payment request.

Responses
200

Shopping session updated

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

503

Service Temporarily Unavailable, the system is temporarily unavailable to process the request.

patch/v1/accounts/{account_id}/shopping/sessions/{shopping_session_id}
Request samples
application/json
{
  • "supplementary_purchase_data": {
    }
}
Response samples
application/json
{
  • "shopping_session_id": "krn:shopping:eu1:live:session:b1de90a1-1069-414c-a119-2b8e68f9e252",
  • "created_at": "2024-01-01T12:00:00Z",
  • "expires_at": "2024-01-01T12:00:00Z"
}

Get an interoperability token

Get an interoperability token that should be passed to the Acquiring Partner to enable continuity of the customer journey.

Request
Security:
path Parameters
account_id
required
string (AccountIdentifier)

Identifier of the Account the action is done on behalf of

Example: krn:partner:global:account:live:LWT2XJSE
shopping_session_id
required
string (ShoppingSessionId) [ 1 .. 255 ] characters

The session ID to read.

Example: krn:shopping:eu1:live:session:b1de90a1-1069-414c-a119-2b8e68f9e252
Responses
200

Interoperability token retrieved

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

503

Service Temporarily Unavailable, the system is temporarily unavailable to process the request.

get/v1/accounts/{account_id}/shopping/sessions/{shopping_session_id}/interoperability-token
Request samples
curl -i -X GET \
  'https://api-global.klarna.com/v1/accounts/{account_id}/shopping/sessions/{shopping_session_id}/interoperability-token' \
  -H 'Authorization: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "token": "string"
}