Download OpenAPI specification:Download
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.
object (SupplementaryDataBody) Pass supplementary data to Klarna that will be amended to the payment request. |
Shopping session created
Bad Request, there was an error in the input of the request. The request can not be retried without modifications.
Unauthorized, the request was not authorized.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
{- "supplementary_purchase_data": {
- "content_type": "vnd.klarna.supplementary-data.v1",
- "content": {
- "acquiring_channel": "ECOMMERCE",
- "merchant_reference": "merchant-order-9876",
- "line_items": [
- {
- "name": "Black fountain pen",
- "quantity": 2,
- "total_amount": 2000,
- "total_tax_amount": 0,
- "unit_price": 1000,
- "product_identifier": "3270220049012",
- "reference": "cart-item-1234",
- "shipping_reference": "shipping-recipient-1234"
}
], - "shipping": [
- {
- "recipient": {
- "given_name": "John",
- "family_name": "Doe",
- "email": "john.doe@klarna.com",
- "phone": "844-552-7621",
- "attention": "string"
}, - "address": {
- "street_address": "800 N. High St",
- "street_address2": "Ste. 400",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "OH",
- "country": "US"
}, - "shipping_option": {
- "shipping_type": "TO_DOOR",
- "shipping_type_attributes": [
- "SIGNATURE_REQUIRED"
], - "shipping_carrier": "DHL"
}, - "shipping_reference": "DHL-123456"
}
], - "customer": {
- "given_name": "John",
- "family_name": "Doe",
- "email": "john.doe@klarna.com",
- "phone": "844-552-7621",
- "address": {
- "street_address": "800 N. High St",
- "street_address2": "Ste. 400",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "OH",
- "country": "US"
}, - "customer_accounts": [
- {
- "account_identifier": "acc_stripe_1234",
- "account_provider_url": "string",
- "given_name": "John",
- "family_name": "Doe",
- "email": "john.doe@klarna.com",
- "email_last_verified_at": "2024-01-01T12:00:00Z",
- "phone": "844-552-7621",
- "phone_last_verified_at": "2024-01-01T12:00:00Z",
- "loyalty_level": "LOW",
- "created_at": "2024-01-01T12:00:00Z",
- "updated_at": "2024-01-01T12:00:00Z",
- "last_login": {
- "occurred_at": "2024-01-01T12:00:00Z",
- "login_method": "PHONE_OTP"
}, - "purchase_history": [
- {
- "number_of_purchases": null,
- "number_of_paid_purchases": null,
- "number_of_disputed_purchases": null,
- "total_amount": null,
- "currency": null,
- "payment_method": null,
- "first_purchase_at": null,
- "last_purchase_at": null
}
]
}
], - "customer_device": {
- "app_identifier": "com.example.merchant",
- "device_identifier": "Operating System: Windows 10 Browser: Chrome 91.0.4430.212 Screen Resolution: 1920x1080 Installed Plugins: Adobe Flash Player 32.0.0.465, Java 8 Update 291 Timezone: UTC+02:00 Language: English (United States)",
- "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36",
- "ip_address": "192.168.1.1",
- "geolocation": {
- "country": "US",
- "latitude": 40.7128,
- "longitude": 74.006
}
}
}
}
}
}
{- "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.
Shopping session retrieved
Bad Request, there was an error in the input of the request. The request can not be retried without modifications.
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
curl -i -X GET \ 'https://api-global.klarna.com/v1/accounts/{account_id}/shopping/sessions/{shopping_session_id}' \ -H 'Authorization: YOUR_API_KEY_HERE'
{- "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.
object (SupplementaryDataBody) Pass supplementary data to Klarna that will be amended to the payment request. |
Shopping session updated
Bad Request, there was an error in the input of the request. The request can not be retried without modifications.
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
{- "supplementary_purchase_data": {
- "content_type": "vnd.klarna.supplementary-data.v1",
- "content": {
- "acquiring_channel": "ECOMMERCE",
- "merchant_reference": "merchant-order-9876",
- "line_items": [
- {
- "name": "Black fountain pen",
- "quantity": 2,
- "total_amount": 2000,
- "total_tax_amount": 0,
- "unit_price": 1000,
- "product_identifier": "3270220049012",
- "reference": "cart-item-1234",
- "shipping_reference": "shipping-recipient-1234"
}
], - "shipping": [
- {
- "recipient": {
- "given_name": "John",
- "family_name": "Doe",
- "email": "john.doe@klarna.com",
- "phone": "844-552-7621",
- "attention": "string"
}, - "address": {
- "street_address": "800 N. High St",
- "street_address2": "Ste. 400",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "OH",
- "country": "US"
}, - "shipping_option": {
- "shipping_type": "TO_DOOR",
- "shipping_type_attributes": [
- "SIGNATURE_REQUIRED"
], - "shipping_carrier": "DHL"
}, - "shipping_reference": "DHL-123456"
}
], - "customer": {
- "given_name": "John",
- "family_name": "Doe",
- "email": "john.doe@klarna.com",
- "phone": "844-552-7621",
- "address": {
- "street_address": "800 N. High St",
- "street_address2": "Ste. 400",
- "postal_code": "43215",
- "city": "Columbus",
- "region": "OH",
- "country": "US"
}, - "customer_accounts": [
- {
- "account_identifier": "acc_stripe_1234",
- "account_provider_url": "string",
- "given_name": "John",
- "family_name": "Doe",
- "email": "john.doe@klarna.com",
- "email_last_verified_at": "2024-01-01T12:00:00Z",
- "phone": "844-552-7621",
- "phone_last_verified_at": "2024-01-01T12:00:00Z",
- "loyalty_level": "LOW",
- "created_at": "2024-01-01T12:00:00Z",
- "updated_at": "2024-01-01T12:00:00Z",
- "last_login": {
- "occurred_at": "2024-01-01T12:00:00Z",
- "login_method": "PHONE_OTP"
}, - "purchase_history": [
- {
- "number_of_purchases": null,
- "number_of_paid_purchases": null,
- "number_of_disputed_purchases": null,
- "total_amount": null,
- "currency": null,
- "payment_method": null,
- "first_purchase_at": null,
- "last_purchase_at": null
}
]
}
], - "customer_device": {
- "app_identifier": "com.example.merchant",
- "device_identifier": "Operating System: Windows 10 Browser: Chrome 91.0.4430.212 Screen Resolution: 1920x1080 Installed Plugins: Adobe Flash Player 32.0.0.465, Java 8 Update 291 Timezone: UTC+02:00 Language: English (United States)",
- "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36",
- "ip_address": "192.168.1.1",
- "geolocation": {
- "country": "US",
- "latitude": 40.7128,
- "longitude": 74.006
}
}
}
}
}
}
{- "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 that should be passed to the Acquiring Partner to enable continuity of the customer journey.
Interoperability token retrieved
Bad Request, there was an error in the input of the request. The request can not be retried without modifications.
Unauthorized, the request was not authorized.
Not Found, the requested resource was not found.
Too Many Requests, the request was rate limited.
Internal Server Error, there was an unexpected error in the API.
Service Temporarily Unavailable, the system is temporarily unavailable to process the request.
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'
{- "token": "string"
}