Klarna Partner Product API - Messaging (v2/r5)

Download OpenAPI specification:Download

Credit Promotion

Get credit promotion messaging for auto-size placement

Securityklarna_api_key or klarna_partner_account
Request
path Parameters
account_id
required
string (AccountIdentifier)

Unique account identifier assigned by Klarna to the onboarded merchant

Example: krn:partner:global:account:live:LWT2XJSE
query Parameters
locale
required
string (Locale)

Preferred locale, in IETF BCP 47 format.

Supported locales

  • en-AU
  • de-AT
  • en-AT
  • nl-BE
  • fr-BE
  • en-BE
  • en-CA
  • fr-CA
  • cs-CZ
  • en-CZ
  • da-DK
  • en-DK
  • fi-FI
  • sv-FI
  • en-FI
  • fr-FR
  • en-FR
  • de-DE
  • en-DE
  • el-GR
  • en-GR
  • hu-HU
  • en-HU
  • en-IE
  • it-IT
  • en-IT
  • en-MX
  • es-MX
  • nl-NL
  • en-NL
  • en-NZ
  • nb-NO
  • en-NO
  • pl-PL
  • en-PL
  • pt-PT
  • en-PT
  • ro-RO
  • en-RO
  • es-ES
  • en-ES
  • sv-SE
  • en-SE
  • de-CH
  • fr-CH
  • it-CH
  • en-CH
  • en-GB
  • en-US
  • es-US
Example: locale=en-US
payment_amount
required
integer <int64> (PaymentAmount) [ 1 .. 2147483647 ]

Total amount of a one-off purchase, including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500. This is the amount that Klarna will charge the customer for a one-off purchase. Should not include any amounts for subscriptions.

Invariant: payment_amount = sum(line_items[].total_line_amount)

Example: payment_amount=2000
custom_payment_method_ids
string

You can dynamically trigger promotional credit offers. First, work with Klarna’s responsible account manager to determine the criteria for custom offers and a standard naming convention that will be referred to when requesting such offers via Klarna payments API. To be able to advertise these payment methods, pass the names as an array of strings to the On-site messaging placement. The array can be used to define which of the configured payment options within a payment category (pay_later, pay_over_time, and so on) should be included in the content selection.

Example: custom_payment_method_ids=FINANCING0
message_preference
string
Default: "klarna"

Allows the partner to indicate preference for the message type. If no value is passed or an unrecognized value is provided, the default "klarna" message will be used. Passing "in-store" adjusts the content to display "in-store" related message, while passing "prequalification" adjusts the message to display the prequalification related content.

Enum: "klarna" "in-store" "prequalification"
Example: message_preference=in-store
message_prefix
string

Prefixes the content of the message. Allowed values: Or, or

Enum: "Or" "or"
Example: message_prefix=Or
Responses
200

Successful response

204

No messaging available for the given parameters.

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

get/v2/accounts/{account_id}/payment/messaging/credit-promotion-auto-size
Request samples
Response samples
application/json
{
  • "content": {
    }
}

Get credit promotion messaging for badge placement

Securityklarna_api_key or klarna_partner_account
Request
path Parameters
account_id
required
string (AccountIdentifier)

Unique account identifier assigned by Klarna to the onboarded merchant

Example: krn:partner:global:account:live:LWT2XJSE
query Parameters
locale
required
string (Locale)

Preferred locale, in IETF BCP 47 format.

Supported locales

  • en-AU
  • de-AT
  • en-AT
  • nl-BE
  • fr-BE
  • en-BE
  • en-CA
  • fr-CA
  • cs-CZ
  • en-CZ
  • da-DK
  • en-DK
  • fi-FI
  • sv-FI
  • en-FI
  • fr-FR
  • en-FR
  • de-DE
  • en-DE
  • el-GR
  • en-GR
  • hu-HU
  • en-HU
  • en-IE
  • it-IT
  • en-IT
  • en-MX
  • es-MX
  • nl-NL
  • en-NL
  • en-NZ
  • nb-NO
  • en-NO
  • pl-PL
  • en-PL
  • pt-PT
  • en-PT
  • ro-RO
  • en-RO
  • es-ES
  • en-ES
  • sv-SE
  • en-SE
  • de-CH
  • fr-CH
  • it-CH
  • en-CH
  • en-GB
  • en-US
  • es-US
Example: locale=en-US
payment_amount
required
integer <int64> (PaymentAmount) [ 1 .. 2147483647 ]

Total amount of a one-off purchase, including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500. This is the amount that Klarna will charge the customer for a one-off purchase. Should not include any amounts for subscriptions.

Invariant: payment_amount = sum(line_items[].total_line_amount)

Example: payment_amount=2000
custom_payment_method_ids
string

You can dynamically trigger promotional credit offers. First, work with Klarna’s responsible account manager to determine the criteria for custom offers and a standard naming convention that will be referred to when requesting such offers via Klarna payments API. To be able to advertise these payment methods, pass the names as an array of strings to the On-site messaging placement. The array can be used to define which of the configured payment options within a payment category (pay_later, pay_over_time, and so on) should be included in the content selection.

Example: custom_payment_method_ids=FINANCING0
message_preference
string
Default: "klarna"

Allows the partner to indicate preference for the message type. If no value is passed or an unrecognized value is provided, the default "klarna" message will be used. Passing "in-store" adjusts the content to display "in-store" related message, while passing "prequalification" adjusts the message to display the prequalification related content.

Enum: "klarna" "in-store" "prequalification"
Example: message_preference=in-store
message_prefix
string

Prefixes the content of the message. Allowed values: Or, or

Enum: "Or" "or"
Example: message_prefix=Or
Responses
200

Successful response

204

No messaging available for the given parameters.

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

get/v2/accounts/{account_id}/payment/messaging/credit-promotion-badge
Request samples
Response samples
application/json
{
  • "content": {
    }
}

Top Strip

Get top strip promotion messaging for auto-size placement

Securityklarna_api_key or klarna_partner_account
Request
path Parameters
account_id
required
string (AccountIdentifier)

Unique account identifier assigned by Klarna to the onboarded merchant

Example: krn:partner:global:account:live:LWT2XJSE
query Parameters
locale
required
string (Locale)

Preferred locale, in IETF BCP 47 format.

Supported locales

  • en-AU
  • de-AT
  • en-AT
  • nl-BE
  • fr-BE
  • en-BE
  • en-CA
  • fr-CA
  • cs-CZ
  • en-CZ
  • da-DK
  • en-DK
  • fi-FI
  • sv-FI
  • en-FI
  • fr-FR
  • en-FR
  • de-DE
  • en-DE
  • el-GR
  • en-GR
  • hu-HU
  • en-HU
  • en-IE
  • it-IT
  • en-IT
  • en-MX
  • es-MX
  • nl-NL
  • en-NL
  • en-NZ
  • nb-NO
  • en-NO
  • pl-PL
  • en-PL
  • pt-PT
  • en-PT
  • ro-RO
  • en-RO
  • es-ES
  • en-ES
  • sv-SE
  • en-SE
  • de-CH
  • fr-CH
  • it-CH
  • en-CH
  • en-GB
  • en-US
  • es-US
Example: locale=en-US
message_preference
string
Default: "klarna"

Allows the partner to indicate preference for the message type. If no value is passed or an unrecognized value is provided, the default "klarna" message will be used. Passing "in-store" adjusts the content to display "in-store" related message, while passing "prequalification" adjusts the message to display the prequalification related content.

Enum: "klarna" "in-store" "prequalification"
Example: message_preference=in-store
message_prefix
string

Prefixes the content of the message. Allowed values: Or, or

Enum: "Or" "or"
Example: message_prefix=Or
Responses
200

Successful response

204

No messaging available for the given parameters.

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

get/v2/accounts/{account_id}/payment/messaging/top-strip-promotion-auto-size
Request samples
Response samples
application/json
{
  • "content": {
    }
}

Get top strip promotion messaging for badge placement

Securityklarna_api_key or klarna_partner_account
Request
path Parameters
account_id
required
string (AccountIdentifier)

Unique account identifier assigned by Klarna to the onboarded merchant

Example: krn:partner:global:account:live:LWT2XJSE
query Parameters
locale
required
string (Locale)

Preferred locale, in IETF BCP 47 format.

Supported locales

  • en-AU
  • de-AT
  • en-AT
  • nl-BE
  • fr-BE
  • en-BE
  • en-CA
  • fr-CA
  • cs-CZ
  • en-CZ
  • da-DK
  • en-DK
  • fi-FI
  • sv-FI
  • en-FI
  • fr-FR
  • en-FR
  • de-DE
  • en-DE
  • el-GR
  • en-GR
  • hu-HU
  • en-HU
  • en-IE
  • it-IT
  • en-IT
  • en-MX
  • es-MX
  • nl-NL
  • en-NL
  • en-NZ
  • nb-NO
  • en-NO
  • pl-PL
  • en-PL
  • pt-PT
  • en-PT
  • ro-RO
  • en-RO
  • es-ES
  • en-ES
  • sv-SE
  • en-SE
  • de-CH
  • fr-CH
  • it-CH
  • en-CH
  • en-GB
  • en-US
  • es-US
Example: locale=en-US
message_preference
string
Default: "klarna"

Allows the partner to indicate preference for the message type. If no value is passed or an unrecognized value is provided, the default "klarna" message will be used. Passing "in-store" adjusts the content to display "in-store" related message, while passing "prequalification" adjusts the message to display the prequalification related content.

Enum: "klarna" "in-store" "prequalification"
Example: message_preference=in-store
message_prefix
string

Prefixes the content of the message. Allowed values: Or, or

Enum: "Or" "or"
Example: message_prefix=Or
Responses
200

Successful response

204

No messaging available for the given parameters.

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

get/v2/accounts/{account_id}/payment/messaging/top-strip-promotion-badge
Request samples
Response samples
application/json
{
  • "content": {
    }
}

Checkout

Get messaging for checkout placement

Securityklarna_api_key or klarna_partner_account
Request
path Parameters
account_id
required
string (AccountIdentifier)

Unique account identifier assigned by Klarna to the onboarded merchant

Example: krn:partner:global:account:live:LWT2XJSE
query Parameters
locale
required
string (Locale)

Preferred locale, in IETF BCP 47 format.

Supported locales

  • en-AU
  • de-AT
  • en-AT
  • nl-BE
  • fr-BE
  • en-BE
  • en-CA
  • fr-CA
  • cs-CZ
  • en-CZ
  • da-DK
  • en-DK
  • fi-FI
  • sv-FI
  • en-FI
  • fr-FR
  • en-FR
  • de-DE
  • en-DE
  • el-GR
  • en-GR
  • hu-HU
  • en-HU
  • en-IE
  • it-IT
  • en-IT
  • en-MX
  • es-MX
  • nl-NL
  • en-NL
  • en-NZ
  • nb-NO
  • en-NO
  • pl-PL
  • en-PL
  • pt-PT
  • en-PT
  • ro-RO
  • en-RO
  • es-ES
  • en-ES
  • sv-SE
  • en-SE
  • de-CH
  • fr-CH
  • it-CH
  • en-CH
  • en-GB
  • en-US
  • es-US
Example: locale=en-US
custom_payment_method_ids
string

You can dynamically trigger promotional credit offers. First, work with Klarna’s responsible account manager to determine the criteria for custom offers and a standard naming convention that will be referred to when requesting such offers via Klarna payments API. To be able to advertise these payment methods, pass the names as an array of strings to the On-site messaging placement. The array can be used to define which of the configured payment options within a payment category (pay_later, pay_over_time, and so on) should be included in the content selection.

Example: custom_payment_method_ids=FINANCING0
payment_amount
required
integer <int64> (PaymentAmount) [ 1 .. 2147483647 ]

Total amount of a one-off purchase, including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500. This is the amount that Klarna will charge the customer for a one-off purchase. Should not include any amounts for subscriptions.

Invariant: payment_amount = sum(line_items[].total_line_amount)

Example: payment_amount=2000
Responses
200

Successful response

204

No messaging available for the given parameters.

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

get/v2/accounts/{account_id}/payment/messaging/checkout
Request samples
Response samples
application/json
{
  • "content": {
    }
}

Capabilities

Get merchant placements, clientId in OSM by MID or clientId(UUID).

Securityklarna_api_key or klarna_partner_account
Request
path Parameters
account_id
required
string (AccountIdentifier)

Unique account identifier assigned by Klarna to the onboarded merchant

Example: krn:partner:global:account:live:LWT2XJSE
query Parameters
mid
string

MID of the merchant.

Example: mid=K12345
client_id
string

Client ID(UUID) of the merchant.

Example: client_id=5fb4f264-dd9b-5df9-82d4-e7d88fcfaa89
Responses
200

Successful response

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Bad request.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

get/v2/accounts/{account_id}/payment/messaging/capabilities
Request samples
Response samples
application/json
{
  • "client_id": "5fb4f264-dd9b-5df9-82d4-e7d88fcfaa89",
  • "countries": [
    ],
  • "placements": [
    ]
}

Payment Options

Returns individual payment options, customers previous selected payment method and payment source if customer_token is passed in req body.

Returns all individual payment options (e.g. Financing 6 and Financing 12 are different items in the response, no grouping is applied). This endpoint is only available for selected merchants. Please advise with your point of contact before implemeting it.

Securityklarna_api_key or klarna_partner_account
Request
path Parameters
account_id
required
string (AccountIdentifier)

Unique account identifier assigned by Klarna to the onboarded merchant

Example: krn:partner:global:account:live:LWT2XJSE
Request Body schema: application/json
payment_amount
required
integer <int64> (PaymentAmount) [ 1 .. 2147483647 ]

Total amount of a one-off purchase, including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500. This is the amount that Klarna will charge the customer for a one-off purchase. Should not include any amounts for subscriptions.

Invariant: payment_amount = sum(line_items[].total_line_amount)

locale
required
string (Locale)

Preferred locale, in IETF BCP 47 format.

Supported locales

  • en-AU
  • de-AT
  • en-AT
  • nl-BE
  • fr-BE
  • en-BE
  • en-CA
  • fr-CA
  • cs-CZ
  • en-CZ
  • da-DK
  • en-DK
  • fi-FI
  • sv-FI
  • en-FI
  • fr-FR
  • en-FR
  • de-DE
  • en-DE
  • el-GR
  • en-GR
  • hu-HU
  • en-HU
  • en-IE
  • it-IT
  • en-IT
  • en-MX
  • es-MX
  • nl-NL
  • en-NL
  • en-NZ
  • nb-NO
  • en-NO
  • pl-PL
  • en-PL
  • pt-PT
  • en-PT
  • ro-RO
  • en-RO
  • es-ES
  • en-ES
  • sv-SE
  • en-SE
  • de-CH
  • fr-CH
  • it-CH
  • en-CH
  • en-GB
  • en-US
  • es-US
currency
string (Currency) ^[A-Za-z]{3}$

Currency in ISO 4217 format.

Supported currencies:

  • AUD
  • EUR
  • CAD
  • CZK
  • DKK
  • HUF
  • MXN
  • NZD
  • NOK
  • PLN
  • RON
  • SEK
  • CHF
  • GBP
  • USD
customer_token
string (CustomerToken) <= 1024 characters

Returned if Account Linking or payment tokenization was requested.

The customer_token represents the tokenized customer and allows you to act on behalf of the customer. You must persist this token in your system associated with the customer account. To de-duplicate customers, you should use the customer_id as the unique identifier.

Responses
200

Successful response

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

post/v2/accounts/{account_id}/payment/messaging/payment-options
Request samples
application/json
{
  • "payment_amount": 2000,
  • "locale": "en-US",
  • "currency": "USD",
  • "customer_token": "krn:partner:us1:live:identity:customer-token:vVQGmYzlfsQ16dko3jcwY5lV8hBgKs9a"
}
Response samples
application/json
{}

Payment Descriptors

Provides payment descriptors for rendering the checkout experience, based on the specified category preference. The no. of checkout items are defined based on the category_preference value and amount.

  1. If category_preference is set to KLARNA, all payment categories are combined into a single descriptor node in the response.
  2. If a valid category_preference (PAY_NOW, PAY_LATER, PAY_OVER_TIME) is provided, the response includes descriptors for the specified category as the first item, and a grouped descriptor for all other categories as the second item.
  3. If an invalid category_preference is provided, the response returns an error.
  4. If no category_preference is specified, the response includes individual descriptors for all available categories.
  5. Note: Use PAYMENT_DESCRIPTOR as the main header/title and PAYMENT_DESCRIPTOR_SUBHEADER as the subheader for each item. When multiple descriptor nodes are returned from the API, the merchant must generate multiple checkout listings consistently.
Securityklarna_api_key or klarna_partner_account
Request
path Parameters
account_id
required
string (AccountIdentifier)

Unique account identifier assigned by Klarna to the onboarded merchant

Example: krn:partner:global:account:live:LWT2XJSE
Request Body schema: application/json
payment_amount
required
integer <int64> (PaymentAmount) [ 1 .. 2147483647 ]

Total amount of a one-off purchase, including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500. This is the amount that Klarna will charge the customer for a one-off purchase. Should not include any amounts for subscriptions.

Invariant: payment_amount = sum(line_items[].total_line_amount)

locale
required
string (Locale)

Preferred locale, in IETF BCP 47 format.

Supported locales

  • en-AU
  • de-AT
  • en-AT
  • nl-BE
  • fr-BE
  • en-BE
  • en-CA
  • fr-CA
  • cs-CZ
  • en-CZ
  • da-DK
  • en-DK
  • fi-FI
  • sv-FI
  • en-FI
  • fr-FR
  • en-FR
  • de-DE
  • en-DE
  • el-GR
  • en-GR
  • hu-HU
  • en-HU
  • en-IE
  • it-IT
  • en-IT
  • en-MX
  • es-MX
  • nl-NL
  • en-NL
  • en-NZ
  • nb-NO
  • en-NO
  • pl-PL
  • en-PL
  • pt-PT
  • en-PT
  • ro-RO
  • en-RO
  • es-ES
  • en-ES
  • sv-SE
  • en-SE
  • de-CH
  • fr-CH
  • it-CH
  • en-CH
  • en-GB
  • en-US
  • es-US
category_preference
string (CategoryPreference)

The payment category that the merchant want to display as first option. "KLARNA" will club all categories into one text. Not passing this key will return all categories individually without grouping. if a category_preference is passed, the first option will be the preferred category, the next one will be the remaining categories grouped under one text.

Enum: "KLARNA" "PAY_NOW" "PAY_LATER" "PAY_OVER_TIME"
Responses
200

Successful response

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

post/v2/accounts/{account_id}/payment/messaging/payment-descriptors
Request samples
application/json

When category_preference is set to KLARNA, the payment_descriptor should return only one descriptor which has grouped text of all categories and with no payment_option_id.

{
  • "locale": "en-US",
  • "payment_amount": 1000,
  • "category_preference": "KLARNA"
}
Response samples
application/json

When category_preference is set to KLARNA, the payment_descriptor should return only one descriptor which has grouped text of all categories and with no payment_option_id.

{}