Build payment form with API

Integrate Payment Presentation API to display branded payment options when SDK use isn’t feasible, ensuring a consistent and compliant checkout experience.

If Acquiring Partners cannot use the Klarna SDK to retrieve the presentation instruction due to infrastructure constraints on their end, they must utilize Klarna Payment Presentation API to retrieve the assets and instructions necessary to build the payment selector.

The Klarna Payment Presentation API enables Acquiring Partners to retrieve Klarna-branded presentation assets (e.g. button text, icons, descriptors) tailored to a specific payment context. These assets help Partners render Klarna in compliance with Klarna’s brand and UX guidelines.

Before calling Klarna’s Payment Presentation API, ensure your backend accepts and forwards the Klarna specific parameters. These include the interoperability token which preserve session context as well as basic transaction parameters (amount, currency, locale) which will allow Klarna to deliver tailored assets to build the payment form.>

Klarna Presentation API's require an interoperability token in order to provide personalized features when displaying Klarna in the payment form.

If an interoperability token was provided by the Partner requesting a checkout form, it must be forwarded to Klarna in headers.

In the request to the Payment Presentation API, the Acquiring Partner will specify the following parameters:

Path

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

Header

ParameterDescription
Klarna-Interoperability-TokenMust contain the interoperability token if provided by the Partner.

Body

ParameterDescription
localeThe locale to use for localization of Klarna assets (IETF BCP 47 format e.g., en-US, fr-FR).
amountThe total payment amount in minor units (e.g., 11836 = $118.36).
currencyISO 4217 3-letter currency code (e.g., USD, EUR).
intentsList of requested intents. Currently, ["PAY"] is the supported value.

Sample request body

JSON
{
  "locale": "en-US",
  "amount": 11836,
  "currency": "USD",
  "intents": ["PAY"]
}

The response from Klarna will contain the following parameters:

FieldTypeDescription
instructionstringKlarna display instruction (e.g., SHOW_KLARNA, HIDE_KLARNA, etc.).
payment_buttonobjectContains the label to be used on the Klarna payment button.
descriptorobjectContains all Klarna display assets for the payment selector, including:
  • header: Main title (e.g., "Pay with Klarna")
  • subheader.short: Short message (e.g., "Pay in 4.")
  • subheader.enriched: Detailed offer text with optional link
  • icon: Badge images (square, rectangle, alt text)

Sample response

JSON
{
  "instruction": "SHOW_KLARNA",
  "payment_button": {
    "text": "Pay with Klarna"
  },
  "descriptor": {
    "header": {
      "text": "Pay with Klarna"
    },
    "subheader": {

The Acquiring Partner must used the assets returned by the presentation API (text, link, instruction) to display Klarna when loading the checkout form. In this step it is needed to present to the customer Klarna as an available payment method and initially only 3 elements should be presented to the customer:

  1. Icon
  2. Header
  3. Short Subheader

The Acquiring Partner must use the instruction attribute returned in the response to the Payment Presentation API to dynamically build the payment selector. The instruction attribute will contain one of the following values:

  • SHOW_KLARNA
  • PRESELECT_KLARNA
  • SHOW_ONLY_KLARNA
  • HIDE_KLARNA

The presentation instructions indicate Acquiring Partners how Klarna should be presented in the payment selector. Acquiring Partners are required to adhere to Klarna’s payment presentation instruction to achieve the best-in-class user experience.

The presentation instructions are derived from possible customer purchase journeys described in the following article.

The links present in the api response(enriched.link.href), must be opened only a new tab or new window. Please avoid using iframes.

Once the customer has decided to proceed to the Payment using Klarna, or if Klarna was pre-selected due to the presentation instruction seen above, Acquiring Partners have to refresh the layout, build and present the Klarna Enriched Subheader as well as payment button using the assets (text, link) provided by the Payment Presentation API.

  1. Icon
  2. Header
  3. Short Subheader
  4. Enriched Subheader
  5. Payment Button