Klarna
Overview - Klarna
Klarna is an innovative financial company, which has been offering easy-to-use payment solutions and factoring since 2005. Klarna takes over the credit and fraud risk for both merchants and customers throughout the payment process. Klarna's payment services are easy to use and work seamlessly across borders.
Klarna offers the following payment options:
Pay Now: Consumers can pay securely at checkout via online bank transfer (Sofort), direct debit or credit card.
Pay Later: Consumers can pay via invoice.
Financing: Consumers can pay in fixed or flexible installments and disperse the expenditures in time.
Merchants can decide which of the three payment methods should be enabled for them depending on preferences and business characteristics.
Activation - Klarna
To activate Klarna as a payment method and to add it to your PayEngine Merchant Center, you need to complete the onboarding journey.
Please provide our support with the following information:
- Klarna MerchantID
- Username
- password
- Privacy Policy URL
- Terms URL
If you do not have a Klarna merchant account yet, please contact Klarna directly to create an account.
Customer Experience - Klarna
In the Payengine Widget, the following screens represent the selection of the payment method and the bank:
Step | Description | Image |
---|---|---|
1 | Select Klarna. | |
2 | Choose Payment Method - Pay Now, Pay Later or Financing | |
3A | For Pay Now - Choose whether to pay via online bank transfer, direct debit or card. Click Buy and proceed with the required inputs. | |
3B | For Pay Later - Click Buy and proceed with the required inputs. | |
3C | For Financing - Click Buy and proceed with the required inputs. | |
4 | Enter your birth date and click Continue. A success or failure notification will appear. |
PayEngine Details - Klarna
General
Name | Details | ||
---|---|---|---|
Payment Method | Klarna Pay Now | Klarna Pay Later | Klarna Financing |
Payengine value | klarna-pay-now | klarna-pay-later | klarna-slice-it |
Payment Options (for Customer) |
|
|
|
Channels | ECOM | ECOM | ECOM |
Currencies | EUR, NOK, SEK, GBP, DKK | EUR, NOK, SEK, GBP, DKK | EUR, NOK, SEK, GBP, DKK |
Countries | DE, AT, SE, NO, FI, DK, NL, GB | DE, AT, SE, NO, FI, DK, NL, GB | DE, SE, NO, FI, DK, GB |
Technical Flow | Asynchronous | Asynchronous | Asynchronous |
Recurring | No | No | No |
Chargebacks | No | No | No |
B2B applicable | No | Yes | No |
Supported Features and Services
Name | Details |
---|---|
Debit | Yes* |
Preauthorization | Yes |
Cancelation | Yes (full and partial) |
Capture | Yes (full and partial) |
Refunds | Yes (full and partial) |
Notifications | Yes (webhook and email) |
Settlement Reporting | Yes |
*Debit (auto-capture) can be enabled only through a request to the Concardis sales and integration team. The Debit function is suitable only for digital merchants that deliver intangible goods. Merchants that deliver physical goods do not need to enable the Debit option.
Integration Types
Name | Details |
---|---|
API | Yes |
Widget | Yes |
Bridge | No |
Shop Plugin | No |
Paylink | No |
Integration via API - Klarna
Technical Flow
Webhook and Email Notifications
At the time of the redirect, it is still uncertain whether a transaction will be completed successfully or not. Therefore, Payengine awaits for the final asynchronous notification before the status of a DEBIT/PREAUTH transaction is changed from PENDING to SUCCESS or FAILURE.
A merchant should register for Payengine's notifications to receive this final status update.
Alternatively, a GET request on the order or DEBIT/PREAUTH transaction would also work, but it is not ensured that the final status will be available immediately after the redirect and a merchant might have to query the GET multiple times.
Therefore, it is strongly recommended that Payengine's asynchronous notifications are used instead.
Merchants could receive notifications via URL (webhook) or email.
The notifications could be subscribed:
- via the payengine API (link to API documentation)
- via the Payengine Merchant Center (link to Merchant Center notifications documentation)
Specifications - Klarna
Prerequisites for Authorizing Transactions
Prerequisite | Mandatory/Optional (M/O) | Endpoint |
---|---|---|
Customer | M | POST /customers |
Billing Address | M | POST /customers/{{customerId}}/addresses |
Shipping Address | M | POST /customers/{{customerId}}/addresses |
Payment Instrument | M | POST/payment-instruments PATCH/payment-instruments/{{paymentInstrumentId}} |
Customer
The specific request parameters for creating Customer objects are different when the end-user is an individual (B2C cases) or an organization (B2B cases).
Customer in B2C cases
Parameter | Mandatory/Optional (M/O) | Description | Example |
---|---|---|---|
M | Customer's email address | john@doe.com |
Customer in B2B cases
Parameter | Mandatory/Optional (M/O) | Description | Example |
---|---|---|---|
O | An email address from the customer organization | John.Doe@organization.com | |
customerType | М | This parameter has only one possible value - organization | organization |
organizationRegistrationRegister | О | company | |
organizationRegistrationID | О | The organization's registration ID number | DE1234 |
organizationEntityType | О | Valid values:
| LIMITED_COMPANY |
organizationVatId | О | The organization's VAT ID number | DE123456789 |
companyName | M | The name of the customer organization. Mandatory for B2B cases. | Klarna AB |
reference | O | Additional description. | Product Dpt |
Billing/Shipping Address
Parameter | Mandatory/ Optional (M/O) | Description | Example |
---|---|---|---|
firstName | M | The customer's or recipient's first name | John |
lastName | M | The customer's or recipient's last name | Doe |
street | M | The customer's or recipient's street | Musterweg |
houseNumber | O | The customer's or recipient's home number | 4313 |
city | M | The customer's or recipient's city | Musterhausen |
zip | M | The customer's or recipient's ZIP code | 55555 |
country | M | The customer's or recipient's country | DE |
state | O | The customer's or recipient's state or province | Bayern |
phone | O | The customer's or recipient's home phone number | 00493012345 |
fax | O | The customer's or recipient's home phone number | 00493012345 |
mobile | O | The customer's or recipient's mobile phone number | 00493012345 |
title | M/O | The customer's or recipient's title - mandatory for some markets. | Prof. Dr. |
Payment Instrument
Create Payment Instrument - Request Parameters
Parameter | Mandatory/Optional (M/O) | Description | Type | Example | |
---|---|---|---|---|---|
type | M | The payment method. | string | Klarna | |
payment.customer | M | The Payengine customer ID | string | customer_n2mrmnqh6k | |
payment.currency | M | The currency of the transaction. | string | EUR | |
payment.country | M | The country of the transaction. | string | DE | |
payment.locale | M | A language code combining the two letters of the language used and the two letters of the country. | string | de-DE | |
payment.basket | M | Type, price and quantity of the items included in the order. | basket data object |
|
Patch Payment Instrument - Request Parameters
Parameter | Mandatory/Optional (M/O) | Description | Type | Example |
---|---|---|---|---|
type | M | The Klarna payment method. | string | klarna-pay-later |
customer | M | The customer ID. | string | customer_rtu858ij5n |
billingAddress | M | The billing address ID. | string | address_j8kj4urna5 |
shippingAddress | M | The shipping address ID. | string | address_j8kj4urna5 |
Input Parameters for Authorizing Transactions
Parameter | Mandatory/Optional (M/O) | Description | Type | Example |
---|---|---|---|---|
async.cancelUrl | M | Redirect URL when payment is canceled | string | http://my.shop.com/cancel |
async.failureUrl | M | Redirect URL for unsuccessful payment | string | http://my.shop.com/fail |
async.successUrl | M | Redirect URL for successful payment | string | http://my.shop.com/success |
payment.paymentInstrumentId | M | The ID of the payment instrument. | string | paymentinstrument_dkj7j4ygc0 |
payment.initializeCustomerTokenization | O | Used to create a token for recurring purchases. Applicable to B2C only. Default is false. | boolean | false |
tracking.trackingId | O | The delivery tracking ID number. | string | CP-456 |
tracking.provider | O | The delivery company. | string | DHL |
Samples
Create Payment Instrument
POST/{{publicApiUrl}}/v1/payment-instruments
Create Payment Instrument Request
{ "type": "klarna", "payment": { "customer": "customer_mp1kteeeue",
Create Payment Instrument Response
{ "createdAt": 1576840775113, "modifiedAt": 1576840775113, "paymentInstrumentId": "paymentinstrument_4n1ujwpg6r",
Patch Payment Instrument
PATCH/{{publicApiUrl}}/v1/payment-instruments/{{paymentInstrumentId}}
Patch Payment Instrument Request
{ "country": "DE", "currency": "EUR", "locale": "de-DE",
Patch Payment Instrument Response
{ "createdAt": 1575885954240, "modifiedAt": 1575885975744, "paymentInstrumentId": "paymentinstrument_thqjrcznkf",
Preauth transaction
POST/{{publicApiUrl}}/v1/orders/preauth
Create Preauth Request
{ "terms": 1468590412476, "privacy": 1468590412476, "description": "test transaction",
Create Preauth Response
{ "createdAt": 1578570948538, "modifiedAt": 1578570948578, "merchantId": "merchant_8f8guamnjm",
Capture transaction
POST/{{publicApiUrl}}/v1/orders/{{orderId}}/transactions/{{preauthTransactionId}}/capture
Capture transaction Request
{ "description": "description for transaction.", "initialAmount": 21420, "currency": "EUR"
Capture transaction Response
{ "createdAt": 1576835696771, "modifiedAt": 1576835696782, "type": "CAPTURE",
Cancel transaction
POST/{{publicApiUrl}}/v1/orders/{{orderId}}/transactions/{{TransactionId}}/cancel
Cancel transaction Request
{ "description": "description for transaction.", "currency": "EUR", "initialAmount": 21325
Cancel transaction Response
{ "createdAt": 1576835715983, "modifiedAt": 1576835715983, "type": "CANCEL",
Debit transaction
POST/{{publicApiUrl}}/v1/orders/debit
Creat Debit Request
{ "terms": 1468590412476, "privacy": 1468590412476, "description": "35269",
Creat Debit Response
{ "createdAt": 1578573299716, "modifiedAt": 1578573299797, "merchantId": "merchant_8f8guamnjm",
Refund transaction
POST/{{publicApiUrl}}/v1/orders/{{orderId}}/transactions/{{TransactionId}}/refund
Create Refund Request
{ "description": "description for transaction.", "currency": "EUR", "initialAmount": 42745
Create Refund Response
{ "createdAt": 1578574599583, "modifiedAt": 1578574599583, "type": "REFUND",
Testing
The testing of the three Klarna payment options can be executed via the Klarna Sandbox.
The Klarna Sandbox is a self-contained virtual testing environment that mimics the live Klarna production environment.
Instructions on how to access the Klarna testing environment can be found here.