Understand how to create customer tokens for future transactions, handle tokenization scenarios, and manage the step-up consent flow across integration paths.
Payment Tokenization is the process of securely saving a customer's payment method for future use. It creates a customer token that Acquiring Partners store and use to authorize subsequent transactions — either when the customer is present (on-demand payments) or not present (subscriptions, recurring charges).
Tokenization always requires the customer to complete a step-up flow through the Klarna Purchase Journey to provide explicit consent.
Payment Tokenization follows a consistent pattern across both integration paths (server-side integration and hosted checkout):
request_customer_token and token scopesSTEP_UP_REQUIRED because customer consent is mandatory for tokenizationcustomer_tokenTokenization scenarios:
| Scenario | Description |
|---|---|
| Tokenization only | Save a payment method without an immediate charge. Used for free trials, wallet linking, or account setup. The webhook delivers the customer_token directly — no further API call is needed. |
| Tokenization combined with authorization | Create a token while processing the first Payment Authorization. The webhook delivers both the customer_token and a klarna_network_session_token to finalize the initial payment. |
Token scopes:
| Scope | Authorization pattern | Use cases |
|---|---|---|
payment:customer_present | On-demand charges when the customer is actively using the service | Ride-hailing, food delivery, in-app purchases |
payment:customer_not_present | Recurring charges without customer interaction | Subscriptions, membership renewals, scheduled billing |
Tokenization flow components:
| Component | Description |
|---|---|
| Payment Authorization API | Klarna API endpoint for requesting tokenization. Refer to authorizePayment |
| Customer Token | Token issued by Klarna representing a saved payment method, used for future authorizations |
| Payment Request | Entity created when Klarna requires step-up verification. Tracks the tokenization state during the Klarna Purchase Journey |
| Payment Transaction | Final transaction entity created when tokenization is combined with an initial Payment Authorization |
| Klarna Purchase Journey | Customer-facing interface for consent collection and verification |
| Klarna web SDK | JavaScript SDK that launches the Klarna Purchase Journey in a pop-up window (hosted checkout path) |
| Klarna webhooks | Asynchronous notifications delivering the customer token and authorization outcomes |
There are two ways to handle Payment Tokenization: server-side integration and hosted checkout. Both paths follow the same tokenization logic but differ in who manages the customer-facing experience and the Klarna Purchase Journey.
In a server-side integration, Partners manage the customer-facing experience and redirect the customer to the Klarna Purchase Journey using the payment_request_url. The Acquiring Partner backend handles the authorizePayment calls and webhook processing.
When to use: Partners control their own checkout and tokenization flow, want to manage how the Klarna Purchase Journey is launched (redirect or SDK pop-up), and need flexibility in their user experience. Partners handle their own state management and error handling. This path requires the Partner to manage customer redirects, handle asynchronous webhook notifications, and implement state management for the step-up flow.
request_customer_token and token scopesSTEP_UP_REQUIRED with a payment_request_urlpayment_request_url to the PartnerIf tokenization only:
customer_tokenIf tokenization combined with authorization:
customer_token and klarna_network_session_tokenklarna_network_session_token to finalize the initial Payment AuthorizationAPPROVED or DECLINED)In a hosted checkout and embedded elements integration, Acquiring Partners manage the complete tokenization flow including presenting payment methods via the Klarna web SDK and handling the Klarna Purchase Journey. The Klarna web SDK automatically launches the Klarna Purchase Journey when step-up is required.
When to use: The Acquiring Partner controls the checkout experience and wants to manage the complete tokenization flow, including automatic handling of step-up scenarios via the Klarna web SDK. This simplifies Partner integration with fewer touchpoints and provides a consistent customer experience, but requires the Acquiring Partner to host and manage the payment form, handle webhook processing, and manage tokenization state.
SUBSCRIBE, SIGNUP, ADD_TO_WALLET, or PAY)initiate callback with the klarnaNetworkSessionToken and paymentOptionIdrequest_customer_token and token scopesSTEP_UP_REQUIRED with a payment_request_idIf tokenization only:
customer_tokenIf tokenization combined with authorization:
customer_token and klarna_network_session_tokenklarna_network_session_token to finalize the initial Payment AuthorizationAPPROVED or DECLINED)Partner's frontend:
payment_request_urlPartner's backend:
Acquiring Partner backend:
request_customer_token and token scopespayment_request_url to the Partner for customer redirectcustomer_token securely and maps it to an internal identifierAcquiring Partner frontend:
SUBSCRIBE, SIGNUP, ADD_TO_WALLET, or PAY)Acquiring Partner backend:
request_customer_token and token scopespayment_request_id to the frontend for SDK-managed step-upcustomer_token securely and maps it to an internal identifierKlarna web SDK:
initiate callbackThe authorizePayment operation is used for both tokenization scenarios. The request configuration determines the tokenization behavior.
| Scenario | Key parameters | Description |
|---|---|---|
| Tokenization only | request_customer_token with scopes, currency, step_up_config | Saves a payment method without an immediate charge. Do not include request_payment_transaction or amount. |
| Tokenization combined with authorization | request_customer_token with scopes, request_payment_transaction with amount, currency, step_up_config | Creates a token alongside an initial Payment Authorization. Include both token and transaction request parameters. |
Klarna webhooks deliver customer tokens and authorization outcomes:
| Webhook Event | Trigger | Payload | Required Action |
|---|---|---|---|
| Payment Request completed (tokenization only) | Customer completes consent | customer_token | Store the token securely, return the internal token identifier to the Partner |
| Payment Request completed (combined) | Customer completes consent | customer_token + klarna_network_session_token | Store the token, call authorizePayment |
| Authorization approved | Klarna creates the payment transaction | Payment transaction details | Update payment status, return result to the Partner |
| Authorization declined | Klarna declines the authorization | Decline reason | Return failure result to the Partner (token remains valid) |
After receiving the customer_token from Klarna:
| Step | Description |
|---|---|
| Store securely | Persist the customer_token in a secure, encrypted storage system |
| Map to internal identifier | Create an internal token identifier that maps to the Klarna customer_token. Return this internal identifier to the Partner — never expose the raw Klarna token. |
| Associate with customer | Link the token to the customer record for future use |
| Track token scope | Record the token scope (payment:customer_present or payment:customer_not_present) to ensure correct usage in future authorizations |