Klarna is a sweedish based e-commerce company that provides payment services for online stores. When a purchase is completed, Klarna will pay the merchant instantly, but will bill the acquirer upon receiving the goods.
Klarna allows the user to pay only with an email address and a delivery address - no password. They operate in Sweden, Norway, Denmark, Germany, Netherlands, Finland, United Kingdom, Austria and United States.
Klarna is available for Professional accounts.
The maximum payable amount by a customer, for Klarna, is:
How does it work for the user?
After checkout, the customer must only insert email, zip code and a billing address. For returning customers it’s a one tap payment experience: the system will recognize you and will avoid to reintroduce sensitive data. This has prooved to be effective especially with mobile payments.
How do I activate it on Gestpay?
Contact Gestpay support to add Klarna to your payment options.
Klarna requires you to accept their terms and conditions, and they will also perform some tests to verify that the User Experience is ok.
If you satisfy these requirements, you will finally be able to use Klarna with Gestpay.
Klarna permits to authorize a payment and settle it in max 14 days. This is different from the default Gestpay behaviour of 25 days.
How do I use it on Gestpay?
If you want to use the
paymentType tag for this method, the value to use is
S2PKLA. See the section How to redirect the customer to a payment method to learn how to use the
Please refer to the API section on how to use Klarna on Gestpay.
To use Klarna you must send some mandatory parameters, children of
BillingAddressfields, as specified in the next section.
- A list of
Based on the buyer’s country, you might need to set fields differently.
- DE: you have to send
- NL: you have to send
- US: you have to send
- All other countries (
AT | DK | FI | NO | SE | GB) require
If the shipping address is different than the billing address, then
Shipping needs to be sent in the request too, with full details, otherwise the transaction will be rejected.
Some exception apply to DE and NL Countries:
- Only some details from shipping/billing can be added on Klarna’s page:
Billing Addressis not complete: only
House Numberare editable for Billing address
Billing Addressis not complete &
Shippingis different and incomplete: only
House Numberare editable for both Billing and Shipping.
If the Billing Address
CountryCodediffers from Shipping Address
CountryCode, the transaction will fail.
ProductDetails contains info about products bought by your customers. It can have one or more
ProductDetail along with all the info about pricing and discount. Klarna requires the price to follow some very strict rules, described in the following paragraphs.
Based on the Billing Address
Type attribute in
ProductDetail can have different values.
Let’s see a table with all the possible Product types and when they’re used.
||Entered as a negative value to be subtracted from the total order|
||Used when a shipping fee is added to the order|
||Only for USA VAT tax|
||Intangible purchase, like a license|
||Gift card purcase|
||Entered as a negative value to be subtracted from the total order|
||Used for additional fees|
If the country code is one of
1is a product and it is mandatory
4is a discount, it is optional and it must have a negative value.
If the country code is
GB we must distinguish between phisical or digital products and gift cards. Klarna decides (and verifies) in autonomy if the product you’re selling is digital or physical, and the transaction can fail according to this.
UKit is mandatory at least an article of type
USit is mandatory at least an article of type
9and also you must specify a mandatory product of type
7- a shipping cost used in
- a product with type
4is a discount article that gets applied to the whole order. It has an absolute value and must be negative. There must be at most one occurence.
- Klarna allows a discount for a single product, too, via the
<Discount>tag. It must be positive and it’s value is percentual in the range
0-100. You can use it on products with type
Since both discounts can be used together, here is a formula to calculate the price along with discounts:
Let’s do an example. You can see three products and their attributes in this table.
|Product 1||Product 2||Product 3|
||This is an example WITH percentage discount||This is an example WITHOUT percentage discount||this is the discount|
In this case, the
Applied only to the item, in percentage
The total price is:
The discount, either global or per-product, can influence the refund process.
The remaining data, besides product & billing details, should be sent in full (ie: customer FirstName; customer LastName; phone, email address, social security number). However, these details can be added on Klarna’s page if not sent by Merchant.
Handling Failure on Klarna page
If the phone is not sent in the request and if on Klarna the customer enters incorrect details for this parameter, the customer will be redirected to the Failed page, without the possibility to re-enter the phone details. This does not apply for sandbox environment.
Credentials for test environment
Ask Gestpay customer support to enable Klarna in test environments.
You can use the following parameters value in order to test Klarna in test (sandbox.gestpay.net) environment. Use low amount like 10.00 EUR. Remember to set the mandatory fields:
BillingAddress.CountryCode = 'SE'
When landing of Klarna payment page use the following parameter to fill the field or send it directly in the parameters like as described above in order to have a successful test payment:
Here are the same values in a better copy-and-paste format:
- Personal Number:
- First Name:
- Last Name:
- Zip Code:
- Phone Number:
Klarna payment is only available using
Encrypt and the Payment Page; it is not available with Server-to-Server calls. However, the Klarna Partial Refund operation is exposed via Server-to-Server API.
From the Merchant Back-Office it’s possible to do a Klarna total refund, but not a partial refund. The function
CallRefundS2S, instead, allows the merchant to do Total and Partial refunds.
Klarna needs the product details of the refund, and to do this Merchants must add some additional fields of order details.
For the partial Refund Klarna needs mandatory fields like
Quantity present in the
For example, if you do a call to
Encrypt) with this
<Encrypt> <!-- total, shop login, currency, etc removed for clarity... --> ... <!-- in this example, the buyer is buying two products --> <paymentTypes> <paymentType>S2PKLA</paymentType> </paymentTypes> <OrderDetails> <ecom:ProductDetails> <!-- product 1 --> <ecom:ProductDetail> <ecom:ProductCode>1</ecom:ProductCode> <ecom:SKU></ecom:SKU> <ecom:Name>aaa</ecom:Name> <ecom:Description></ecom:Description> <ecom:Quantity>2</ecom:Quantity> <ecom:Price>10</ecom:Price> <ecom:UnitPrice></ecom:UnitPrice> <ecom:Type>1</ecom:Type> <ecom:Vat>10</ecom:Vat> <ecom:Discount>0</ecom:Discount> </ecom:ProductDetail> <!-- product 2 --> <ecom:ProductDetail> <ecom:ProductCode>2</ecom:ProductCode> <ecom:SKU></ecom:SKU> <ecom:Name>bbb</ecom:Name> <ecom:Description></ecom:Description> <ecom:Quantity>1</ecom:Quantity> <ecom:Price>5</ecom:Price> <ecom:UnitPrice></ecom:UnitPrice> <ecom:Type>1</ecom:Type> <ecom:Vat>10</ecom:Vat> <ecom:Discount>0</ecom:Discount> </ecom:ProductDetail> </ecom:ProductDetails> </OrderDetails> </Encrypt>
You can refund partially the transaction with sending
CallRefundS2S, like this:
<eco:callRefundS2S> <!-- shopLogin, amount, and other data as usual... --> ... <eco:OrderDetail> <ecom:ProductDetails> <!-- we are refunding product n.2 --> <ecom:ProductDetail> <ecom:ProductCode>2</ecom:ProductCode> <ecom:SKU></ecom:SKU> <ecom:Name>bbb</ecom:Name> <ecom:Description></ecom:Description> <ecom:Quantity>1</ecom:Quantity> <ecom:Price>5</ecom:Price> <ecom:UnitPrice></ecom:UnitPrice> <ecom:Type>1</ecom:Type> <ecom:Vat>10</ecom:Vat> <ecom:Discount>0</ecom:Discount> </ecom:ProductDetail> </ecom:ProductDetails> </eco:OrderDetail> </eco:callRefundS2S>
Another important information partial refunds is that Klarna only supports refunds for the unit price of an article.
In the previous example, we bought two items:
You can refund in these ways:
- 5€ partial refund of 1
- 10€: partial refund of 1
- 15€: partial refund of 1
- 20€: partial refund of 2
- 25€: partial refund of 2
Based on this, you cannot refund
aaa for only 5€.