One-click payments with Klarna Presentation API (Partner orchestrated)
Charge a returning customer's saved Klarna option in a one-click, customer-initiated transaction using the Klarna Presentation API (no SDK), where you orchestrate the charge. Create the Klarna payment request with the Klarna Customer Token, then finalize through Solidgate with the klarna_network_session_token.
This guide explains how to charge a returning customer's saved Klarna option in a one-click, customer-initiated transaction using the Klarna Presentation API (no Web SDK), where you orchestrate the charge. The customer is at checkout and has a stored Klarna Customer Token, so Klarna can be pre-selected as a one-click "Saved" option.
Because the Presentation API is server-side, you submit the Klarna Customer Token directly to restore the saved option — there is no token exchange. You then create Klarna's payment request yourself with the Klarna Customer Token and the selected payment_option_id. Klarna returns a klarna_network_session_token via the completion webhook, which you forward to Solidgate to finalize the charge.
Before you integrate, check that you meet the following prerequisites:
1.
Ensure that you have Klarna enabled with Solidgate.
2.
A stored Klarna Customer Token for the customer, issued with the payment:customer_present scope (see Create a Klarna Customer Token).
3.
Confirm you have access to the Klarna Partner Portal with an API key able to call the Klarna Payment Presentation API and the Klarna Payment Request API.
4.
Confirm that you have registered webhooks for payment.request.state-change.completed events following the Webhooks guidelines.
Call the Klarna Payment Presentation API server-side with the stored Klarna Customer Token in the Klarna-Customer-Token header — Klarna returns the customer's saved option and its payment_option_id.
2.
Render Saved (pre-selected) and Pick plan in your payment selector.
3.
The customer selects the saved option; you call Klarna's Create Payment Request with the Klarna Customer Token, the payment_option_id, and a customer_interaction_config.
4.
If Klarna requires a step-up (based on risk), redirect the customer to the returned payment_request_url to complete the Klarna Purchase Journey. Otherwise the request completes immediately.
5.
Klarna fires the payment.request.state-change.completed webhook with a (new) Klarna Network Session Token.
6.
You forward the (new) Klarna Network Session Token to Solidgate to finalize the charge.
7.
Solidgate approves the order; you redirect the customer to your confirmation page.
sequenceDiagram
autonumber
participant C as Customer
participant P as Partner
participant K as Klarna
participant AP as Solidgate
C->>P: Visits checkout page
P->>K: Call Presentation API<br/>GET payment/presentation
Note over P,K: Header: Klarna-Customer-Token
K-->>P: Return payment methods and instruction
Note over K,P: payment_option_id
P->>P: Display Klarna payment methods
C->>P: Click Klarna payment button
P->>K: Create payment request<br/>POST /v2/payment/requests
Note over P,K: Header: Klarna-Customer-Token<br/>payment_option_id
alt STEP_UP_REQUIRED
K-->>P: Return payment_request_url
P->>C: Redirect to payment_request_url
C->>K: Complete Klarna purchase journey
end
K-->>P: Payment request completed event (webhook)
Note over K,P: (new) klarna_network_session_token
P->>AP: Confirm payment
Note over P,AP: (new) klarna_network_session_token
AP-->>P: Order completed notification
P-->>C: Display confirmation message
Call the Klarna Payment Presentation API (GET payment/presentation) from your server with the stored Klarna Customer Token in the Klarna-Customer-Token header. No exchange to a Klarna Network Session Token is needed for this server-side flow.
With a Klarna Customer Token context present, the response includes a saved_payment_option (in addition to the default payment_option) and the PRESELECT_KLARNA instruction. Render the Saved option before the default option and pre-select it; the default option becomes the Pick plan entry. Forward the saved option's payment_option_id to the payment request.
The recommended presentation when a Klarna Customer Token is available:
Saved Klarna option (pre-selected)
Pick Plan selected
The Klarna Customer Token is required to present the saved option. Render the assets and localized texts returned by the Payment Presentation API verbatim — prioritize saved_payment_option over payment_option whenever both are present.
Chain a session token from Boost features. If you already hold a Klarna Network Session Token obtained when the customer interacted with a Boost feature (for example On-site messaging or Sign in with Klarna) earlier in the checkout, chain it: call the Payment Presentation API with both that session token in the Klarna-Network-Session-Token header and the Klarna Customer Token in the Klarna-Customer-Token header. This links the new personalized session to the existing one, preserving session continuity across the checkout.
When the customer selects the saved option, create the Klarna payment request from your server, passing the Klarna Customer Token, the selected payment_option_id, and a customer_interaction_config. For a payment:customer_present token the charge may complete immediately or require a short step-up, depending on Klarna's risk assessment — include the customer_interaction_config so Klarna can drive the Klarna Purchase Journey when a step-up is needed.
Field
Presence
Description
klarna_customer_token
required
The stored Klarna Customer Token. This is the only charge credential for a Partner-orchestrated charge.
payment_option_id
required
The saved option's payment_option_id from the presentation — drives the one-click "Saved" experience.
currency
required
Currency in ISO 4217 format.
amount
required
Total charge amount in non-negative minor units (e.g. $118.00 = 11800).
customer_interaction_config.return_url
required
URL Klarna returns the customer to after a step-up Klarna Purchase Journey. Include it so a step-up can be completed if Klarna requires one.
Klarna's Create Payment Request response tells you whether a step-up is needed:
No step-up — the payment request completes immediately. Continue to retrieve the (new) klarna_network_session_token.
Step-up required — Klarna returns state_context.customer_interaction.payment_request_url and the payment request moves to IN_PROGRESS. Because this is a server-side flow (no Web SDK), redirect the customer to the payment_request_url to complete the Klarna Purchase Journey. Once the customer finishes, they return to your return_url and the payment request transitions to COMPLETED.
Either way, the flow converges on the payment.request.state-change.completed webhook below.
Klarna issues a (new) klarna_network_session_token once the payment request reaches COMPLETED. Retrieve it by subscribing to the payment.request.state-change.completed webhook (required); you may additionally call the Read Payment Request API for resilience.
The klarna_network_session_token is valid for only 1 hour and must be forwarded to Solidgate within this time frame to finalize the authorization.
Forward the (new) klarna_network_session_token to Solidgate to finalize the charge. Solidgate authorizes with Klarna and returns the outcome. The request/response contract is owned by Solidgate; only the Klarna-specific token you must include is shown here.
Display the confirmation page and record the successful charge.
DECLINED
Klarna did not authorize the charge.
Surface a retry/alternative payment to the customer.
Once any required step-up is complete and you forward the (new) klarna_network_session_token, Solidgate returns APPROVED or DECLINED. A saved-option charge often completes without a step-up, but Klarna may still require one based on risk — always handle the step-up branch above. If you instead present Klarna as a one-time payment (no Klarna Customer Token), follow Build checkout form with Klarna Presentation API.