Before you begin
This guide assumes that you know how toAccept payments with Klarna
Prepare the client session
Klarna requires the following data to process a payment successfully. Pass the following data in the client session, or in the payment request (for manual payment creation).Parameter Name | Required | Description |
---|---|---|
currencyCode | ✓ | 3-letter currency code in ISO 4217 format, e.g. USD for US dollars |
order ↳ lineItems | ✓ | Details of the line items of the order |
order ↳ countryCode | ✓ | The country code of the user.Learn more about the supported countries and currencies by visiting Klarna Documentation. |
customer ↳ emailAddress | Customer’s email address. Pass this value to pre-fill the Klarna payment form. | |
customer ↳ mobileNumber | Customer’s mobile number (make sure it is the correct format for the country code). Pass this value to pre-fill the Klarna payment form. | |
customer ↳ shippingAddress | Customer’s shipping address. Pass this value to pre-fill the Klarna payment form. | |
customer ↳ billingAddress | Customer’s billing address. Pass this value to pre-fill the Klarna payment form. When passing customer.billingAddress in the client session, ensure that Klarna has payment method categories configured for the given address. If Klarna is not supported for the given billing address, no Klarna button will be rendered in the checkout | |
paymentMethod ↳ options ↳ KLARNA ↳ extraMerchantData | Extra Merchant Data (EMD) package supported by Klarna can be passed via the client session. Any JSON object that will be accepted by Klarna can be sent. Available schemas are documented here |
Prepare the SDK for payments
Show Universal Checkout
Klarna is automatically presented to the customer when callingPrimer.showUniversalCheckout
.Typescript
Customization
Check the customization guide to learn how to customize payment method buttons.TypeScript
Troubleshooting
In order to be passed to Klarna, the shipping address and billing address must contain the following info:firstName
lastName
addressLine1
city
postalCode
countryCode