Klarna Docs - Self-service checkout - Authorize the in-store payment

Authorize in-store payments with Klarna seamlessly by integrating the Payment Authorize API. This guide outlines how to receive and forward required data, call the API, and handle all possible response flows.

Once the customer wants to pay with Klarna in-store:

  1. The Partner sends a request to the Acquiring Partner to create a Klarna payment session.
  2. The Acquiring Partner forwards the required payment context data to Klarna’s Payment Authorization API.
  3. Klarna returns one of the following responses:
    1. APPROVED – transaction is completed.
    2. STEP_UP_REQUIRED – customer needs to go through Klarna's Purchase Journey
    3. DECLINED – payment was denied.

Before calling Klarna’s Payment Authorization API, the Acquiring Partner must ensure their backend accept and forward Klarna specific parameters. These include store specific datapoints to determine the most granular data about purchase location as well as supplementary purchase data which improves Klarna’s ability to assess risk, optimize approval rates, and deliver a more personalized checkout experience.

To confirm that purchase is made via a physical store Klarna needs to receive the most granular information about purchase location.

ParameterPurpose

point_of_checkout

Information about where the purchase was made. One of
  • store_id (onboarded)
  • store_reference (onboarded)
  • store (non-onboarded)

A store can be classified as one of three types: physical store, website, or mobile app. To ensure that a purchase is recognized as an in-store transaction, please provide the store_id or store_reference corresponding to a store with the type set to PHYSICAL_STORE. Alternatively, if such a store is not yet onboarded, please create a new store entry with the type designated as PHYSICAL_STORE.
Example:

point_of_transaction

Information about the most granular location data about the purchase. Can be of three possible types: website, mobile app and terminal. To ensure that a purchase is recognized as an in-store transaction, please provide the type TERMINAL with terminal_reference
Example:

To ensure compliance and accurate transaction processing, it is required to specify the correct store when handling in-store purchases.

You can onboard a new store by including the store object in your Payment Authorize API request if the store has not yet been onboarded to Klarna.

Please note: setting the correct store type and referencing the proper store_id or store_reference will impact pricing and is mandatory for all in-store transactions.

Store onboarding

Store onboarding is a feature available for stores that have not yet been onboarded to Klarna via Management API. If you wish to transact with a store that is not currently onboarded, you can include the store object as part of the Payment Authorize API request. As a result, the store will be onboarded to Klarna in the background. Once onboarding is complete, you may reference the store using either the store_reference or store_id for future transactions.

Implementation requirements

  • Accept the store parameters in the Partner-facing payment request API.
  • Forward the store parameters unmodified to Klarna’s Payment Authorization API.
Sample request

Below an example of how Acquiring Partners can accept the store parameters in their Create Payment request API endpoint.

JSON
{
  "currency": "USD",
  "amount": 17800,
  "payment_method_options": {
    "klarna": {
      "interoperability_token": "eyJhbGciOiJ...",
      "interoperability_data": "{\"content_type\":\"application/vnd.klarna.interoperability-data.v2+json\",\"content\":{\"payment_request\":{...}}}"
    }
  },
  "customer_interaction_config": {

Store parameter validation guidelines

As those parameters can change over time and are versioned so that the third party integration continues to work, Acquiring Partners need to respect these guidelines if they wish to validate parameters:

Point of checkout with existing store_id / store_reference of physical store
ParameterTypeMax lengthValidation

store_id

stringTBDThe existence of the resource is validated, but there is no validation for the format.

store_reference

string[ 0 .. 80 ] charactersString must be present and up to 80 characters.
Physical store
ParameterTypeMax lengthValidation

type

stringTBDThe existence of the resource is validated, but there is no validation for the format.

store_reference

string80 charactersString must be present and up to 80 characters.

address

object

address.street_address

string99 charactersRequired. String must be present and up to 99 characters.

address. street_address2

string99 charactersOptional. If string is present, it must be present and up to 99 characters.

address.postal_code

string10 charactersOptional. If string is present, it must be present and up to 10 characters.

address.city

string99 charactersRequired. String must be present and up to 99 characters.

address.region

string99 charactersOptional. If string is present, it must be present and up to 99 characters.

address.country

stringCountry code must be in ISO 3166-1 alpha-2 format.

When Partners optimize their integration with Klarna, they are likely to have interoperability parameters to share with the Acquiring Partner.

ParameterPurpose

interoperability_token

Encodes Klarna-specific session context (e.g., preselected payment option, pre-qualification results).

interoperability_data

Submit supplementary purchase data directly to Klarna

These ensure consistent customer and transaction context throughout the payment flow and must be forwarded unaltered to Klarna.

Implementation requirements

  • Accept the interoperability parameters in the Partner-facing payment request API.
  • Forward the interoperability parameters unmodified to Klarna’s Payment Authorization API.
Sample request

Below an example of how Acquiring Partners can accept the interoperability parameters in their Create Payment request API endpoint.

JSON
{
  "currency": "USD",
  "amount": 17800,
  "payment_method_options": {
    "klarna": {
      "interoperability_token": "eyJhbGciOiJ...",    
      "interoperability_data": "{\"content_type\":\"application/vnd.klarna.interoperability-data.v2+json\",\"content\":{\"payment_request\":{...}}}"
    }
  }
}

The Partner-facing field should be named either klarna_interoperability_token/klarna_interoperability_data or interoperability_token/interoperability_data in a Klarna-specific context, ensuring that it’s easy for any Partner to identify and use.

Parameter validation guidelines

As those parameters can change over time and are versioned so that the third party integration continues to work, Acquiring Partners need to respect these guidelines if they wish to validate parameters:

ParameterTypeMax lengthValidation

interoperability_token

string (JWT)8192 charsOptional: verify format only

interoperability_data

string (stringified JSON object)10240 charsOptional: check for valid JSON

The Acquiring Partner can validate the input based on the provided guidelines but must not modify it. The input must always be forwarded as received, without any interference.

Supplementary purchase data improves Klarna’s ability to assess risk, optimize approval rates, and deliver a more personalized checkout experience. It includes structured information such as line items, L2/L3 data for Card Network optimization and other transaction context.

Acquiring Partners may receive this data from the Partner in two ways:

  1. Embedded in interoperability_data
    1. No parsing needed. Just forward it as-is.
  2. As individual fields in the Acquiring Partner’s API
    1. The Acquiring Partner is responsible for mapping existing fields in their payment API with the fields defined in the supplementary_purchase_data object when calling the Payment Authorize API.

Acquiring Partner must not add specific fields of the supplementary purchase data to their APIs for supporting Klarna, but rather make sure interoperability_data and its requirements are properly implemented
In both cases, the Acquiring Partner must ensure that data provided by the Partner is forwarded to Klarna. Do not require Partners to resubmit the same information through multiple mechanisms.

Read more about Supplementary Purchase Data here.

In the request to the Payment Authorize API, Acquiring Partners must specify the following parameters:

Path

Parameter nameDescription

partner_account_id

The unique identifier of the Partner account. This is used to scope the request.

Header

Parameter nameDescription

Authorization

Acquiring Partners use their Klarna API key to authenticate:
Basic <API key>

Body

Parameter nameDescription

currency

Currency in ISO 4217 format.

request_payment_transaction

Represents a request to authorize a payment transaction, this object contains the following parameters:

step_up_config

  • This object is required to support a step-up scenario, where the customer must approve the payment. Acquiring Partners must configure customer_interaction_config to determine how the purchase journey is launched. Applicable customer interaction config method for this integration pattern is QR_CODE.<br />
  • This object also allows Acquiring Partners to provide a payment_request_reference for the purpose of correlating the payment session or equivalent resource with the Klarna Payment Request. This will also be exposed in payment request webhooks.

This will be covered in detail in section Handle step-up scenario.

supplementary_purchase_data

Additional information that provides more detailed information about the transaction, which helps reduce the risk of fraud and enhances transparency.
Shopping basket, customer billing / shipping details or specific transaction data can be provided through this object.

interoperability_data

This field should be used for any additional interoperability data sent by the Partner.

acquiring_config

This object is mandatory if the Acquiring Partners have multiple payment accounts configured as detailed here. Use this field to specify which payment account will be used for the transaction. You have flexible options, choosing from either of the two described below:
  • payment_account_id: Provide this data point when relying on Klarna's payment account identifier.
  • payment_acquiring_account_id + payment_account_reference: Provide these data points when you need to specify an account identifier assigned by Klarna to the acquiring account, along with a reference for the payment account that allows the partner to identify it independently of Klarna-generated IDs.

point_of_checkout

Information about where the purchase was made. One of
  • store_id (onboarded)
  • store_reference (onboarded)
  • store (non-onboarded)

A store can be classified as one of three types: physical store, website, or mobile app. To ensure that a purchase is recognized as an in-store transaction, please provide the store_id or store_reference corresponding to a store with the type set to PHYSICAL_STORE. Alternatively, if such a store does not yet onboarded, please create a new store entry with the type designated as PHYSICAL_STORE.
Example:

point_of_transaction

Information about the most granular location data about the purchase. Can be of three possible types: website, mobile app and terminal. To ensure that a purchase is recognized as an in-store transaction, please provide the type TERMINAL with terminal_reference
Example:

Below an example request body for the Payment Authorize API. (interoperability token sent as an HTTP header parameter)

SHELL
curl https://api-global.test.klarna.com/v2/accounts/{partner_account_id}/payment/authorize \
  -H 'Authorization: Basic <API key>' \
  -H 'Content-Type: application/json' \
  -d '{
        "currency": "USD",
        "supplementary_purchase_data": { .. },
        "interoperability_data":  "<serialized-json>",
        "request_payment_transaction": {
          "amount": 11800,
          "payment_transaction_reference": "acquiring-partner-transaction-reference-1234"

The Payment Authorize API can yield 3 different outcomes depending on the transaction and the consumer:

ResultDescription

STEP_UP_REQUIRED

Additional customer interaction is required to authorize the payment. Those interactions need to happen in Klarna’s Purchase Journey and the customer has to be redirected to it. Read more about how to handle the Step-up Scenario.

APPROVED

The Payment Authorization is approved. A Payment Transaction is created and contained in the response.

DECLINED

The payment cannot proceed due to reasons such as fraud, final decline or risk concerns.

When the request is successful, a Payment Transaction is created on Klarna Network and will be available for post-purchase operations through the Payment Transactions API. No further customer interactions are needed and the Acquiring Partner can directly inform their partners that the payment request is completed and that the receipt can be printed.

Acquiring Partners must store the Klarna payment_transaction_id for future operations on the transaction through the Payment Transactions API, such as capture and refund. The Acquiring Partner will receive the following parameters in the response.

Response body

The response will contain a payment_transaction_response object with the following parameters:

Parameter nameDescription

result

The result parameter which specifies the outcome of the authorization.
In case of a successful Authorization the result will be set to APPROVED

payment_transaction

The payment_transaction object represents a single payment transaction
This object is only returned if the payment_transaction_response.result is set to APPROVED
The payment_transaction_id  returned is necessary to manage the Payment Transaction through the Payment Transaction API.

Sample response - APPROVED

JSON
{
  "payment_transaction_response": {
    "result": "APPROVED",
    "payment_transaction": {
      "payment_transaction_id": "krn:payment:eu1:transaction:6debe89e-98c0-[...]",
      "payment_transaction_reference": "acquiring-partner-transaction-reference-1234",
      "amount": 11800,
      "currency": "USD",
      "payment_funding": {...},
      "payment_pricing": {...}

If a transaction could not be approved by Klarna and step-up scenario cannot be triggered (due to missing configuration or for permanent decline), the Acquiring Partner will receive a decline. Declines should not be replayed without change of context.
The Acquiring Partner should inform the Partner that the payment could not be completed and the Partner should invite the customer to select another payment method.

Response body

The response will contain a payment_transaction_response object with the following parameters:

Parameter nameDescription

result

The result parameter which specifies the outcome of the authorization.
In case of a decline, the result will be set to DECLINED

Sample response - DECLINED

JSON
{
  "payment_transaction_response": {
    "result": "DECLINED"
  }
}

When a Payment Transaction could not be immediately created by Klarna and a step-up configuration was provided in the call to the Payment Authorization API, the Step-up scenario will be triggered and the Acquiring Partner will receive a STEP_UP_REQUIRED result.

In case your systems cannot support a pattern where there is no consumer interaction at the initialization of the session, it is possible to force the Step-up flow. This can be achieved by adding the mode = REQUIRED to the step_up_config object.

The mode = REQUIRED will be available in a future release.

In such scenario, the Payment Authorization API returns a Payment Request in the response. The expectation is that the customer will go through Klarna’s Purchase Journey to complete the payment, usually triggering authentication and payment option selection. The required work to properly make the step-up scenario work is outlined in the next section.

The following parameters are present in the response to the request.

Response body

Parameter nameDescription

payment_transaction_response

The payment_transaction_response object will contain the result parameter which specifies the outcome of the the authorization.
In case of the Step up flow the result will be set to STEP_UP_REQUIRED

payment_request

The base properties of a Payment Request.
This field is only returned if the payment_transaction_response.result is set to STEP_UP_REQUIRED.
The state_context.customer_interaction object contains:
  • The payment_request_id necessary for the Partner to launch the Klarna Purchase Journey using the Klarna SDK.
  • The QR code necessary for the Partner to display customer a QR and be redicrected to the Klarna Purchase Journey

Sample response - STEP_UP_REQUIRED

JSON
{
  "payment_transaction_response": {
    "result": "STEP_UP_REQUIRED"
  },
  "payment_request": {
    "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
    "payment_request_reference": "acquiring-partner-request-reference-1234",
    "amount": 11800,
    "currency": "USD",
    "state": "SUBMITTED",
  • Accept and forward granular data about purchase location
  • Accept and forward interoperability_token and interoperability_data from the Partner, unmodified.
  • Map relevant fields from your API to Klarna’s Payment Authorize API, including:
    • supplementary_purchase_data
    • step_up_config
    • request_payment_transaction
  • Call Klarna’s Payment Authorization API with all parameters provided by Partners.
  • Handle API responses:
    • APPROVED: proceed to confirmation and store payment_transaction_id
    • STEP_UP_REQUIRED: either return the klarna payment_request_id or payment_request_url to the Partner
    • DECLINED: inform the Partner that the payment could not be completed, the Partner should invite the customer to select another payment method.