Integrate Klarna's Payment Authorize API for server-side, customer-initiated scenarios. This guide shows how to collect payment context, call the API, and handle all authorization outcomes including step-up flows.
Learn how to authorize a Payment Transaction with Klarna using a server-side-only integration when the customer is present during checkout. As an Acquiring Partner, you'll collect payment context from a Partner, call the authorizePayment endpoint, handle all authorization outcomes, manage step-up flows, and finalize the Payment Authorization.
Before starting, complete the following steps:
Then ensure you have:
Once the customer selects Klarna at checkout and clicks the Pay button:
APPROVEDDECLINEDSTEP_UP_REQUIREDUpdate the Partner-facing API to collect the following data points from the Partner for customer-initiated payment scenarios:
| Parameter | Required (Acquiring Partner) | Required (Partner) | Description |
|---|---|---|---|
amount | Yes | Yes | Total amount of the authorization, including tax and any available discounts. |
currency | Yes | Yes | Currency in ISO 4217 format. |
supplementary_purchase_data | Yes | Recommended | Additional details about the transaction to help reduce fraud risk and enhance transparency. Include this data to improve underwriting, fraud detection, and customer communication. Klarna processes and uses this data for fraud assessment and customer experience optimization. |
supplementary_purchase_data.purchase_reference | Yes | Recommended | Customer-facing payment reference displayed to customers on the Klarna app and other communications. Also included in settlement reports for reconciliation purposes. If you are an Acquiring Partner, this is the reference your Partner generated for their customer's payment. |
supplementary_purchase_data.line_items | Yes | Recommended | Detailed line item information of the purchase. This data is used for fraud detection and customer communication. |
supplementary_purchase_data.customer | Yes | Recommended | Information about the customer based on their previous interactions with the Partner. These data points may be used by Klarna to simplify sign-up and during fraud assessment, as well as for underwriting purposes to provide an enhanced experience to returning customers. |
supplementary_purchase_data.shipping | Yes | Recommended | Shipping information for the purchase. This data is used for fraud detection and customer communication. If the purchase contains multiple shipments with different recipients, provide one shipping object per shipment. |
klarna_network_session_token | Yes | Conditional | Encodes Klarna Network Session Token context (prequalification, sign-in state, or approval). Required for finalization after customer authorization; optional on initial request. |
klarna_network_data | Yes | Recommended | Additional data to enable custom features or data exchange supported by your Integrating Partner. Klarna accepts this passthrough field in a structured JSON format and forwards it to relevant systems for interoperability. Data shared in this field may complement structured datapoints provided in supplementary_purchase_data. Treat this value as an opaque string; do not validate or infer its structure. |
return_url | Yes | Recommended | Payment flow redirection URL. The customer will always be redirected to this URL on successful authorization. For web SDK with REDIRECT mode, the customer will also be redirected to this URL on failed authorization. Recommended for web flows. |
app_return_url | Yes | Recommended | Mobile application return URL (app scheme with no action deeplink). The customer will be redirected to this URL after third-party redirects or redirects to the Klarna Application. It is expected to open the integrating mobile application in its last state (no state changes or deeplink navigations). Recommended for mobile app flows. |
Requirements
klarna_network_session_token and klarna_network_data in the Partner-facing API to ensure Partners can easily identify and use them.supplementary_purchase_data when calling KlarnaMap your existing Partner-facing fields into supplementary_purchase_data when calling Klarna:
Line items: supplementary_purchase_data.line_items
Customer info: supplementary_purchase_data.customer
Shipping: supplementary_purchase_data.shipping
Purchase reference: supplementary_purchase_data.purchase_reference
Add new Partner-facing fields "just for Klarna" if you already have equivalents:
Don't introduce parallel structures like items and klarna_line_items
Don't force Partners to submit the same data twice
The two structures will diverge over time, causing maintenance issues
Supplementary purchase data scenarios
Acquiring Partners may receive supplementary purchase data (including line items, L2/L3 data for Card Network optimization, and transaction context) in one or both of the following ways:
klarna_network_data: Forward as received without parsing or mappingsupplementary_purchase_data object when calling authorizePaymentThe authorizePayment endpoint is used to authorize a Payment Transaction with Klarna, for both customer-initiated and Partner-initiated scenarios.
step_up_config with HANDOVER to allow Klarna to trigger customer interaction when required.In the request to the authorizePayment endpoint, specify the following parameters:
curl https://api-global.test.klarna.com/v2/accounts/{partner_account_id}/payment/authorize \
-H 'Authorization: Basic <API key>' \
-H 'Content-Type: application/json' \
-H 'Klarna-Customer-Token: krn:partner:us1:test:identity:customer-token:ACZawkw7-2[...]' \
-H 'Klarna-Network-Session-Token: krn:network:us1:test:session-token:eyJhbGciOiJIU[...]' \
-d '{
"currency": "USD",
"supplementary_purchase_data": {
"purchase_reference": "order-7f3a9b2e",
"line_items": [
{
"name": "Wireless Bluetooth Headphones",The customer_token can be obtained from the Payment Tokenization flow.
When performing customer-initiated authorization through the authorizePayment endpoint, Klarna returns a
payment_transaction_response object. The result field inside this object indicates the outcome and determines your next action.
The result has the following possible values:
| Result | Description | Next steps |
|---|---|---|
STEP_UP_REQUIRED | Additional customer interaction is needed to complete the authorization. A payment_request is created. | Handle this result when Klarna requires additional customer interaction to complete authorization:
|
APPROVED | The authorization succeeded and a payment_transaction was created. | The Payment Authorization is complete. Handle this result when Klarna authorizes the payment without requiring customer interaction.
|
DECLINED | The authorization was not approved and no transaction was created. | Handle this result when Klarna does not approve the authorization.
|
Here's the high-level diagram of the Payment Authorization results and resources it produces:
The response schema is as follows:
{
"payment_transaction_response": {
"result": "STEP_UP_REQUIRED"
},
"payment_request": {
"payment_request_id": "krn:payment:us1:request:552603c0-fe8b-4ab1-[...]",
"payment_request_reference": "acquiring-partner-request-reference-1234",
"amount": 11800,
"currency": "USD",
"state": "SUBMITTED",
"expires_at": "2025-01-02T13:00:00Z",
"created_at": "2025-01-01T12:00:00Z",Acquiring Partners must include return URLs in the step_up_config when calling authorizePayment to enable the step-up scenario.
These URLs, set inside the customer_interaction_config object, tell Klarna where to redirect the customer after they complete or stop the purchase journey.
If the Klarna Purchase Journey is launched in a web environment, Klarna redirects the customer to the return_url after they finish — whether they complete or stop the flow. This can be a URL managed by the Acquiring Partner (which handles redirection logic) or one collected directly from the Partner.
On mobile, the customer may be redirected to a third-party app (such as a bank app) or the Klarna app during the purchase journey. The app_return_url brings the customer back to the Partner's mobile app when this happens.
Partners must register a URL scheme (e.g., yourapp://klarna) or a universal link that resumes the payment flow. Klarna invokes this URL after the customer completes a native app-based step, such as biometric authentication or Klarna app login. Partners are expected to resume the mobile app in its last state without applying state changes or deep link navigations.
The return_url and app_return_url are not mutually exclusive. Depending on the device and environment, either or both may be triggered:
| Scenario | Description |
|---|---|
| Pure web flow | The customer starts the purchase journey in a desktop browser. After completing the flow, Klarna redirects them to return_url. |
| App-to-app flow | The Partner's native app opens the purchase journey using a universal link. If the Klarna app is installed, the customer goes directly into it. After completion, Klarna redirects them to app_return_url. |
| WebView flow with app handover | The Partner's native app starts the purchase journey in a System WebView. If the customer must authenticate via an external banking app, app_return_url returns them to the Partner's app mid-flow. They then resume in the WebView and, on completion, are redirected to return_url. |
If the Acquiring Partner already collects a suitable return_url or app_return_url from the Partner, do not request a second one — this would increase the minimum integration requirements for Klarna to work.
Map the Klarna authorization result to the Partner-facing API response according to the authorization outcome. The response may include a payment_request_url and/or a klarna_network_response_data parameter.
Requirements
payment_request_url MUST be returned directly to the Partner in an existing field and MUST NOT be wrapped or hidden behind Acquiring Partner-managed redirects.klarna_network_response_data in the Partner-facing API to ensure Partners can easily identify and use the parameter. Treat this value as an opaque string; do not validate or infer its structure.Below are examples of how Acquiring Partners can return the klarna_network_response_data parameter in their Partner-facing APIs depending on the authorization outcome.
{
"payment_id": "pr_27234RBQD9NAKD032BN",
"amount": 17800,
"currency": "USD",
"status": "open",
"url": "https://pay.test.klarna.com/na/requests/6bbf6775-[...]/start",
...
"additional_data": {
"klarna_network_response_data": "{\"content_type\":\"vnd.klarna.network-data.v1+json\",\"content\":{\"operation\":\"payment_request\",\"response\":{\"result\":\"STEP_UP_REQUIRED\",\"payment_request\":{\"payment_request_id\":\"krn:payment:us1:request:552603c0-fe8b-4ab1-[...]\",\"payment_request_url\":\"https://pay.test.klarna.com/na/requests/6bbf6775-[...]/start\"}}}}"
}
}What happens next:
If the result is APPROVED, the Partner can redirect the customer to the confirmation page.
If the result is STEP_UP_REQUIRED, the Partner handles the step-up scenario and launch the Klarna Purchase Journey (see Step 4).
Acquiring Partners should expose Klarna's payment_request_url directly to Partners rather than routing through an Acquiring Partner-owned URL.
Using an intermediate redirect under the Acquiring Partner's domain causes the following issues:
| Issue | Impact |
|---|---|
| Reduced app handover success | Cross-domain redirects reduce the likelihood of a successful handover to the Klarna app, negatively impacting Klarna's purchase conversion rate. |
| Incompatibility with Klarna web SDK integration | Not compatible with Partners using the Klarna web SDK for pop-up flows on websites or app-to-app handoff in native mobile apps. |
| Network issues | Frontend redirects expose customers to network issues. |
When step-up is triggered, authorizePayment returns a
STEP_UP_REQUIRED result along with a Payment Request containing the payment_request_url and klarna_network_response_data which the Partner needs in order to launch the Klarna Purchase Journey, either through a redirect or a pop-up experience.
The purchase journey allows the customer to authenticate with Klarna (via login, one-time passwords, etc.), choose a payment method, and accept the payment.

Phone collection in the Klarna purchase journey
Upon completion:
return_url in customer_interaction_config, except when a pop-up experience is used and the customer stops the flow.klarna_network_session_token to the Acquiring Partner to finalize the payment.This step only applies when the authorizePayment endpoint returns
STEP_UP_REQUIRED.
To retrieve the required token(s), Klarna provides multiple integration methods. Subscribing to Klarna webhook events is required and may be combined with additional methods to improve resilience.
Using webhooks ensures reliable completion handling, particularly when the customer closes the browser before returning, network interruptions occur during redirects, or post-processing is required before notifying the customer.
The klarna_network_session_token represents the Klarna session context and must be included in the Klarna-Network-Session-Token header when calling the Payment Authorize API.
Partners can obtain this token through:
The klarna_network_session_token is valid for only 1 hour, so be sure to use it promptly.
Subscribe to the payment.request.state-change.completed webhook event using the Klarna webhook guidelines. Klarna sends this event when the Payment Request reaches the COMPLETED state.
This event indicates that the customer has finished the step-up interaction and that the Acquiring Partner can proceed with finalizing the authorization.
Sample payload
{
"metadata": {
"event_type": "payment.request.state-change.completed",
"event_id": "d9f9b1a0-5b1a-4b0e-9b0a-9e9b1a0d5b1a",
"event_version": "v2",
"occurred_at": "2024-01-01T12:00:00Z",
"correlation_id": "2d1557e8-17c3-466c-924a-bbc3e91c2a02",
"subject_account_id": "krn:partner:global:account:test:HGBY07TR",
"recipient_account_id": "krn:partner:global:account:test:LWT2XJSE",
"product_instance_id": "krn:partner:product:payment:ad71bc48-8a07-4919-[...]",
"webhook_id": "krn:partner:global:notification:webhook:120e5b7e-abcd-4def-[...]",
"live": falseAs an alternative method, retrieve the Klarna token(s) by calling the readPaymentRequest .
Once the Payment Request reaches the COMPLETED state, the token(s) are available in the state_context object of the Payment Request.
Sample payload
{
"payment_request_id": "krn:payment:us1:request:552603c0-fe8b-4ab1-[...]",
"state": "COMPLETED",
"previous_state": "IN_PROGRESS",
"state_context": {
"klarna_network_session_token": "krn:network:us1:test:session-token:eyJhbGciOiJIU..."
},
"expires_at": "2025-02-26T17:25:34.534721775Z",
"created_at": "2025-02-24T17:25:34.534721775Z",
"updated_at": "2025-02-24T17:25:34.534721775Z",
"payment_request_reference": "acquiring-partner-request-reference-1234",
"amount": 11800,After receiving the klarna_network_session_token from webhook or polling, finalize the authorization by calling the Payment Authorize API again with the new token.
Call authorizePayment using:
klarna_network_session_token in the Klarna-Network-Session-Token request headeramount, currency, supplementary_purchase_data, klarna_network_data) used in the initial authorizationpayment_transaction_reference to link the requests
Example finalization request:curl https://api-global.test.klarna.com/v2/accounts/{partner_account_id}/payment/authorize \
-H 'Authorization: Basic <API key>' \
-H 'Content-Type: application/json' \
-H 'Klarna-Network-Session-Token: krn:network:us1:test:session-token:eyJhbGciOiJIU...' \
-d '{
"currency": "USD",
"supplementary_purchase_data": { ... },
"klarna_network_data": "{\"content_type\":\"vnd.klarna.network-data.v1+json\",\"content\":{\"operation\":\"payment_request\",\"request\":{\"supplementary_purchase_data\":{...}}}",
"request_payment_transaction": {
"amount": 11800,
"payment_option_id": "S0xBUk5BXzE3NzI3MjQ5MTQzMjk=",
"payment_transaction_reference": "backend-transaction-ref-12345"If the klarna_network_session_token has expired (1-hour validity) or the payment context doesn't match the initial authorization, the finalization call returns DECLINED.
When finalization succeeds, Klarna returns APPROVED with the payment transaction:
{
"payment_transaction_response": {
"result": "APPROVED",
"payment_transaction": {
"payment_transaction_id": "krn:payment:us1:transaction:791bbb7b-813a-[...]",
"amount": 11800,
"currency": "USD",
"payment_pricing": {...},
"payment_funding": {
"type": "GUARANTEED",
"state": "FUNDED"
}Map the Klarna authorization result to the Partner-facing API response and return the klarna_network_response_data.
Requirements
klarna_network_response_data in the Partner-facing API to ensure Partners can easily identify and use the parameter{
"payment_id": "pr_27234RBQD9NAKD032BN",
"amount": 17800,
"currency": "USD",
"status": "completed"
...
"additional_data": {
"klarna_network_response_data": "{\"content_type\":\"vnd.klarna.network-data.v1+json\",\"content\":{\"operation\":\"payment_request\",\"response\":{\"result\":\"APPROVED\",\"payment_transaction\":{\"payment_transaction_id\":\"krn:payment:us1:transaction:791bbb7b-813a-[...]\"}}}}"
}
}After implementing Payment Authorization, explore these related topics: