This guide helps you activate Klarna Payments by setting up configurations and credentials in the SAP Commerce Backoffice.
Before you start, ensure:
klarnapaymentaddon is successfully installed.1. Navigate to Klarna Payment Configuration: Go to SAP Commerce Backoffice → Klarna → Klarna Payments Config.

Navigate to Klarna Payment Configuration
2. Create a new Klarna configuration: Select the option to create a new Klarna configuration.

Create a New Klarna Configuration
3. Fill in mandatory fields:

Fill in the Klarna Payments Specific Fields
4. Provide additional details:

Fill in the Klarna Payments Specific Fields 2
1. Navigate to Klarna Activation: In the Backoffice, go to Klarna → Klarna Activation.
2. Add a new credential: Click the + icon below the Klarna Activation section.

Klarna Activation
3. Fill in mandatory fields:

Create new credential
4. Provide additional details:

Credential additional details
1. Navigate to Klarna Common Configuration: Go to Klarna → Klarna Common Configuration.

Common Configuration
2. Create a mapping:

Mapping credentials
3. Link Klarna credentials and payment configuration:

Mapping details
| Attribute | Mandatory | Description |
|---|---|---|
| Klarna API Username | Yes | Generated in Klarna Merchant Portal. |
| Klarna API Password | Yes | Generated in Klarna Merchant Portal. |
| Region | Yes | Choose from EUROPE, NORTH_AMERICA, or OCEANIA. |
| Markets | Yes | Countries supported under the selected region. |
| Environment | Yes | TEST (playground) or LIVE (production). |
| AutoCapture | No | Enables auto capturing during order placement (not relevant if VCN is enabled). |
| Enable VCN | No | Toggles VCN-based settlement. |
| Public Key ID | No | RSA public key provided in JWK format for VCN settlement. Recommended: 4096-bit RSA keypair. |
Tips for an Optimal User Experience
Ensure the Klarna Payments iframe is visible and text is legible by using a consistent minimum width for checkout and billing pages. This enhances the experience for mobile users.
1. Open a terminal and run the following commands:
openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:4096
openssl rsa -pubout -in private_key.pem -out public_key.pem
2. This will create two files:
private_key.pem (Private key)public_key.pem (Public key)public_key.pem.public_key.pem file contents:-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAoNYG7l2G8nZa+22oBYZk
tV228lw3UE9WO4oxfknJtKEdHn84x55ULt8KQTh9NVtdeKC8nTfTgyvMt/GNCa18
xuZV/lGYDftKt85hbV5EjOum+StAIufEXvlBX7nMOMc1KyWm9kp2kbqd88mFIX63
KV94OoNEXcNatRDFYR+qz53+ifadDQtQ1slVNStdroCZDJ1+LxtBy9V+BdmsBK1E
RLsKh/JLXyWE24FJKV+z00s7TQkdWW/5ET12OGQYZsWo1yqgi9HplNvrisve8vWP
xaL4m8iZ3I/9yYdg7yANQbTxSJcbbRCgaaagPo30CNxeqU6qafY5g8vY3E52CoXH
DdO4UslX1qcuYIDhqaDzey6W+b8m755xLi+rqQyM4PBWL0J0dM3FVid8+4YKILex
3AKBFciqRCMHSOGaEeyrXKTjlAsghr9RS8PifvQRrL440cHzqw2vX0DvpjSWcmUJ
tW4wUq5RNSsobrxnVmoV6fj1z67Q/1P+l5Ie+oowdahR5ztVqJlO+2PNoX4I5VDs
VCN
Important Notes on PCI Compliance
1. Access the Order

Verifying VCN in order
2. View Order Details

VCN Details
Important!
1. Verify Klarna Order ID:

Verify Klarna Order ID
2. Check Payment Transactions:

Verify Payment Transactions
KLARNAORDER_PLACED to verify Klarna-specific transactions
KLARNA_ORDER_PLACE
The Extra Merchant Data (EMD) feature allows merchants to send additional customer information to Klarna, such as alternative delivery addresses and reservation details. By default, only logged-in customer information is sent.

Enable EMD
To extend the EMD functionality beyond the default behavior:
addAttachment Method:yourDataObject with the required data (e.g., customer preferences or reservation details).addAttachment("additionalData", yourDataObject);Best Practices for EMD and Order Verification
| Model | OOB Model | Attributes |
| BaseStore | BaseStore | klarnaPayConfig |
| AbstractOrder | AbstractOrder | kpIdentifier kpAnonymousGUID kpOrderId kpFraudStatus isKpPendingOrder isKpAuthorised isKpFraudRiskStopped |
| KPPaymentInfo | InvoicePaymentInfo | paymentOption finalizeRequired description authToken isVCNUsed vcnBrand vcnCSC vcnValidToYear vcnValidToMonth vcnHolder vcnPan vcnCVV |
| Class | OOB Class |
| KPPaymentMethodCheckoutStepController | PaymentMethodCheckoutStepController |
| KPSummaryCheckoutStepController | AbstractCheckoutStepController |
| KlarnaResponsiveSummaryCheckoutStepValidator | AbstractCheckoutStepValidator |
| KlarnaSummaryCheckoutStepValidator | AbstractCheckoutStepValidator |
| KPAddressPopulator | AddressPopulator |
| KPOrderPopulator | AbstractOrderPopulator |
| KlarnaEventPublishingSubmitOrderStrategy | SubmitOrderStrategy |
| KPPaymentTypeCheckoutStepController | AbstractCheckoutStepController |
| Use Case | Class | Method |
| Create/Update payment session | DefaultKPPaymentFacade | getORcreateORUpdateSession |
| Authorize Payment | DefaultKPPaymentFacade | getPaymentAuthorization |
| Create Klarna Order | DefaultKPPaymentCheckoutFacade | saveKlarnaOrderId |
| Cancel Klarna Order | KPOrderConfirmationController | orderConfirmation |
| Use Case | Class | Method |
| Get Klarna Payment session | Client | newPaymentsSessionsApi |
| Authorize Payment | Client | newPaymentsOrdersApi |
| Get Klarna Order by ID | Client | newOrderManagementOrdersApi |
| Create payment Settlement | Client | newVirtualCreditCardSettlementsApi |
| Delete Auth | newPaymentsOrdersApi | |
| Capture Payment | newOrderManagementCapturesApi |