This section introduces Klarna’s ability to apply payment method-based promotions, allowing you to configure product, order, and shipping discounts based on payment choices. It also explains how Klarna’s API handles price adjustments and taxation, offers details on “Buy Online, Pickup In Store” (BOPIS) integration, and discusses subscription product configurations, including recurring order handling.
Starting with the B2C 20.7 release, merchants can use payment methods as qualifiers for product, order, and shipping promotions.
By default, when a promotion is configured to use a payment method as a qualifier, the total order amount is shown to the customer upon reaching the review page. This can cause the Klarna authorization call to be made for a higher amount than the final total.
To resolve this, when a customer selects a payment option in the billing section, a backend call is triggered. This call recalculates the basket totals, including any applicable promotions, and updates the Klarna session details. Consequently, the Klarna iframe widgets and the mini summary section on the storefront are refreshed to display the final order details.
For payment methods other than Klarna, this logic should be customized by the merchant to handle any third-party payment integrations.
Out of the box, the Klarna API sends product and shipping method details along with relevant discounts as separate line items, as shown below:
Merchants using gross taxation might opt to enable the “Tax Products and Shipping Only Based on Adjusted Price” preference. This preference is located under Merchant Tools > Site Preferences > Pricing and Promotion, and ensures that price adjustments are not taxed.
The setting kpPromoTaxation
has been introduced for this purpose. Merchants should update this setting to match their promotion configuration as follows:
total_amount
matching the prorated price and the attribute total_discount_amount
matching the total sum of all discounts for this item.Enabling this setting is not required for storefronts using net taxation, as the tax is not included in the product's base price. In such cases, the total order sales tax is sent to Klarna as a separate line item, not at the product or shipping line-item level.
When store pickup is enabled on the storefront, the integration sends store details to Klarna during the authorization request and when placing the Klarna order. Store information is only sent after the customer interacts with the Klarna payment method widgets.
The store address(es) are included in the Enhanced Merchant Data (EMD) attachment under the other_delivery_address
attribute when applicable. The handling of addresses in Klarna orders with store pickup is as follows:
other_delivery_address
attribute.For more information on the options, refer to the Klarna API reference.
The Klarna cartridge supports subscription handling, allowing merchants to offer products as subscriptions, manage subscription details, and handle recurring orders seamlessly.
Subscription details are configured at the product level. Products can be set as subscription-only, standard, or both. The trial period must be an integer value.
There are two types of subscription products:
The checkout process will not proceed if the cart contains a mix of standard and subscription products with different trial periods, or if some products have a trial period while others do not.
Dropdown menus with predefined values appear on the cart page when there is at least one subscription product in the cart. These values can be configured in the Administration panel under Site Development > System Object Types > Basket - Attribute Definitions. The attributes available for configuration are:
kpSubscriptionFrequency
kpSubscriptionPeriod
Only logged-in users can complete a subscription checkout. Session intent is defined based on the basket content:
tokenize
: Basket contains products with a trial period; user is not charged on order creation.buy_and_tokenize
: Basket contains subscription products without a trial period.buy
: Basket contains only standard products, no subscription products.For intents tokenize
and buy_and_tokenize
, a Klarna customer token for recurring payments is created and stored in the customer profile for future use.
Upon order creation, the user profile is updated with subscription data:
Users can view a full list of their subscriptions in the My Account section. They can cancel subscriptions, which will be displayed with an Inactive status. The Cancel Subscription button deactivates the customer token, preventing further charges.
A back-end job processes recurring subscriptions for each user in SFCC if subscriptions exist. The job iterates through customers and checks for subscriptions due for payment on the same day.
Create new order: Using data from lastOrderID
, a new order is created, and a charge call is made to Klarna using the token and price from lastOrderID
.
Update details on success: On success, nextChargeDate
is updated based on subscriptionPeriod
, and lastOrderID
is set to the ID of the newly placed order. The Subscription Dashboard is updated accordingly.
Retry mechanism: Merchants can configure a retry mechanism with specific retry intervals. If retries fail, the subscription can be deactivated.
Cancel subscription: If retry is disabled, the subscription is canceled.
Orders with trial period subscriptions are paid after the trial period ends. On the next charge date, a new order is created with the channel type set to SUBSCRIPTIONS
.
This cartridge has been tested against API Version 22.6 (Compatibility Mode: 22.7) and SFRA version 7.0.0.
The cartridge is compliant with GDPR recommendations and follows best practices to ensure only necessary Personally Identifiable Information (PII) is transmitted to authorize the payment method. For detailed guidelines, refer to the implementation best practices here.
The cartridge supports sending additional information on the customer's past purchase history and "Buy Online, Pickup in Store" (BOPIS) store addresses when enabled in custom preferences under "Attachments" (kpAttachments
). The types of data that can be sent as an attachment are detailed here.
EMD is required for certain types of merchant orders and generally improves acceptance rates (e.g., customer_account_info
: past interactions with the merchant store). EMD is included as part of the authorization step in the Commerce Cloud checkout. The data sent to Klarna is customizable and can be viewed in int_klarna_payments/scripts/payments/additionalCustomerInfo.js
. This script should return a JSON string to be used as the value for the body sub-field of the attachment field as described here.
Example Schema for Additional Customer Information
If the example additionalCustomerInfo.js
file is used unchanged, the data sent to Klarna follows this schema:
Example data
When the customer uses Guest Checkout, the EMD sent includes payment_history_full[0].unique_account_identifier
(cqcid value set by SFCC), and all other fields are empty.
The virtual card (MCSv3) solution enables settlements using individual virtual cards issued against a Klarna order. To comply with PCI-DSS requirements, merchants must ensure that data is securely maintained and transmitted as part of their operation in their live store environment. The required steps must be completed in consultation with your payment service provider/acquirer before going live. Review the order export details required for virtual card-based Klarna orders in advance. Any historical decrypted PCI data should be expunged, regardless of the VCN validity date.
DO NOT SAVE UNENCRYPTED PCI DATA ON THE SERVER!