Quick reference
| Option | Type | Default | Description |
|---|---|---|---|
paymentFlow | string | 'DEFAULT' | 'DEFAULT' or 'PREFER_VAULT' |
recurringPaymentDescription | string | — | Description shown for recurring payments |
allowedPaymentCategories | string[] | All categories | 'pay_now', 'pay_later', 'pay_over_time' |
buttonOptions.text | string | — | Custom text next to the Klarna logo |
Payment flow
Control the payment flow for Klarna.| Option | Type | Default | Description |
|---|---|---|---|
paymentFlow | string | 'DEFAULT' | Payment flow type (see values below) |
Payment flow values
| Value | Description |
|---|---|
'DEFAULT' | Standard one-off payment (default) |
'PREFER_VAULT' | Vault the Klarna account for future payments |
When using
'PREFER_VAULT', you must also provide recurringPaymentDescription.Payment categories
Restrict which Klarna payment categories are available to customers.| Option | Type | Default | Description |
|---|---|---|---|
allowedPaymentCategories | string[] | All categories | Filter which Klarna payment options are displayed |
Available categories
| Category | Description |
|---|---|
'pay_now' | Pay immediately via direct debit or bank transfer |
'pay_later' | Pay in 30 days |
'pay_over_time' | Pay in 3-4 instalments or financing plans |
allowedPaymentCategories to limit the options.
Examples
Available categories also depend on the customer’s country, the order amount, and the merchant’s Klarna configuration. If a specified category is not available for the given context, it will not be displayed.
Button customization
Customize the text displayed on the Klarna payment button.| Option | Type | Default | Description |
|---|---|---|---|
buttonOptions.text | string | — | Text displayed next to the Klarna logo. Replaces the default “Pay with” text. |
Vaulting
Enable vaulting to save Klarna accounts for recurring payments.Requirements checklist
| Requirement | Where | Details |
|---|---|---|
paymentFlow: 'PREFER_VAULT' | SDK options | Enables vaulting flow |
recurringPaymentDescription | SDK options | Description shown to the customer |
vaultOnSuccess: true | Client session (server) | Tells Primer to vault the payment method |
customerId | Client session (server) | Identifies the customer in your system |
SDK configuration
How it works
- Customer authenticates with Klarna
- Klarna authorizes a recurring payment token
- Primer stores the vaulted payment method
- Future payments use the saved method without re-authentication
Client session requirements
Klarna requires specific data in the client session to process payments. Pass these when creating the client session on your server.| Parameter | Required | Description |
|---|---|---|
currencyCode | Yes | 3-letter ISO 4217 currency code (e.g., USD, EUR, GBP) |
order.lineItems | Yes | Details of the line items of the order |
order.countryCode | Yes | Country code of the customer |
customer.emailAddress | No | Pre-fills the Klarna payment form |
customer.mobileNumber | No | Pre-fills the Klarna payment form |
customer.shippingAddress | No | Pre-fills the Klarna payment form |
customer.billingAddress | No | Pre-fills the Klarna payment form |
paymentMethod.options.KLARNA.extraMerchantData | No | Extra Merchant Data (EMD) supported by Klarna |
Testing
Sandbox testing
Use Primer’s TEST environment to test Klarna payments without processing real transactions. Visit the Klarna Sample Data Page for test credentials and sample customer data.Production
No special configuration is required to go live — use your production credentials.Troubleshooting
Klarna button not appearing
Klarna button not appearing
Payment categories not displaying
Payment categories not displaying
Possible causes:
allowedPaymentCategoriesfilters out all available categories- Klarna does not offer the specified categories for the customer’s country or order amount
- Remove
allowedPaymentCategoriesto see all available categories - Check Klarna’s supported countries and currencies
- Verify order amount meets Klarna’s minimum requirements
Vaulting not working
Vaulting not working
Checklist:
paymentFlow: 'PREFER_VAULT'in SDK optionsrecurringPaymentDescriptionprovided in SDK optionsvaultOnSuccess: truein client sessioncustomerIdprovided in client session
Complete example
See also
SDK options reference
All configuration options
Klarna integration guide
Setup and integration guide
Klarna documentation
Official Klarna documentation