Skip to content

    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 up to 14 days from the shipment of the goods or the tickets/availability date of the services or digital content.

    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.

    Customer Experience - Klarna

    In the Payengine Widget, the following screens represent the selection of the payment method and the bank:

    StepDescriptionImage
    1Select Klarna.
    2Choose Payment Method - Pay Now, Pay Later or Financing
    3AFor Pay Now - Choose whether to pay via online bank transfer, direct debit or card. Click Buy and proceed with the required inputs.
    3BFor Pay Later - Click Buy and proceed with the required inputs.
    3CFor Financing - Click Buy and proceed with the required inputs.
    4Enter your birth date and click Continue. A success or failure notification will appear.

    PayEngine Details - Klarna

    General

    NameDetails
    Payment MethodKlarna Pay NowKlarna Pay LaterKlarna Financing
    Payengine valueklarna-pay-nowklarna-pay-laterklarna-slice-it
    Payment Options (for Customer)
    • Online bank transfer
    • Direct debit
    • Credit card
    • invoice
    • Online bank transfer
    • Direct debit
    • Credit card
    ChannelsECOMECOMECOM
    CurrenciesEUR, NOK, SEK, GBP, DKKEUR, NOK, SEK, GBP, DKKEUR, NOK, SEK, GBP, DKK
    CountriesDE, AT, SE, NO, FI, DK, NL, GBDE, AT, SE, NO, FI, DK, NL, GBDE, SE, NO, FI, DK, GB
    Technical FlowAsynchronousAsynchronousAsynchronous
    RecurringNoNoNo
    ChargebacksNoNoNo
    B2B applicableNo
    Yes
    No

    Supported Features and Services

    NameDetails
    DebitYes*
    PreauthorizationYes
    CancelationYes (full and partial)
    CaptureYes (full and partial)
    RefundsYes (full and partial)
    NotificationsYes (webhook and email)
    Settlement ReportingYes

    *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

    NameDetails
    APIYes
    WidgetYes
    BridgeNo
    Shop PluginNo
    PaylinkNo

    Integration via API - Klarna

    Technical Flow

    Klarna tech-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:

    Specifications - Klarna

    Prerequisites for Authorizing Transactions

    PrerequisiteMandatory/Optional (M/O)Endpoint
    CustomerMPOST /customers
    Billing AddressMPOST /customers/{{customerId}}/addresses
    Shipping AddressMPOST /customers/{{customerId}}/addresses
    Payment InstrumentMPOST/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

    ParameterMandatory/Optional (M/O)DescriptionExample
    emailMCustomer's email addressjohn@doe.com

    Customer in B2B cases

    ParameterMandatory/Optional (M/O)DescriptionExample
    emailOAn email address from the customer organizationJohn.Doe@organization.com
    customerTypeМThis parameter has only one possible value - organizationorganization
    organizationRegistrationRegisterОcompany
    organizationRegistrationIDОThe organization's registration ID numberDE1234
    organizationEntityTypeОValid values:
    • LIMITED_COMPANY
    • PUBLIC_LIMITED_COMPANY
    • ENTREPRENEURIAL_COMPANY
    • LIMITED_PARTNERSHIP_LIMITED_COMPANY
    • LIMITED_PARTNERSHIP
    • GENERAL_PARTNERSHIP
    • REGISTERED_SOLE_TRADER
    • SOLE_TRADER
    • CIVIL_LAW_PARTNERSHIP
    • PUBLIC_INSTITUTION
    • OTHER
    LIMITED_COMPANY
    organizationVatIdОThe organization's VAT ID numberDE123456789
    companyNameMThe name of the customer organization. Mandatory for B2B cases.Klarna AB
    referenceOAdditional description.Product Dpt

    Billing/Shipping Address

    ParameterMandatory/ Optional (M/O)DescriptionExample
    firstNameMThe customer's or recipient's first nameJohn
    lastNameMThe customer's or recipient's last nameDoe
    streetMThe customer's or recipient's streetMusterweg
    houseNumberOThe customer's or recipient's home number4313
    cityMThe customer's or recipient's cityMusterhausen
    zipMThe customer's or recipient's ZIP code55555
    countryMThe customer's or recipient's countryDE
    stateOThe customer's or recipient's state or provinceBayern
    phoneOThe customer's or recipient's home phone number00493012345
    faxOThe customer's or recipient's home phone number00493012345
    mobileOThe customer's or recipient's mobile phone number00493012345
    titleM/OThe customer's or recipient's title - mandatory for some markets.Prof. Dr.

    Payment Instrument

    Create Payment Instrument - Request Parameters

    ParameterMandatory/Optional (M/O)DescriptionTypeExample
    typeMThe payment method.stringKlarna
    payment.customerMThe Payengine customer IDstringcustomer_n2mrmnqh6k
    payment.currencyMThe currency of the transaction.stringEUR
    payment.countryMThe country of the transaction.stringDE
    payment.localeMA language code combining the two letters of the language used and the two letters of the country.stringde-DE
    payment.basketMType, price and quantity of the items included in the order.basket data object
    for more information, see Basket Structure at: https://docs.payengine.de/

    Patch Payment Instrument - Request Parameters

    ParameterMandatory/Optional (M/O)DescriptionTypeExample
    typeMThe Klarna payment method.stringklarna-pay-later
    customerMThe customer ID.stringcustomer_rtu858ij5n
    billingAddressMThe billing address ID.stringaddress_j8kj4urna5
    shippingAddressMThe shipping address ID.stringaddress_j8kj4urna5

    Input Parameters for Authorizing Transactions

    ParameterMandatory/Optional (M/O)DescriptionTypeExample
    async.cancelUrlMRedirect URL when payment is canceledstringhttp://my.shop.com/cancel
    async.failureUrlMRedirect URL for unsuccessful paymentstringhttp://my.shop.com/fail
    async.successUrlMRedirect URL for successful paymentstringhttp://my.shop.com/success
    payment.paymentInstrumentIdMThe ID of the payment instrument.stringpaymentinstrument_dkj7j4ygc0
    payment.initializeCustomerTokenizationOUsed to create a token for recurring purchases. Applicable to B2C only. Default is false.booleanfalse
    tracking.trackingIdOThe delivery tracking ID number.stringCP-456
    tracking.providerOThe delivery company.stringDHL

    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.