Klarna Deposit
Klarna Financing is collection of various payment methods like pay now, pay later (invoice) or financing. Customers select this method in the checkout process in the online store the payments are done after the goods were delivered. The payment is immediately confirmed and the payment is guaranteed to the merchant.
-
Klarna Pay Now
Customers pay for their purchase instantly/immediately using online bank transfer ("Klarna Sofort") or direct debit (applicable in AT, DE, NL). -
Klarna Pay Later
Customers can receive their goods delivered before they have to pay. After the items were shipped, the customer has 14, 21 or 30 days to pay by invoice.
14 days in AT, DE, DK, FI, NL, NO, SE, UK, US
21 days in BE
30 days in CH, UK, US -
Klarna Financing
Customers can spread their cost over time and pay at their own pace.
Up to 36-months financing to increase the customers purchasing power (applicable in AT, DE, DK, FI, NO, SE).
In the UK and US "Slice it by 3 or 4" is offered which means 3 or 4 equal installments are paid.
The payment method is offered by PXP Financial to its merchants in aggregation model. The merchant has a contract with PXP only and PXP will settle the money from Klarna to the merchant.
The following method IDs are covered in this section:
ID | Name | Credit State |
---|---|---|
369 | Klarna Deposit | InitiatedByProvider (3) |
370 | Klarna Pay Now Deposit | ExecutedByProvider (142) |
371 | Klarna Pay Later Deposit | ExecutedByProvider (142) |
372 | Klarna Financing Deposit | ExecutedByProvider (142) |
Relevant Payment Method
To initiate a Klarna Deposit, Payment Method
369 Klarna Deposit
has to be used in the intitiatePayment or getRedirectData request. After the customer has selected the "real" Klarna payment method (Pay Now, Pay Later or Financing) and the payment is confirmed with Klarna, the PXP Financial System will exchange the369 Klarna Deposit
method with the final method
370 Klarna Pay Now Deposit
371 Klarna Pay Later Deposit
or372 Klarna Financing Deposit
Limitations
Supported Countries and currencies
The supported countries and currencies and their combination can be found in the Klarna documentation.
Payment not possible for not supported Country/Currency combinations
Klarna will refuse payment requests for country and currency combinations which are not supported and a payment with this payment method will not be possible.
Payment Method Availability per market
This Klarna article describes the available payments per country and how payment methods are grouped together under payment method categories.
Payment Flow
Redirect Integration Payment Flow (using the PXP Financial Checkout)
The following diagram describes the interaction between the involved systems in the creation of a successful Klarna Deposit payment in case the merchant uses the redirect integration (PXP Financial Checkout):
Backend2Backend Integration Payment Flow
Payment method interaction type: Synchronous (see Interaction Types).
The following diagram describes the interaction between the involved systems in the creation of a successful Klarna Deposit payment in case the merchant uses the backend2backend integration:
State diagram - applicable for redirect (Checkout) and Backend2Backend integration
The following diagram describes the Klarna Deposit payment states:
Optional API elements which are required Data for Klarna Deposit
Applicability
This section applies to both integration types: Redirect and Backend2Backend
Klarna requires specific customer information to perform risk checks and approve the payment. This also depends on the customers purchase country. Sending data is essential for this payment method as the data is forwarded to Klarna provider.
This section documents which additional data has to be sent to do a successful Klarna deposit.
Merchants Terms and Conditions
To comply with GDPR, the merchant has to clearly mention in its General Terms and Conditions that the customer accepts and agrees that his personal data is shared with the parties involved in the payment process if he selects/decides to pay with Klarna payment method.
To initiate a Klarna Deposit (via getRedirectData or initiatePayment) the following data becomes additionally mandatory and have to be provided by the merchant in an accurate way. The information is needed by Klarna to perform risk checks for the decision if they accept a payment or refuse it. Furthermore it will be partially used and displayed to the customer in the Klarna App - to avoid customer support issues.
Customer and Billing Information
- For a backend2backend integration, the following parameters must be provided in
initiatePaymentRequest.userData
section - For a redirect integration (Checkout) the following parameters must be provided in the
getRedirectDataRequest.redirectParameters.user
section:
Field | Value |
---|---|
address (address, conditional) | The billing address of the customer. Mandatory information needed by Klarna for risk checks. If a billing address is provided, all mandatory elements have to be provided, otherwise the payment initiation with Klarna will fail and an error will be responded in the initiatePayment or getRedirectData request.If not provided, Klarna will collect this information from the customer during payment process. It is recommended to send the user address to reduce the effort for the customer and to increase success rate with Klarna |
address.street (string, required) | Street of the customer´s address. Mandatory if address is provided |
address.houseNumber (string, conditional) and/or address.houseName (string, conditional) | Either house number or house name is required. Mandatory if address is provided |
address.postalCode (string, required) | Postal code of the customer´s address. Mandatory if address is provided |
address.city (string, required) | City of the customer´s address. Mandatory if address is provided |
address.state (string, required only for US customers) | State of the customer´s address. Mandatory only in US to provide the state or region and only if address is provided.Use two-letter format, e.g. “CA” for California. Follows ISO 3166-1 alpha-2 |
address.countryCode2 (string, required) | Country of the customer´s address See Supported Countries and currencies for information which countries are supported by Klarna and PXP Financial. Mandatory if address is provided. |
address.telephoneNumber (string, conditional) | The customers phone number. Optional in those customer countries: Germany, Austria, Switzerland, Netherlands and Belgium Required for risk assessment by Klarna in those customer countries: - Sweden, Norway, Finland and Denmark - United Kingdom - United States - Australia |
dateOfBirth | Can be provided. If not provided, Klarna will show a pop-up and request this from the customer during the checkout process |
gender (string, conditional) | Not required in those customer countries: United States, Australia Required for risk assessment by Klarna in those customer countries: United Kingdom, Germany, Austria, Switzerland, Netherlands and Belgium Optional in Nordic countries (Sweden, Norway, Finland and Denmark) because the National Identification Number ( identificationNumber , see description below) of the customer has to be provided and Klarna will derive the gender from this information. |
firstname (string, required) | The customers first name |
lastname (string, required) | The customers last name |
email (string, required) | The customers email address |
identificationNumber | The National Identification Number of the customer, only applicable if the payment country (purchase country) is Sweden, Norway, Finland, Denmark Can be provided if the payment country (purchase country) is Sweden, Norway, Finland, Denmark. If not provided by the merchant, Klarna will show a pop-up and request this from the customer during the checkout process |
identificationNumberType with value "NationalIdentificationNumber" (string, applicable and required only if identificationNumber was provided) | If a value for identificationNumber is provided, this field has to be provided too with a fixed value as NationalIdentificationNumber |
Shipping Address and Details
In case the customer has selected a different shipping address than the billing address during the checkout process at the merchant, the Shipping Information has to be provided to PXP Financial and will be used by Klarna for risk evaluation.
- For a backend2backend integration, the information has to be provided as part of the optional element shippingDetails in the
initiatePayment
request - For a redirect integration (Checkout) the similar set of fields have to be provided as key-value pairs in the
getRedirectDataRequest.additionalData
section of thegetRedirectData
request
The table below lists the additional fields that can or must be sent in initiatePayment
or getRedirectData
request.
Full address information is required
If a shipping address is provided, all mandatory elements of the address have to be provided, otherwise the payment initiation with Klarna will fail and an error will be responded in the
initiatePayment
orgetRedirectData
request. See below which address related parameters are mentioned as required.
Field in initiatePayment | Field in getRedirectData | Value |
---|---|---|
name (personName, required) | shippingName (string, required) | The recipients full name. It is important to provide additionally the recipients firstName and Lastname of the recipient in the extra fields mentioned below. |
firstname (personName, conditional) | shippingFirstname (string, conditional) | The recipients first name. Has to be provided in case the recipient is a different person than the customer If not provided, the same first name as provided in the user data is used. |
lastname (personName, conditional) | shippingLastname (string, conditional) | The recipients last name. Has to be provided in case the recipient is a different person than the customer If not provided, the same last name as provided in the user data is used. |
address.street (string, required) | shippingStreet (string, required) | Street of the customer´s shipping address If the delivery is made to a collection/pick-up point or store, then the address from the collection/pick-up point or store should be provided as Shipping Details. |
address.houseNumber (string, conditional) and/or address.houseName (string, conditional) | shippingHouseNumber (string, conditional) and/or shippingHouseName (string, conditional) | House number or name of the customer´s shipping address. Either house number or house name is required If the delivery is made to a collection/pick-up point or store, then the address from the collection/pick-up point or store should be provided as Shipping Details. |
address.postalCode (string, required) | shippingPostalCode (string, required) | Postal code of the customer´s shipping address If the delivery is made to a collection/pick-up point or store, then the address from the collection/pick-up point or store should be provided as Shipping Details. |
address.city (string, required) | shippingCity (string, required) | City of the customer´s shipping address If the delivery is made to a collection/pick-up point or store, then the address from the collection/pick-up point or store should be provided as Shipping Details. |
address.state (string, required only for US customers) | shippingState (string, required only for US customers) | State or province of the customer´s shipping address. Applicable only for US. If the delivery is made to a collection/pick-up point or store, then the address from the collection/pick-up point or store should be provided as Shipping Details. |
address.countryCode2 (string, required) | shippingCountryCode2 (string, required) | Country of the customer´s shipping address If the delivery is made to a collection/pick-up point or store, then the address from the collection/pick-up point or store should be provided as Shipping Details. |
address.telephoneNumber (string) | shippingTelephoneNumber (string) | The phone number of the recipient of delivery. If not provided, the same phone number as provided in the user data is used. |
email (emailAddress) | shippingEmail (string) | The recipients email address. Has to be provided only in case it is different from the customer's email address If not provided, the same email address as provided in the user data is used. |
deliveryType (string) | shippingDeliveryType (string) | The delivery type indicates, if the purchased goods will be sent to a - Collection/Pick-up point ( CollectionPoint )- Store Pick Up ( ShipToStore )- a different address entered by the customer as shipping address ( ShipToAddress )It is important for the Klarna risk assessment to indicate this correctly - to avoid unnecessary payment refusals. Accepted values: CollectionPoint ShipToStore ShipToAddress If the delivery is made to a collection/pick-up point or store, then the personal data from customer and the a ddress from the collection/pick-up point or store should be provided as Shipping Details. Note If no value is provided, we assume the shipping address was entered by the customer and default the value against Klarna to ShipToAddress |
Shopping Cart/Basket information (Order Lines)
The optional element shoppingCart is required and needs be correctly populated in the getRedirectData or initiatePayment request.
Customer Usability
The reason why this element is mandatory is that this information is shown in the Klarna app of the customer later on and reduces customer support contacts for both parties: Klarna and the merchant.
Those fields are mandatory in the shoppingCart element and have to be provided (see shoppingCart):
Field | Value |
---|---|
shoppingCart.items.item.product.id ( required) | The product ID of the item. Max length in the Klarna system is 64 characters (PXP System allows 100 char but will truncate to 64 when sent to Klarna) |
shoppingCart.items.item.product.name ( required) | The Product Name, example: "Jeans" |
items.item.product.description | A product description. Optional If provided, it will be sent as description to Klarna. |
shoppingCart.items.item.product.unitPrice ( required) | Price of the Product Item (per unit). Should come as positive amount. Tax must be included only if applicable. |
shoppingCart.items.item.product.type ( conditional) | The type of this product. Should be provided for each product. Accepted values: - Physical (physical goods)- Digital (virtual goods)- GiftCard (used only for the purchase of a new gift card; if a gift card was used for paying part of the payment amount, it should be provided as discount in the shoppingCart.discounts element)- Surcharge (additional costs that apply to this shopping cart must be sent as extra products using this type to indicate what it is)If no value is provided, we default to Physical |
shoppingCart.items.item.quantity ( required) | Number of items |
shoppingCart.items.item.totalPrice ( required) | Total price considering numbers of item, unit price and discounts, including tax. Tax must be included only if applicable. Calculation: (unitPrice - discount) x quantity = totalPrice |
shoppingCart.items.item.discount | Discount per item with tax (if applicable) and discount name |
shoppingCart.shippingCost | Shipping Costs with Tax and Name (description). Shipping Costs must be included only if applicable. |
shoppingCart.discounts | Collection of discount(s) which apply on shopping cart level (not per item). Discounts must be included only if applicable and should come with a negative amount. |
shoppingCart.discounts.discount.type ( conditional) | The type of the discount. Should be provided if a shoppingCart.discounts was provided. The type of this product. Accepted values: - Discount - StoreCredit (store_credit is a credit from the merchant and therefore has no VAT; the taxAmount parameter in the discount should not be provided; see example below)- GiftCard (should be used if the customer used a gift card to pay for his purchase partially)If no value is provided, we default to Discount |
totalTaxAmount ( conditional) | Total tax amount of the shopping cart. If tax is included in the purchase amount, this field is mandatory. This amount also includes the tax of potential shipping costs or discounts on shopping cart level |
Other shoppingCart elements
Please note that all other shoppingCart elements which are offered by our API - if not mandatory or listed above - are irrelevant for Klarna and will would be ignored if sent.
Example shoppingCart
element:
<shoppingCart>
<items>
<item>
<product>
<id>123</id>
<name>Jeans</name>
<description>stonewashed</description>
<unitPrice>
<grossAmount>40</grossAmount>
<taxAmount rate="20" name="VAT">6.67</taxAmount>
</unitPrice>
<type>Physical</type>
</product>
<quantity>1</quantity>
<totalPrice>
<grossAmount>30</grossAmount>
<taxAmount rate="20" name="VAT">5</taxAmount>
</totalPrice>
<discount>
<name>Jeans-Promotion</name>
<grossAmount>-10</grossAmount>
<taxAmount rate="20" name="VAT">-1.67</taxAmount>
</discount>
</item>
<item>
<product>
<id>456</id>
<name>CD Rom</name>
<description>CD Rom</description>
<unitPrice>
<grossAmount>50</grossAmount>
<taxAmount rate="10" name="VAT">4.54</taxAmount>
</unitPrice>
<type>Digital</type>
</product>
<quantity>2</quantity>
<totalPrice>
<grossAmount>80</grossAmount>
<taxAmount rate="10" name="MwSt">7.27</taxAmount>
</totalPrice>
<discount>
<name>Spring-Promotion</name>
<grossAmount>-20</grossAmount>
<taxAmount rate="10" name="VAT">-1.82</taxAmount>
</discount>
</item>
<item>
<product>
<id>789</id>
<name>Gift Card</name>
<description>Gift Card Purchase</description>
<unitPrice>
<grossAmount>15</grossAmount>
<taxAmount rate="20" name="VAT">2.5</taxAmount>
</unitPrice>
<type>GiftCard</type>
</product>
<quantity>1</quantity>
<totalPrice>
<grossAmount>15</grossAmount>
<taxAmount rate="20" name="VAT">2.5</taxAmount>
</totalPrice>
</item>
</items>
<subTotalAmount>125</subTotalAmount>
<shippingCost>
<name>Express</name>
<grossAmount>30</grossAmount>
<taxAmount rate="20" name="VAT">5</taxAmount>
</shippingCost>
<discounts>
<discount>
<name>Sales-Discount</name>
<grossAmount>-10</grossAmount>
<taxAmount rate="20" name="VAT">-1.67</taxAmount>
<type>Discount</type>
</discount>
<discount>
<name>Store Credit</name>
<grossAmount>-5</grossAmount>
<type>StoreCredit</type>
</discount>
</discounts>
<amountsByTax>
<amountByTax taxName="VAT" taxRate="10">
<grossAmount>80</grossAmount>
<taxAmount>7.27</taxAmount>
</amountByTax>
<amountByTax taxName="VAT" taxRate="20">
<grossAmount>45</grossAmount>
<taxAmount>7.5</taxAmount>
</amountByTax>
</amountsByTax>
<totalAmount>140</totalAmount>
<totalTaxAmount>18.1</totalTaxAmount>
</shoppingCart>
Redirect Integration (PXP Financial Checkout)
The following chapter is relevant only for merchants that are using the PXP Financial Redirect integration (Checkout).
Redirection to Selection or Detail Page
Depending on the Checkout integration model of the merchant, there are two options how to redirect the customer to the PXP Financial checkout:
- Selection page: customer selects the payment method in the PXP Financial Checkout selection page
- Detail page: merchant redirects the customer directly to the Klarna Detail page of the PXP Financial Checkout (customer has preselected the Klarna payment method on the merchant checkout page).
To redirect the customer directly to the PXP Financial Checkout Detail Page of Klarna Deposit payment method, the following payment method has to be provided in the getRedirectData request:
ID | Name |
---|---|
369 | Klarna Deposit |
As explained in the chapter above Additionally required Data for Klarna Deposit to create a successful Klarna Deposit, some usually optional data is mandatory in the PXP Financial getRedirectData API.
Specifically for merchants using the Checkout/Redirect Integration, the following parameters have to be provided in addition to the ones described above in the getRedirectData call:
Field | Value |
---|---|
redirectParameters.languageCode (string, required) | Defines the language of the PXP Financial Checkout pages and also the language of the Klarna checkout pages. |
redirectParameters.countryCode (string, required) | This parameter has two purposes for Klarna Deposit: Defines the browser culture together with the languageCode for the PXP Financial Checkout pages and also the language of the Klarna checkout pages. It also defines the purchase country of the customer which is used by Klarna to identify which payment methods they offer. See Supported Countries and currencies for information which countries are supported by Klarna and PXP Financial. Note: if the value provided for countryCode is different from the value provided in field redirectParameters.user.address.countryCode2 (interpreted as billing address country code), the billing address country code will be considered as purchase-country by Klarna. |
redirectParameters.additionalDetails.Description | Optional. Used by Klarna for storing merchant's internal order number or other reference. If set, will be shown on the Klarna confirmation page as "order number" and send to the customer in the confirmation mail after a successful direct bank transfer payment. It will also be included in the payments description in the customer's bank account (max 255 characters) when Klarna deducts the money. Additionally this is used and displayed to the customer in the PXP Financial Checkout pages Header line. See Design a Merchant Custom Skin for more information. |
Example getRedirectData request for payment method "Klarna Deposit", redirection to the Detail page:
<getRedirectDataRequest xmlns="http://www.cqrpayments.com/PaymentProcessing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<merchantID>KalixaAcceptDEMO</merchantID>
<redirectParameters xsi:type="paymentMethodDetailsRedirectParameters">
<shopID>KalixaAcceptDEMO</shopID>
<httpMethod>GET</httpMethod>
<returnUrl>http://return</returnUrl>
<languageCode>en</languageCode>
<currencyCode>sek</currencyCode>
<countryCode>se</countryCode>
<additionalDetails>
<detail xsi:type="keyStringValuePair">
<key>Description</key>
<value>merchant_reference1</value>
</detail>
<!--required-->
<detail xsi:type="keyStringValuePair">
<key>MerchantNotificationURL</key>
<value>http://google.com/confirmation</value>
</detail>
<!-- Shipping address begins -->
<detail xsi:type="keyStringValuePair">
<key>shippingName</key>
<value>John Watson</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingFirstName</key>
<value>John</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingLastName</key>
<value>Watson</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingStreet</key>
<value>Hagagatan</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingHouseNumber</key>
<value>5</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingCity</key>
<value>Stockholm</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingPostalCode</key>
<value>113 49</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingCountryCode2</key>
<value>se</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingTelephoneNumber</key>
<value>00466667788999</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingEmail</key>
<value>[email protected]</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingDeliveryType</key>
<value>CollectionPoint</value>
</detail>
<!-- Shipping address ends -->
</additionalDetails>
<shoppingCart>
<items>
<item>
<product>
<id>123</id>
<name>Jeans</name>
<description>stonewashed</description>
<unitPrice>
<grossAmount>40</grossAmount>
<taxAmount rate="20" name="VAT">6.67</taxAmount>
</unitPrice>
<type>Physical</type>
</product>
<quantity>1</quantity>
<totalPrice>
<grossAmount>30</grossAmount>
<taxAmount rate="20" name="VAT">5</taxAmount>
</totalPrice>
<discount>
<name>Jeans-Promotion</name>
<grossAmount>-10</grossAmount>
<taxAmount rate="20" name="VAT">-1.67</taxAmount>
</discount>
</item>
<item>
<product>
<id>456</id>
<name>CD Rom</name>
<description>CD Rom</description>
<unitPrice>
<grossAmount>50</grossAmount>
<taxAmount rate="10" name="VAT">4.54</taxAmount>
</unitPrice>
<type>Digital</type>
</product>
<quantity>2</quantity>
<totalPrice>
<grossAmount>80</grossAmount>
<taxAmount rate="10" name="MwSt">7.27</taxAmount>
</totalPrice>
<discount>
<name>Spring-Promotion</name>
<grossAmount>-20</grossAmount>
<taxAmount rate="10" name="VAT">-1.82</taxAmount>
</discount>
</item>
<item>
<product>
<id>789</id>
<name>Gift Card</name>
<description>Gift Card Purchase</description>
<unitPrice>
<grossAmount>15</grossAmount>
<taxAmount rate="20" name="VAT">2.5</taxAmount>
</unitPrice>
<type>GiftCard</type>
</product>
<quantity>1</quantity>
<totalPrice>
<grossAmount>15</grossAmount>
<taxAmount rate="20" name="VAT">2.5</taxAmount>
</totalPrice>
</item>
</items>
<subTotalAmount>125</subTotalAmount>
<shippingCost>
<name>Express</name>
<grossAmount>30</grossAmount>
<taxAmount rate="20" name="VAT">5</taxAmount>
</shippingCost>
<discounts>
<discount>
<name>Sales-Discount</name>
<grossAmount>-10</grossAmount>
<taxAmount rate="20" name="VAT">-1.67</taxAmount>
<type>Discount</type>
</discount>
</discounts>
<amountsByTax>
<amountByTax taxName="VAT" taxRate="10">
<grossAmount>80</grossAmount>
<taxAmount>7.27</taxAmount>
</amountByTax>
<amountByTax taxName="VAT" taxRate="20">
<grossAmount>45</grossAmount>
<taxAmount>7.5</taxAmount>
</amountByTax>
</amountsByTax>
<totalAmount>145</totalAmount>
<totalTaxAmount>18.1</totalTaxAmount>
</shoppingCart>
<user>
<id>hcKlarnaSE_20200721_1539</id>
<username>hcKlarnaSE_20200721_1539</username>
<firstname>Ho Chunka</firstname>
<lastname>Ko</lastname>
<currencyCode>sek</currencyCode>
<languageCode>EN</languageCode>
<email>[email protected]</email>
<address>
<street>Roslagsgatan</street>
<houseNumber>10</houseNumber>
<postalCode>113 51</postalCode>
<city>Stockholm</city>
<countryCode2>SE</countryCode2>
<telephoneNumber>004691023365</telephoneNumber>
</address>
<dateOfBirth>1985-10-10T00:00:00</dateOfBirth>
<gender>Female</gender>
<identificationNumber>960807-2121</identificationNumber>
<identificationNumberType>NationalIdentificationNumber</identificationNumberType>
</user>
<merchantTransactionID>hc-checkout-20200721-1539</merchantTransactionID>
<grossAmount>110.00</grossAmount>
<expirationTimeSpanInSeconds>3600</expirationTimeSpanInSeconds>
<successUrl>http://success</successUrl>
<pendingUrl>http://pending</pendingUrl>
<errorUrl>http://error</errorUrl>
<cancelUrl>http://cancel</cancelUrl>
<refusedUrl>http://refused</refusedUrl>
<paymentMethodID>369</paymentMethodID>
<isPaymentMethodChangeAllowed>false</isPaymentMethodChangeAllowed>
</redirectParameters>
</getRedirectDataRequest>
Example getRedirectData request for payment method "Klarna Deposit", redirection to the Selection page:
<getRedirectDataRequest xmlns="http://www.cqrpayments.com/PaymentProcessing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<merchantID>KalixaAcceptDEMO</merchantID>
<redirectParameters xsi:type="paymentMethodSelectionWithDetailsRedirectParameters">
<shopID>KalixaAcceptDEMO</shopID>
<httpMethod>GET</httpMethod>
<returnUrl>http://return</returnUrl>
<languageCode>en</languageCode>
<currencyCode>sek</currencyCode>
<countryCode>se</countryCode>
<additionalDetails>
<detail xsi:type="keyStringValuePair">
<key>Description</key>
<value>merchant_reference1</value>
</detail>
<!--required-->
<detail xsi:type="keyStringValuePair">
<key>MerchantNotificationURL</key>
<value>http://google.com/confirmation</value>
</detail>
<!-- Shipping address begins -->
<detail xsi:type="keyStringValuePair">
<key>shippingName</key>
<value>John Watson</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingFirstName</key>
<value>John</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingLastName</key>
<value>Watson</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingStreet</key>
<value>Hagagatan</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingHouseNumber</key>
<value>5</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingCity</key>
<value>Stockholm</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingPostalCode</key>
<value>113 49</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingCountryCode2</key>
<value>se</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingTelephoneNumber</key>
<value>00466667788999</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingEmail</key>
<value>[email protected]</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>shippingDeliveryType</key>
<value>CollectionPoint</value>
</detail>
<!-- Shipping address ends -->
</additionalDetails>
<shoppingCart>
<items>
<item>
<product>
<id>123</id>
<name>Jeans</name>
<description>stonewashed</description>
<unitPrice>
<grossAmount>40</grossAmount>
<taxAmount rate="20" name="VAT">6.67</taxAmount>
</unitPrice>
<type>Physical</type>
</product>
<quantity>1</quantity>
<totalPrice>
<grossAmount>30</grossAmount>
<taxAmount rate="20" name="VAT">5</taxAmount>
</totalPrice>
<discount>
<name>Jeans-Promotion</name>
<grossAmount>-10</grossAmount>
<taxAmount rate="20" name="VAT">-1.67</taxAmount>
</discount>
</item>
<item>
<product>
<id>456</id>
<name>CD Rom</name>
<description>CD Rom</description>
<unitPrice>
<grossAmount>50</grossAmount>
<taxAmount rate="10" name="VAT">4.54</taxAmount>
</unitPrice>
<type>Digital</type>
</product>
<quantity>2</quantity>
<totalPrice>
<grossAmount>80</grossAmount>
<taxAmount rate="10" name="MwSt">7.27</taxAmount>
</totalPrice>
<discount>
<name>Spring-Promotion</name>
<grossAmount>-20</grossAmount>
<taxAmount rate="10" name="VAT">-1.82</taxAmount>
</discount>
</item>
<item>
<product>
<id>789</id>
<name>Gift Card</name>
<description>Gift Card Purchase</description>
<unitPrice>
<grossAmount>15</grossAmount>
<taxAmount rate="20" name="VAT">2.5</taxAmount>
</unitPrice>
<type>GiftCard</type>
</product>
<quantity>1</quantity>
<totalPrice>
<grossAmount>15</grossAmount>
<taxAmount rate="20" name="VAT">2.5</taxAmount>
</totalPrice>
</item>
</items>
<subTotalAmount>125</subTotalAmount>
<shippingCost>
<name>Express</name>
<grossAmount>30</grossAmount>
<taxAmount rate="20" name="VAT">5</taxAmount>
</shippingCost>
<discounts>
<discount>
<name>Sales-Discount</name>
<grossAmount>-10</grossAmount>
<taxAmount rate="20" name="VAT">-1.67</taxAmount>
<type>Discount</type>
</discount>
</discounts>
<amountsByTax>
<amountByTax taxName="VAT" taxRate="10">
<grossAmount>80</grossAmount>
<taxAmount>7.27</taxAmount>
</amountByTax>
<amountByTax taxName="VAT" taxRate="20">
<grossAmount>45</grossAmount>
<taxAmount>7.5</taxAmount>
</amountByTax>
</amountsByTax>
<totalAmount>145</totalAmount>
<totalTaxAmount>18.1</totalTaxAmount>
</shoppingCart>
<user>
<id>hcKlarnaSE_20200721_1327</id>
<username>hcKlarnaSE_20200721_1327</username>
<firstname>Ho Chunka</firstname>
<lastname>Ko</lastname>
<currencyCode>sek</currencyCode>
<languageCode>EN</languageCode>
<email>[email protected]</email>
<address>
<street>Roslagsgatan</street>
<houseName>MyHouseName</houseName>
<houseNumber>10</houseNumber>
<postalCode>113 51</postalCode>
<city>Stockholm</city>
<countryCode2>SE</countryCode2>
<telephoneNumber>004691023365</telephoneNumber>
</address>
<dateOfBirth>1985-10-10T00:00:00</dateOfBirth>
<gender>Female</gender>
<identificationNumber>960807-2121</identificationNumber>
<identificationNumberType>NationalIdentificationNumber</identificationNumberType>
</user>
<merchantTransactionID>hc-checkout-20200721-1327</merchantTransactionID>
<grossAmount>110.00</grossAmount>
<expirationTimeSpanInSeconds>3600</expirationTimeSpanInSeconds>
<successUrl>http://success</successUrl>
<pendingUrl>http://pending</pendingUrl>
<errorUrl>http://error</errorUrl>
<cancelUrl>http://cancel</cancelUrl>
<refusedUrl>http://refused</refusedUrl>
<paymentDirection>Deposit</paymentDirection>
</redirectParameters>
</getRedirectDataRequest>
Customer performs the payment in the PXP Financial Checkout page
After the customer was redirected to the PXP Financial Checkout page (and has selected the Klarna payment option), the available Klarna payment categories and methods will be displayed to the customer. The customer selects one, enters the details and confirms the payment.
Example Screenshot of the PXP Financial Checkout detail page for a Klarna Deposit payment:
Example Screenshots of the PXP Financial Checkout detail page for each Klarna Deposit payment option:
When the customer has confirmed the payment, the PXP system contacts the Klarna system and if applicable the customer is asked for additional data (e.g. the date of birth).
Example Screenshot of a Klarna Pop-up in PXP Financial Checkout:
Redirection back to merchant and notifications
Now, Klarna applies their risk checks and decides if the payment will be approved or refused.
- If approved, the customer is redirected to the merchants successURL.
- If declined/refused, the customer is redirected to the merchants errorURL.
Additionally a backend notification is sent to the merchant. This notification contains the following relevant information:
Field | Value |
---|---|
paymentMethod | The final PXP Financial Klarna payment method which was applied as selected by the customer. Possible Values: - Klarna Pay Now (370) - Klarna Pay Later (371) - Klarna Financing (372) |
paymentID | The ID of the payment in PXP Financial Payment Service. Needs to be stored in the merchant system and used for follow up payments like Captures and Refunds. |
state.definition | Successful State: ExecutedByProvider (142) Refused/Unsuccessful State: RefusedByProvider (100) Other possible Error States which can happen. If a merchant wants those to be notified, this has to be requested via the Account Manager: DuplicatePaymentValidationFailed - 369 RefusedByPaymentScoring - 121 InitiateRequestProviderCommunicationErrorOccurred - 325 InitiateErrorReportedByProvider - 4 ProviderResponseValidationFailed - 409 ExecuteErrorReportedByProvider - 143 ExecuteRequestSentToProviderCommunicationErrorOccured - 339 |
The Klarna Deposit payment is now successfully authorised by Klarna and has to be captured (or cancelled) by the merchant later. Further chapters of interest:
- Capture a Klarna Payment
- Refund a Klarna Payment
- Update a Klarna Payment
- Cancel/Revert a Klarna Payment
Checkout Error Handling
In case the merchant has activated the PXP Financial Checkout error handling feature, the customer will not be redirected to the Merchant-Error-URL in case Klarna refuses the payment but remain on PXP Checkout and can pick a different payment option to complete the payment.
Backend2Backend Integration
The following chapter is relevant only for merchants that are using the backend2backend integration (direct integration).
Get information to load the widget
The following payment method ID has to be used when initiating a Klarna Deposit:
ID | Name | Credit State |
---|---|---|
369 | Klarna Deposit | InitiatedByProvider(tbd) |
To initiate a successful Klarna payments, additional parameters in the PXP Financial initiatePayment API are mandatory. They are documented here Additionally required Data for Klarna Deposit
Specifically for merchants using the backend2backend Integration, the following parameters have to be provided in addition to the ones described above in the initiatePayment call:
Field | Value |
---|---|
specificPaymentData.CultureInfo (string, required) | RFC 1766 customer's locale. Culture info should be in the format of ex: fr_BE Used to display the content of the Klarna payment pages in the regarding language. See Supported Countries and currencies for information which locales are supported by Klarna and PXP Financial. Note: if the locale is not recognized, English languages is used by default. |
specificPaymentData.PaymentCountryCode (string, required) | It defines the purchase country of the customer which is used by Klarna to identify which payment methods they offer. See Supported Countries and currencies for information which countries are supported by Klarna and PXP Financial. Note: if the value provided for PaymentCountryCode is different from the value provided in field userData.address.countryCode2 (interpreted as billing address country code), the billing address country code will be considered as purchase-country by Klarna. |
MerchantNotificationUrl (string, required) OR - tbd byMiha RedirectUrl (string, required) | The URL to redirect user to merchant in case of Success/Cancel/Error |
specificPaymentData.PaymentDescription (string) | Optional. Used by Klarna for storing merchant's internal order number or other reference. If set, will be shown on the Klarna confirmation page as "order number" and send to the customer in the confirmation mail after a successful direct bank transfer payment. It will also be included in the payments description in the customer's bank account (max 255 characters) when Klarna deducts the money. |
Example initiatePaymentRequest for a Successful Payment
<initiatePaymentRequest xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<merchantID>KalixaAcceptDEMO</merchantID>
<shopID>KalixaAcceptDEMO</shopID>
<merchantTransactionID>hc-b2b-20200721-1511</merchantTransactionID>
<paymentMethodID>369</paymentMethodID>
<amount currencyCode="sek">110.00</amount>
<userID>hkoKlarnaSESEK_1</userID>
<userData>
<username>hkoKlarnaSESEK_1</username>
<firstname>Ho Chunka</firstname>
<lastname >Ko</lastname>
<currencyCode>SEK</currencyCode>
<email>[email protected]</email>
<address>
<street>Roslagsgatan</street>
<houseName>MyHouseName</houseName>
<houseNumber>10</houseNumber>
<postalCode>113 51</postalCode>
<city>Stockholm</city>
<countryCode2>SE</countryCode2>
<telephoneNumber>004691023365</telephoneNumber>
</address>
<dateOfBirth>1985-10-10T00:00:00</dateOfBirth>
<gender>Female</gender>
<identificationNumber>960807-2121</identificationNumber>
<identificationNumberType>NationalIdentificationNumber</identificationNumberType>
</userData>
<userIP>10.10.10.10</userIP>
<userSessionID>abc-9</userSessionID>
<creationTypeID>1</creationTypeID>
<shippingDetails>
<name>John H. Watson</name>
<address>
<street>Hagagatan</street>
<houseNumber>5</houseNumber>
<postalCode>113 49</postalCode>
<city>Stockholm</city>
<countryCode2>SE</countryCode2>
<telephoneNumber>00466667788999</telephoneNumber>
</address>
<firstname>John H.</firstname>
<lastname>Watson</lastname>
<email>[email protected]</email>
</shippingDetails>
<specificPaymentData>
<data xsi:type="keyStringValuePair">
<key>successpageurl</key>
<value>https://at.apobag.cloud/de/kalixa/success?token=10fe14da05801ac13a0df599b269112b&merchanttransactionid=kalixa591954b6e877c&am=3020</value>
</data>
<data xsi:type="keyStringValuePair">
<key>errorpageurl</key>
<value>https://at.apobag.cloud/de/kalixa/error?merchanttransactionid=kalixa591954b6e877c</value>
</data>
<data xsi:type="keyStringValuePair">
<key>pendingpageurl</key>
<value>https://at.apobag.cloud/de/kalixa/pending?token=10fe14da05801ac13a0df599b269112b&merchanttransactionid=kalixa591954b6e877c</value>
</data>
<data xsi:type="keyStringValuePair">
<key>cancelpageurl</key>
<value>https://at.apobag.cloud/de/kalixa/cancel?merchanttransactionid=kalixa591954b6e877c</value>
</data>
<data xsi:type="keyStringValuePair">
<key>PaymentDescription</key>
<value>Merchant_reference1</value>
</data>
<data xsi:type="keyStringValuePair">
<key>CultureInfo</key>
<value>en-SE</value>
</data>
<!-- New field -->
<data xsi:type="keyStringValuePair">
<key>PaymentCountryCode</key>
<value>SE</value>
</data>
<!-- Try to use existing field -->
<data xsi:type="keyStringValuePair">
<key>PaymentDescriptionLanguageCode</key>
<value>en</value>
</data>
<data xsi:type="keyStringValuePair">
<key>MerchantNotificationURL</key>
<value>https://cashier.kalixa.com/listenerURL</value>
</data>
</specificPaymentData>
<shoppingCart>
<items>
<item>
<product>
<id>123456</id>
<name>Jeans</name>
<description>stonewashed</description>
<unitPrice>
<grossAmount>30</grossAmount>
<taxAmount rate="20" name="VAT">5.00</taxAmount>
</unitPrice>
</product>
<quantity>1</quantity>
<totalPrice>
<grossAmount>15</grossAmount>
<taxAmount rate="20" name="VAT">2.5</taxAmount>
</totalPrice>
<discount>
<name>Jeans-Promotion</name>
<grossAmount>-15</grossAmount>
<taxAmount rate="20" name="VAT">-2.50</taxAmount>
</discount>
</item>
<item>
<product>
<id>456</id>
<name>Skirt</name>
<description>Flowers Design</description>
<unitPrice>
<grossAmount>40</grossAmount>
<taxAmount rate="10" name="VAT">3.64</taxAmount>
</unitPrice>
</product>
<quantity>2</quantity>
<totalPrice>
<grossAmount>75</grossAmount>
<taxAmount rate="10" name="VAT">6.82</taxAmount>
</totalPrice>
<discount>
<name>Spring-Promotion</name>
<grossAmount>-5</grossAmount>
<taxAmount rate="10" name="VAT">-0.45</taxAmount>
</discount>
</item>
</items>
<subTotalAmount>90</subTotalAmount>
<shippingCost>
<name>Express</name>
<grossAmount>30</grossAmount>
<taxAmount rate="20" name="VAT">5</taxAmount>
</shippingCost>
<discounts>
<discount>
<name>Sommer Sales-Discount</name>
<grossAmount>-10</grossAmount>
<taxAmount rate="20" name="VAT">-1.67</taxAmount>
</discount>
</discounts>
<amountsByTax>
<amountByTax taxName="VAT" taxRate="10">
<grossAmount>75</grossAmount>
<taxAmount>6.82</taxAmount>
</amountByTax>
<amountByTax taxName="VAT" taxRate="20">
<grossAmount>35</grossAmount>
<taxAmount>5.83</taxAmount>
</amountByTax>
</amountsByTax>
<totalAmount>110</totalAmount>
<totalTaxAmount>12.65</totalTaxAmount>
</shoppingCart>
</initiatePaymentRequest>
Example initiatePaymentResponse:
<initiatePaymentResponse xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<payment xsi:type="paymentWithPaymentAccount">
<merchantID>KalixaAcceptDEMO</merchantID>
<shopID>KalixaAcceptDEMO</shopID>
<paymentMethod>
<key>369</key>
<value>KlarnaDeposit</value>
</paymentMethod>
<merchantTransactionID>hc-b2b-20200721-1511</merchantTransactionID>
<paymentID>2d4c371e-2288-47d6-a035-7278f115b7c8</paymentID>
<userID>hkoKlarnaSESEK_1</userID>
<paymentProvider>
<key>189</key>
<value>Klarna</value>
</paymentProvider>
<amount currencyCode="SEK">110.00</amount>
<creationType>
<key>1</key>
<value>User</value>
</creationType>
<userIP>10.10.10.10</userIP>
<state>
<id>2632bf24-519e-4bb9-9e00-8192de5181f4</id>
<definition>
<key>3</key>
<value>InitiatedByProvider</value>
</definition>
<createdOn>2020-07-21T13:12:52.6135422Z</createdOn>
<paymentStateDetails>
<detail xsi:type="keyStringValuePair">
<key>ProviderToken</key>
<value>eyJhbGciOiJSUzI1NiIsImtpZCI6IjgyMzA1ZWJjLWI4MTEtMzYzNy1hYTRjLTY2ZWNhMTg3NGYzZCJ9.ewogICJzZXNzaW9uX2lkIiA6ICIzZGE3NjIyYy1mOTFhLTI4M2UtOWE1Yy1jMTdlMGE3OTRjMTgiLAogICJiYXNlX3VybCIgOiAiaHR0cHM6Ly9rbGFybmEtcGF5bWVudHMtZXUucGxheWdyb3VuZC5rbGFybmEuY29tL3BheW1lbnRzIiwKICAiZGVzaWduIiA6ICJrbGFybmEiLAogICJsYW5ndWFnZSIgOiAiZW4iLAogICJwdXJjaGFzZV9jb3VudHJ5IiA6ICJTRSIsCiAgInRyYWNlX2Zsb3ciIDogZmFsc2UsCiAgImVudmlyb25tZW50IiA6ICJwbGF5Z3JvdW5kIiwKICAibWVyY2hhbnRfbmFtZSIgOiAiUGxheWdyb3VuZCBEZW1vIE1lcmNoYW50IiwKICAic2Vzc2lvbl90eXBlIiA6ICJQQVlNRU5UUyIsCiAgImNsaWVudF9ldmVudF9iYXNlX3VybCIgOiAiaHR0cHM6Ly9ldS5wbGF5Z3JvdW5kLmtsYXJuYWV2dC5jb20iLAogICJleHBlcmltZW50cyIgOiBbIHsKICAgICJuYW1lIiA6ICJpbi1hcHAtc2RrLWNhcmQtc2Nhbm5pbmciLAogICAgInBhcmFtZXRlcnMiIDogewogICAgICAidmFyaWF0ZV9pZCIgOiAiY2FyZC1zY2FubmluZy1lbmFibGUiCiAgICB9CiAgfSBdCn0.V74Ns02NJC4lH8GWPy3d08SPG0dBgB9-NxX1eDM5q3A6AyUfqQ79EyoU3bMxukpy0BJnUrV-NqSxTvuC_mtNc-LvZTJCaV8gw3AX7o0KPR7ziyGWutPAAGE1jhyPqq1XUd2X6j8ZTQ2ZLI0jCAJpvuws6hHkBBeNAWgbGqEOcVzxHVk1tgPInRrp0UMxfGn12MRLrB52PYlEi4tCAcRm9ptJAKNQdoLsTJ_PK6AgotYmiNDk0i9_YkzEytBsUzFoVjki7PMGriWOVJQ5GmqdcfJp0PwYm8zWKfyokG1G5Gv_zzR2dbh2zU_FUMcoPMgHbGb_4Thz-veWMg43hRWMwQ</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>ProviderSessionID</key>
<value>3da7622c-f91a-283e-9a5c-c17e0a794c18</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>ProviderAdditionalResponseData</key>
<value>[ { "identifier": "pay_over_time", "name": "Slice it.", "asset_urls": { "descriptive": "https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg", "standard": "https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg" } }, { "identifier": "pay_later", "name": "Pay later.", "asset_urls": { "descriptive": "https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg", "standard": "https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg" } }, { "identifier": "pay_now", "name": "Direct payment", "asset_urls": { "descriptive": "https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg", "standard": "https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg" } }]</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>PaymentStateReasonID</key>
<value>1</value>
</detail>
</paymentStateDetails>
</state>
<isExecuted>false</isExecuted>
<baseAmount currencyCode="EUR">11.85</baseAmount>
<paymentDetails></paymentDetails>
<paymentAccount>
<paymentAccountID>0</paymentAccountID>
</paymentAccount>
</payment>
</initiatePaymentResponse>
The following data is returned in the initiatePaymentResponse:
Field | Value |
---|---|
paymentID | The ID of the payment in the PXP Financial Payment Service. Should be stored by the merchant and used for future actions on this payment. |
state.definition | Must be equal to InitiatedByProvider (3) for a successful payment initiation. |
paymentStateDetails.ProviderToken | Should be used as client_token when initializing the JavaScript SDK from Klarna.See Information how to Present the Klarna Widget |
paymentStateDetails.ProviderSessionID | Can be used as session_id to update the session using the Klarna REST API.See Information how to Present the Klarna Widget |
paymentStateDetails.ProviderAdditionalResponseData | Contains the available Klarna payment_method_categories andrepresents what categories of payment methods that are available for this purchase. The payment_method_category is required when loading the Klarna widget.See Information how to Present the Klarna Widget |
Present the Klarna Widget
Using the information returned in the initiatePaymentResponse, the merchant now has to load the Klarna widget in the browser.
More information can be found in the Klarna documentation:
Authorise and Finalize the Order
When the consumer has chosen a payment method and wants to complete the purchase, the merchant has to use Klarnas Javascript SDK to authorize the order.
More information can be found on Klarnas developer site: Authorise
If Klarna returns finalize_required: true
, it also has to be finalized after it was authorised.
More information can be found on Klarnas developer site: Finalize
If Klarna returns approved: true
, then Klarna has approved the authorization and also returns an authorization_token
. This was the last step that the merchant has to do using Klarnas Javascript SDK.
The merchant can continue with the next step ("Confirm the payment") which is done against the PXP Financial System.
Confirm the payment
As a last step the Klarna payment needs to be confirmed with PXP Financial by using the executePaymentAction with actionID
= 95030
(ExecutePayment).
The following parameters are mandatory have to be provided as well in the executePaymentAction call:
Field | Value |
---|---|
actionData.AuthorizationToken | The authorization_token which was received from Klarna in the authorisation/finalization response. |
Example execute order request with token:
<executePaymentActionRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.cqrpayments.com/PaymentProcessing">
<merchantID>KalixaAcceptDEMO</merchantID>
<shopID>KalixaAcceptDEMO</shopID>
<paymentID>2d4c371e-2288-47d6-a035-7278f115b7c8</paymentID>
<actionID>95030</actionID>
<actionData>
<data xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="q1:keyStringValuePair">
<key>AuthorizationToken</key>
<value>43a8d3fd-52d2-2858-a573-2b6cbccce627</value>
</data>
</actionData>
</executePaymentActionRequest>
Example execute order response:
<executePaymentActionResponse xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<statusCode>0</statusCode>
<actionResults>
<result xsi:type="keyStringValuePair">
<key>lastStateDefinition</key>
<value>142</value>
</result>
<result xsi:type="keyStringValuePair">
<key>ShippingName</key>
<value>John H. Watson</value>
</result>
<result xsi:type="keyStringValuePair">
<key>ShippingStreet</key>
<value>Hagagatan</value>
</result>
<result xsi:type="keyStringValuePair">
<key>ShippingCity</key>
<value>Stockholm</value>
</result>
<result xsi:type="keyStringValuePair">
<key>ShippingPostalCode</key>
<value>113 49</value>
</result>
<result xsi:type="keyStringValuePair">
<key>ShippingCountryCode2</key>
<value>SE</value>
</result>
<result xsi:type="keyStringValuePair">
<key>ShippingTelephoneNumber</key>
<value>00466667788999</value>
</result>
<result xsi:type="keyStringValuePair">
<key>ProviderResponseCode</key>
<value>ACCEPTED</value>
</result>
<result xsi:type="keyIntValuePair">
<key>PaymentProviderID</key>
<value>189</value>
</result>
</actionResults>
</executePaymentActionResponse>
The following relevant data is returned in the executePaymentActionResponse:
Field | Value |
---|---|
lastStateDefinition | Successful payment: 142 (ExecutedByProvider) Error or unsuccessful payment: Any other state |
Final Payment Method
After the payment was confirmed with/accepted by Klarna, the payment method is changed to reflect the "real" (final) payment method in the PXP Financial Payment Service - depending on the customers choice.
This means, the initial payment method used for initiating the payment (Klarna Deposit, 369) is changed to the final method.
The table below shows which Klarna methods are mapped to which PXP Financial payment methods:
PXP Financial Payment Method | Klarna Payment Method |
---|---|
Klarna Pay Now Deposit (370) | Pay Now - Pay with direct debit ( direct_debit )- Pay with online bank transfer ( direct_bank_transfer ) = "Sofort" ("Sofortüberweisung") |
Klarna Pay Later Deposit (371) | Pay Later - Invoice (Pay in 14 or 30 days) ( invoice )- Business-to-Business orders ( b2b_invoice )- Pay in X days ( pix ) |
Klarna Financing Deposit (372) | Pay Over Time = Financing - Fixed amounts over 3-36 months (periods vary by market) ( fixed_amount )- 3 or 4 equal instalments paid via card, no consumer fee or interest ( slice_it_by_card ) (US+UK specific)- Account with minimum amount payable each month ( base_account )- ( deferred_interest ) (US specific)- ( fixed_sum_credit ) |
Notifications
The standard notification mechanism is used for notifying the merchant in the background (asynchronously) about payment state changes. For more information see PaymentStateChangedNotification.
The final execution status has the following payment states:
Payment State | Description |
---|---|
ExecutedByProvider (142) | Success state; payment has been executed. |
RefusedByProvider (100) | Error state; payment was not accepted by provider. |
Example handlePaymentStateChangedNotificationRequest for a successful Klarna payment:
<?xml version="1.0" encoding="utf-8"?>
<handlePaymentStateChangedNotificationRequest
xmlns="http://www.cqrpayments.com/PaymentProcessing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<payment xsi:type="paymentWithState">
<merchantID>KalixaAcceptDEMO</merchantID>
<shopID>KalixaAcceptDEMO</shopID>
<paymentMethod>
<key>370</key>
<value>KlarnaPayNowDeposit</value>
</paymentMethod>
<merchantTransactionID>35e50c3-d5db-e74d-e6f9-d00b019fb3</merchantTransactionID>
<paymentID>1011d6fe-80ab-4aed-bbed-3f35d4ba901e</paymentID>
<userID>KalixaTestUser_3</userID>
<paymentProvider>
<key>189</key>
<value>Klarna</value>
</paymentProvider>
<amount currencyCode="EUR">15.0000</amount>
<creationType>
<key>1</key>
<value>User</value>
</creationType>
<userIP>10.80.12.38</userIP>
<state>
<id>97965dd7-90546-4b83-aea2-769b7cfghh2df</id>
<definition>
<key>142</key>
<value>ExecutedByProvider</value>
</definition>
<createdOn>2009-05-25T12:30:12.167</createdOn>
<paymentStateDetails>
<detail xsi:type="keyStringValuePair">
<key>ProviderResponseCode</key>
<value>ACCEPTED</value>
</detail>
<detail xsi:type="keyStringValuePair">
<key>AuthorizedPaymentMethod</key>
<value>card</value>
</detail>
</paymentStateDetails>
</state>
<isExecuted>true</isExecuted>
<baseAmount currencyCode="EUR">15.0000</baseAmount>
<paymentDetails>
<detail xsi:type="keyStringValuePair">
<key>ProviderExternalID</key>
<value>32607963</value>
</detail>
</paymentDetails>
</payment>
</handlePaymentStateChangedNotificationRequest>
Errors
PXP Financial Payment Service will return a paymentServiceException message in case an unexpected error occurs when initiating a Klarna Deposit payment.
Generic Error Codes
Find here more information about Error Handling and generic error codes.
Sample Requests
Scenario: unsuccessful payment (backend2backend integration):
Example of an unsuccessful initiatePayment request (due to invalid total_tax_amount)
<initiatePaymentRequest xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<merchantID>KalixaAcceptDEMO</merchantID>
<shopID>KalixaAcceptDEMO</shopID>
<merchantTransactionID>hc-b2b-20200721-1319</merchantTransactionID>
<paymentMethodID>369</paymentMethodID>
<amount currencyCode="sek">120.00</amount>
<userID>hkoKlarnaSESEK_1</userID>
<userData>
<username>hkoKlarnaSESEK_1</username>
<firstname>Ho Chunka</firstname>
<lastname >Ko</lastname>
<currencyCode>SEK</currencyCode>
<email>[email protected]</email>
<address>
<street>Roslagsgatan</street>
<houseName>MyHouseName</houseName>
<houseNumber>10</houseNumber>
<postalCode>113 51</postalCode>
<city>Stockholm</city>
<countryCode2>SE</countryCode2>
<telephoneNumber>004691023365</telephoneNumber>
</address>
<dateOfBirth>1985-10-10T00:00:00</dateOfBirth>
<gender>Female</gender>
<identificationNumber>960807-2121</identificationNumber>
<identificationNumberType>NationalIdentificationNumber</identificationNumberType>
</userData>
<userIP>10.10.10.10</userIP>
<userSessionID>abc-9</userSessionID>
<creationTypeID>1</creationTypeID>
<shippingDetails>
<name>John H. Watson</name>
<address>
<street>Hagagatan</street>
<houseNumber>5</houseNumber>
<postalCode>113 49</postalCode>
<city>Stockholm</city>
<countryCode2>SE</countryCode2>
<telephoneNumber>00466667788999</telephoneNumber>
</address>
<firstname>John H.</firstname>
<lastname>Watson</lastname>
<email>[email protected]</email>
</shippingDetails>
<specificPaymentData>
<data xsi:type="keyStringValuePair">
<key>successpageurl</key>
<value>https://at.apobag.cloud/de/kalixa/success?token=10fe14da05801ac13a0df599b269112b&merchanttransactionid=kalixa591954b6e877c&am=3020</value>
</data>
<data xsi:type="keyStringValuePair">
<key>errorpageurl</key>
<value>https://at.apobag.cloud/de/kalixa/error?merchanttransactionid=kalixa591954b6e877c</value>
</data>
<data xsi:type="keyStringValuePair">
<key>pendingpageurl</key>
<value>https://at.apobag.cloud/de/kalixa/pending?token=10fe14da05801ac13a0df599b269112b&merchanttransactionid=kalixa591954b6e877c</value>
</data>
<data xsi:type="keyStringValuePair">
<key>cancelpageurl</key>
<value>https://at.apobag.cloud/de/kalixa/cancel?merchanttransactionid=kalixa591954b6e877c</value>
</data>
<data xsi:type="keyStringValuePair">
<key>PaymentDescription</key>
<value>Merchant_reference1</value>
</data>
<data xsi:type="keyStringValuePair">
<key>CultureInfo</key>
<value>en-SE</value>
</data>
<!-- New field -->
<data xsi:type="keyStringValuePair">
<key>PaymentCountryCode</key>
<value>SE</value>
</data>
<!-- Try to use existing field -->
<data xsi:type="keyStringValuePair">
<key>PaymentDescriptionLanguageCode</key>
<value>en</value>
</data>
<data xsi:type="keyStringValuePair">
<key>MerchantNotificationURL</key>
<value>https://cashier.kalixa.com/listenerURL</value>
</data>
</specificPaymentData>
<shoppingCart>
<items>
<item>
<product>
<id>123456</id>
<name>Jeans</name>
<description>stonewashed</description>
<unitPrice>
<grossAmount>30</grossAmount>
<taxAmount rate="20" name="VAT">5.00</taxAmount>
</unitPrice>
</product>
<quantity>1</quantity>
<totalPrice>
<grossAmount>15</grossAmount>
<taxAmount rate="20" name="VAT">2.5</taxAmount>
</totalPrice>
<discount>
<name>Jeans-Promotion</name>
<grossAmount>-15</grossAmount>
<taxAmount rate="20" name="VAT">-2.50</taxAmount>
</discount>
</item>
<item>
<product>
<id>456</id>
<name>Skirt</name>
<description>Flowers Design</description>
<unitPrice>
<grossAmount>40</grossAmount>
<taxAmount rate="10" name="VAT">6.82</taxAmount>
</unitPrice>
</product>
<quantity>2</quantity>
<totalPrice>
<grossAmount>75</grossAmount>
<taxAmount rate="10" name="VAT">3.63</taxAmount>
</totalPrice>
<discount>
<name>Spring-Promotion</name>
<grossAmount>-5</grossAmount>
<taxAmount rate="10" name="VAT">-0.45</taxAmount>
</discount>
</item>
</items>
<subTotalAmount>90</subTotalAmount>
<shippingCost>
<name>Express</name>
<grossAmount>30</grossAmount>
<taxAmount rate="20" name="VAT">5</taxAmount>
</shippingCost>
<discounts>
<discount>
<name>Sommer Sales-Discount</name>
<grossAmount>-10</grossAmount>
<taxAmount rate="20" name="VAT">-1.67</taxAmount>
</discount>
</discounts>
<amountsByTax>
<amountByTax taxName="VAT" taxRate="10">
<grossAmount>75</grossAmount>
<taxAmount>6.82</taxAmount>
</amountByTax>
<amountByTax taxName="VAT" taxRate="20">
<grossAmount>35</grossAmount>
<taxAmount>5.83</taxAmount>
</amountByTax>
</amountsByTax>
<totalAmount>110</totalAmount>
<totalTaxAmount>12.65</totalTaxAmount>
</shoppingCart>
</initiatePaymentRequest>
Example response to the above request:
<initiatePaymentResponse xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<payment xsi:type="paymentWithPaymentAccount">
<merchantID>KalixaAcceptDEMO</merchantID>
<shopID>KalixaAcceptDEMO</shopID>
<paymentMethod>
<key>369</key>
<value>KlarnaDeposit</value>
</paymentMethod>
<merchantTransactionID>hc-b2b-20200721-1319</merchantTransactionID>
<paymentID>e6f9e405-a8be-4c4a-9f6d-e83ae588b4eb</paymentID>
<userID>hkoKlarnaSESEK_1</userID>
<paymentProvider>
<key>189</key>
<value>Klarna</value>
</paymentProvider>
<amount currencyCode="SEK">120.00</amount>
<creationType>
<key>1</key>
<value>User</value>
</creationType>
<userIP>10.10.10.10</userIP>
<state>
<id>c8616c32-5f05-4c6b-9924-4415b8be4d3f</id>
<definition>
<key>4</key>
<value>InitiateErrorReportedByProvider</value>
</definition>
<createdOn>2020-07-21T13:00:40.2495199Z</createdOn>
<paymentStateDetails>
<detail xsi:type="keyStringValuePair">
<key>PaymentStateReasonID</key>
<value>1</value>
</detail>
</paymentStateDetails>
</state>
<isExecuted>false</isExecuted>
<baseAmount currencyCode="EUR">12.93</baseAmount>
<paymentDetails></paymentDetails>
<paymentAccount>
<paymentAccountID>0</paymentAccountID>
</paymentAccount>
</payment>
</initiatePaymentResponse>
How to test Klarna Deposits
- Test-Cases applicable for Klarna Deposit: Klarna Deposit Payment Test Cases
Next steps
When the Klarna Deposit payment was successfully created (state ExecutedPyProvider) it has to be captured (or cancelled) by the merchant within the next 28 days.
Further chapters of interest:
Updated over 2 years ago
Read on to find out how to Capture a Klarna Payment.