Menu

Klarna

Klarna is a buy now, pay later payment method that provides a fast checkout process.

Prerequisite: You must be setup for Klarna before using it with Worldpay. For more information, contact yourRelationship Manager.

On this page:

Payment methods

There are three different potential product types that define when and how your shopper pays. You must send the product type in your <paymentDetails> in your payment request. The three different values are:

ValueDescriptionCountries available in
KLARNA_SLICEIT-SSLThe shopper pays in instalments. The terms of the instalment timeframes are agreed with Klarna upon boarding.SE, NO, FI, DE, AT, UK, DK, US
KLARNA_PAYLATER-SSLThe shopper pays within a specified timeframe. This timeframe is 30 days for UK/ US and 14 days for Europe.SE, NO, FI, DE, NL, AT, CH, UK, DK, US
KLARNA_PAYNOW-SSLThe shopper pays the full amount immediately by bank transfer.SE, DE, NL, AT

Note: Should your preferred payment method not be available, Klarna offers an alternative to the shopper on the Klarna site. This means you might receive a different value in your <paymentMethod> in theorder notification.

<paymentDetails> attributes

You must supply the following attributes within the payment method chosen:

AttributeValidationSpecification
shopperCountryCodeValidates that it matches the shopperLocale patternISO 3166 alpha-2
shopperLocaleValidates that it matches the shopperCountryCode patternRFC 1766

Note: Use the standard ISO (International Standards Organisation) country codes as specified inISO 3166for shopperLocale and purchaseCountry attributes.

Locale/Country combinations

The table below shows valid locale and shopper country combinations for currencies:

<shopperCountryCode><currency><shopperLocale>
ATEURde-AT
FIEURfi-FI
DEEURde-DE
NLEURnl-NL
NONOKnb-NO
SESEKsv-SE
GBGBPen-GB
DKDKKda-DK
USUSDen-US

Other validations

Other attributes used to validate data.

Country of billing and shipping address

When you submit billing and shipping address details, you must follow the format appropriate to the country.

For example: An address in the UK is written as '21 NEW ROAD', and in Germany the address would be written 'NEW ROAD 21'.

Enter the address information in <address1> with the correct format for both the billing and shipping address elements.

Sum validations

All sum validations must have an exponent of 2 in your payment request.

This applies to the following elements:

  • <amount>
  • <orderTaxAmount>
  • <unitPrice>
  • <taxRate>
  • <totalAmount>
  • <totalTaxAmount>
  • <totalDiscountAmount>

Orderline element validations

<orderLines> contains child element:

ElementDescriptionSpecification
<lineItem>Type of product you sellSupply one of the child elements:
  • physical
  • discount
  • shippingFee
  • digital
  • gift card
  • store credit
  • surcharge
<termsUrl>A link to your terms and conditionsURL, max. 255 length
<OrderTaxAmount>Sum of all <totalTaxAmount> elements in this XMLInteger > 0

<lineItem> can also contain the following:

ElementDescriptionSpecification
<reference>Your internal identifierString, max. 64 length
<name>Item nameString, max. 255 length
<quantity>Amount of itemsInteger > 0
<quantityUnit>Item descriptionString, max. length 8
<untitPrice>Price per itemInteger > 0, max. <unitPrice>100000000</unitPrice>
<totalDiscountAmount>Overall discount on priceInteger, if present > 0
<taxRate>Tax rate in percentageInteger > 0
<totalTaxAmount>Amount of <unitPrice> multiplied by <quantity> multiplied by <taxRate> divided by 100Integer > 0
<totalAmount>Sum of all chargeable elements added togetherInteger > 0
<productURL>Link to product descriptionURL
<imageURL>Link to product imageURL

Note: You can have individual or multiple <lineItem> elements within an <orderLines> element.

Payment request

Payment responses

Worldpay responds with a Klarna redirect URL. The example response below is for our test environment and returns a Worldpay simulated response. A dropdown allows you to select one of the following outcomes:

  • AUTHORISED
  • REFUSED
  • PENDING
  • SHOPPER_CANCELLED
  • ERROR

We communicate the transaction response to you throughorder notifications.

Payment route data

Each payment type returns payment route data. Use this data to quickly identify the payment type, contract length (if applicable) and country of payment. You must be able to receive the payment route data you require.

Payment response example

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd" >
<paymentService version="1.4" merchantCode="YOUR_MERCHANT_CODE">
    <reply>
        <orderStatus orderCode="ORDER_CODE">
            <reference id="6346196996">https://secure-test.worldpay.com/wcc/dispatcher?OrderKey=YOUR_MERCHANT_CODE^ORDER_CODE</reference>
        </orderStatus>
    </reply>
</paymentService>

The <reference id> is a standard Worldpay internal order response.

Recurring Payments

For recurring payments (payment requests submitted by you) you must include additional elements, includingExtra Merchant Data (EMD)to create a token, and to use a token.

Prerequisites:

Creating a token

In your initial payment request, you must include the following:

ElementChild element/attributeDescription
<customerToken>usageIntended use of the customer token (in this case SUBSCRIPTION).
<description>What the subscription is for.

Note: In the following example,Extra Merchant Data (EMD)has been applied for subscriptions.

Payment request example: creating a token

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay/DTD WorldPay PaymentService v1//EN"
        "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="YOUR_MERCHANT_CODE">
    <submit>
        <order orderCode="ORDER_CODE">
            <description>test order</description>
            <amount value="5000" currencyCode="GBP" exponent="2"/>
            <orderContent> <![CDATA[]]> </orderContent>
            <paymentDetails>
                <KLARNA_PAYLATER-SSL shopperCountryCode="GB" locale="en-GB">
                    <successURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</successURL>
                    <cancelURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</cancelURL>
                    <pendingURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</pendingURL>
                    <failureURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</failureURL>
                    <customerToken usage="SUBSCRIPTION">
                        <description>SomeDescription</description>
                    </customerToken>
                    <klarnaExtraMerchantData>
                        <subscription>
                            <name>TestSubscription1</name>
                            <start><date dayOfMonth="15" month="7" year="2019" hour="00" minute="00" second="00"/></start>
                            <end><date dayOfMonth="20" month="7" year="2019" hour="00" minute="00" second="00"/></end>
                            <autoRenew>false</autoRenew>
                            <affiliateName>TestSubscriptionAffiliateName1</affiliateName>
                        </subscription>
                    </klarnaExtraMerchantData>
                </KLARNA_PAYLATER-SSL>
                <session shopperIPAddress="127.0.0.1" id="ssn432697661"/>
            </paymentDetails>
            <shopper>
                <shopperEmailAddress>shopper@worldpay.com</shopperEmailAddress>
            </shopper>
            <shippingAddress>
                <address>
                    <firstName>Joe</firstName>
                    <lastName>Bloggs</lastName>
                    <address1>34 Cambridge Chase</address1>
                    <address2/>
                    <postalCode>CB2 3NE</postalCode>
                    <city>Cambridge</city>
                    <state>Cambridgeshire</state>
                    <countryCode>GB</countryCode>
                    <telephoneNumber>0123456789</telephoneNumber>
                </address>
            </shippingAddress>
            <billingAddress>
                <address>
                    <firstName>Joe</firstName>
                    <lastName>Bloggs</lastName>
                    <address1>34 Cambridge Chase</address1>
                    <address2/>
                    <postalCode>CB2 3NE</postalCode>
                    <city>Cambridge</city>
                    <state>Cambridgeshire</state>
                    <countryCode>GB</countryCode>
                    <telephoneNumber>0123456789</telephoneNumber>
                </address>
            </billingAddress>
            <statementNarrative>Merchants Statement Narrative</statementNarrative>
            <orderLines>
                <orderTaxAmount>0</orderTaxAmount>
                <termsURL>http://www.worldpay.com?termsURL</termsURL>
                <lineItem>
                    <reference>543671</reference>
                    <name>Pineapples</name>
                    <quantity>1</quantity>
                    <quantityUnit>bag</quantityUnit>
                    <unitPrice>5000</unitPrice>
                    <taxRate>0</taxRate>
                    <totalAmount>5000</totalAmount>
                    <totalTaxAmount>0</totalTaxAmount>
                    <totalDiscountAmount>0</totalDiscountAmount>
                    <productURL>https://www.estore.com/products/f2a8d7e34</productURL>
                    <imageURL>https://www.exampleobjects.com/logo.png</imageURL>
                </lineItem>
            </orderLines>
        </order>
    </submit>
</paymentService>

Payment response example: creating a token

Note: The token creation response is received as anorder notification.

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN"
       "http://dtd.wp.fte27.test.worldpay.com/dtd/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="YOUR_MERCHANT_CODE">
   <reply>
       <orderStatus orderCode="ORDER_CODE">
           <payment>
               <paymentMethod>KLARNA_PAYLATER-SSL</paymentMethod>
               <amount value="5000" currencyCode="GBP" exponent="2" debitCreditIndicator="credit"/>
               <lastEvent>AUTHORISED</lastEvent>
               <balance accountType="IN_PROCESS_AUTHORISED">
                   <amount value="5000" currencyCode="GBP" exponent="2" debitCreditIndicator="credit"/>
               </balance>
               <apmEnrichedData>
                   <parameter key="productType">INVOICE</parameter>
                   <!--This "customerToken" is your "tokenId" in subsequent payment requests-->
                   <parameter key="customerToken">25cbf395-fd6e-438a-8680-b2cf959b8ce5</parameter>
                   <parameter key="fraudStatus">ACCEPTED</parameter>
                   <parameter key="merchantReference1">3200584482</parameter>
                   <parameter key="orderId">5fa63709-9f10-7bc0-9c5c-4317db4c248f</parameter>
                   <parameter key="purchaseCountry">GB</parameter>
                   <parameter key="type">physical</parameter>
                   <parameter key="initialPaymentMethod">KLARNA_PAYLATER</parameter>
               </apmEnrichedData>
           </payment>
           <date dayOfMonth="28" month="10" year="2019" hour="9" minute="12" second="4"/>
       </orderStatus>
   </reply>
</paymentService>

Using a token

For subsequent payment requests the element <customerToken> defines the usage for the token. You must add the <parameterkey="customerToken"> from your token request response in the child element <tokenId> .

ElementChild element/attributesDescription
<customerToken>usageIntended use of the customer token (in this case USE)
<tokenId>encrypted value

Payment request example: using a token

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay/DTD WorldPay PaymentService v1//EN"
        "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="YOUR_MERCHANT_CODE">
    <submit>
        <order orderCode="ORDER_CODE">
            <description>test order</description>
            <amount value="5000" currencyCode="GBP" exponent="2"/>
            <orderContent> <![CDATA[]]> </orderContent>
            <paymentDetails>
                <KLARNA_PAYLATER-SSL shopperCountryCode="GB" locale="en-GB">
                    <successURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</successURL>
                    <cancelURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</cancelURL>
                    <pendingURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</pendingURL>
                    <failureURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</failureURL>
                    <customerToken usage="USE">
                        <tokenId>25cbf395-fd6e-438a-8680-b2cf959b8ce5</tokenId>
                    </customerToken>
                    <klarnaExtraMerchantData>
                        <subscription>
                            <name>TestSubscription1</name>
                            <start><date dayOfMonth="15" month="7" year="2019" hour="00" minute="00" second="00"/></start>
                            <end><date dayOfMonth="20" month="7" year="2019" hour="00" minute="00" second="00"/></end>
                            <autoRenew>false</autoRenew>
                            <affiliateName>TestSubscriptionAffiliateName1</affiliateName>
                        </subscription>
                        <subscription>
                            <name>TestSubscription2</name>
                            <start><date dayOfMonth="15" month="7" year="2019" hour="00" minute="00" second="00"/></start>
                            <end><date dayOfMonth="20" month="7" year="2019" hour="00" minute="00" second="00"/></end>
                            <autoRenew>true</autoRenew>
                            <affiliateName>TestSubscriptionAffiliateName2</affiliateName>
                        </subscription>
                    </klarnaExtraMerchantData>
                </KLARNA_PAYLATER-SSL>
                <session shopperIPAddress="127.0.0.1" id="ssn432697661"/>
            </paymentDetails>
            <shopper>
                <shopperEmailAddress>shopper@worldpay.com</shopperEmailAddress>
            </shopper>
            <shippingAddress>
                <address>
                    <firstName>Joe</firstName>
                    <lastName>Bloggs</lastName>
                    <address1>34 Cambridge Chase</address1>
                    <address2/>
                    <postalCode>CB2 3NE</postalCode>
                    <city>Cambridge</city>
                    <state>Cambridgeshire</state>
                    <countryCode>GB</countryCode>
                    <telephoneNumber>0123456789</telephoneNumber>
                </address>
            </shippingAddress>
            <billingAddress>
                <address>
                    <firstName>Joe</firstName>
                    <lastName>Bloggs</lastName>
                    <address1>34 Cambridge Chase</address1>
                    <address2/>
                    <postalCode>CB2 3NE</postalCode>
                    <city>Cambridge</city>
                    <state>Cambridgeshire</state>
                    <countryCode>GB</countryCode>
                    <telephoneNumber>0123456789</telephoneNumber>
                </address>
            </billingAddress>
            <statementNarrative>Merchants Statement Narrative</statementNarrative>
            <orderLines>
                <orderTaxAmount>0</orderTaxAmount>
                <termsURL>http://www.worldpay.com?termsURL</termsURL>
                <lineItem>
                    <reference>543671</reference>
                    <name>Pineapples</name>
                    <quantity>1</quantity>
                    <quantityUnit>bag</quantityUnit>
                    <unitPrice>5000</unitPrice>
                    <taxRate>0</taxRate>
                    <totalAmount>5000</totalAmount>
                    <totalTaxAmount>0</totalTaxAmount>
                    <totalDiscountAmount>0</totalDiscountAmount>
                    <productURL>https://www.estore.com/products/f2a8d7e34</productURL>
                    <imageURL>https://www.exampleobjects.com/logo.png</imageURL>
                </lineItem>
            </orderLines>
        </order>
    </submit>
</paymentService>

Payment response example: using a token

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN"
       "http://dtd.wp.fte27.test.worldpay.com/dtd/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="YOUR_MERCHANT_CODE">
   <reply>
       <orderStatus orderCode="ORDER_CODE">
           <payment>
               <paymentMethod>KLARNA_PAYLATER-SSL</paymentMethod>
               <amount value="5000" currencyCode="GBP" exponent="2" debitCreditIndicator="credit"/>
               <lastEvent>AUTHORISED</lastEvent>
               <balance accountType="IN_PROCESS_AUTHORISED">
                   <amount value="5000" currencyCode="GBP" exponent="2" debitCreditIndicator="credit"/>
               </balance>
               <apmEnrichedData>
                   <parameter key="productType">INVOICE</parameter>
                   <parameter key="customerToken">25cbf395-fd6e-438a-8680-b2cf959b8ce5</parameter>
                   <parameter key="fraudStatus">ACCEPTED</parameter>
                   <parameter key="merchantReference1">3100620012</parameter>
                   <parameter key="orderId">eaaf9f4c-3feb-79de-8e13-c78e66e3f08c</parameter>
                   <parameter key="purchaseCountry">GB</parameter>
                   <parameter key="type">physical</parameter>
                   <parameter key="initialPaymentMethod">KLARNA_PAYLATER</parameter>
               </apmEnrichedData>
           </payment>
       </orderStatus>
   </reply>
</paymentService>

We communicate the transaction response to you throughorder notifications.

Worldpay recommend that you rely on asynchronous notifications for the USE token flow. Contact the Worlpay Support team to enable the USE token functionality.

You receive two separate response notifications, both show the details of the response in the attribute <balance accountType="">. One response confirms the status of the request, and the other, the request response:

APM enriched data

APM enriched data provides the <customerToken> used for subsequent payments, and several extra elements that you can query Klarna with.

ElementChild elementDescription
<apmEnrichedData>
<parameter key="productType">The Klarna product type used.
<parameter key="customerToken">The token provided by Klarna - use as the <tokenId> in subsequent payments.
<parameter key="fraudStatus">Represents whether the payment has been accepted or refused by Klarna.
<parameter key="merchantReference1">Klarna's reference number for the merchant.
<parameter key="orderId">Klarna's order number for the payment. Use this additional data when querying Klarna about the payment.
<parameter key="purchaseCountry">The country of purchase.
<parameter key="type">The product category type.
<parameter key="initialPaymentMethod">The Klarna payment type selected by the shopper.

Extra Merchant Data (EMD)

We recommend you submit the following EMD for your vertical to assist with the processing of your transaction. Contact yourRelationship Managerfor details.

Choose the tab that most closely represents your business requirements for EMD examples.

For subscription payments you must create a token.

Copied!
<KLARNA_PAYLATER-SSL locale="en-GB" shopperCountryCode="GB">
    <successURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</successURL&gt;
    <cancelURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</cancelURL&gt;
    <pendingURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</pendingURL&gt;
    <failureURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</failureURL&gt;
    <customerToken usage="SUBSCRIPTION">
        <description>SomeDescription</description>
    </customerToken>
    <klarnaExtraMerchantData>
        <subscription>
            <name>TestSubscription1</name>
            <start>
                <date second="00" minute="00" hour="00" year="2019" month="7" dayOfMonth="15"/>
            </start>
            <end>
                <date second="00" minute="00" hour="00" year="2019" month="7" dayOfMonth="20"/>
            </end>
            <autoRenew>false</autoRenew>
            <affiliateName>TestSubscriptionAffiliateName1</affiliateName>
        </subscription>
    </klarnaExtraMerchantData>
</KLARNA_PAYLATER-SSL>

Supply mandatory recurring payments data in <subscription> which is a child of <klarnaExtraMerchantData>:

ElementsChild elements/attributesDescription
<subscription>
<name>The name on the subscription (displayed as it would be on a bill).
<start>The start date.
<end>The end date.
<autoRenew>Will the subscription auto renew.
<affiliateName>Name of the affiliate who originated the purchase.

Use the token for future payment requests.

Copied!
<KLARNA_PAYLATER-SSL locale="en-GB" shopperCountryCode="GB">
    <successURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</successURL&gt;
    <cancelURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</cancelURL&gt;
    <pendingURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</pendingURL&gt;
    <failureURL>http://ukdc1-tz-mer01.test.worldpay.com:5000/cgi-bin/whoami_dump</failureURL&gt;
    <customerToken usage="USE">
        <tokenId>b9f7e99d-3594-489e-b87d-6170f3a689b0</tokenId>
    </customerToken>
    <klarnaExtraMerchantData>
        <subscription>
            <name>TestSubscription1</name>
            <start>
                <date second="00" minute="00" hour="00" year="2019" month="7" dayOfMonth="15"/>
            </start>
            <end>
                <date second="00" minute="00" hour="00" year="2019" month="7" dayOfMonth="20"/>
            </end>
            <autoRenew>false</autoRenew>
            <affiliateName>TestSubscriptionAffiliateName1</affiliateName>
        </subscription>
    </klarnaExtraMerchantData>
</KLARNA_PAYLATER-SSL>
ElementsChild elements/attributesDescription
<customerToken>usage="USE"
<tokenId>The token reference
Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay/DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd"&gt;
<paymentService version="1.4" merchantCode="YOUR_MERCHANT_CODE">
    <submit>
        <order orderCode="ORDER_CODE">
            <description>test order</description>
            <amount value="10000" currencyCode="GBP" exponent="2" />
            <orderContent>
                <![CDATA[]]>
            </orderContent>
            <paymentDetails>
                <KLARNA_PAYLATER-SSL shopperCountryCode="GB" locale="en-GB">
                    <successURL>https://success.com/success?token=authorization_token</successURL&gt;
                    <cancelURL>https://cancel.com?cancelURL</cancelURL&gt;
                    <pendingURL>http://pending.com?pendingURL</pendingURL&gt;
                    <failureURL>http://refused.com?failureURL</failureURL&gt;
                </KLARNA_PAYLATER-SSL>
                <session shopperIPAddress="127.0.0.1" id="ssn95446156" />
            </paymentDetails>
            <shopper>
                <shopperEmailAddress>shopper's email address</shopperEmailAddress>
            </shopper>
            <shippingAddress>
                <address>
                    <firstName>Joe</firstName>
                    <lastName>Bloggs</lastName>
                    <address1>34 Cambridge Chase</address1>
                    <address2 />
                    <postalCode>CB2 3NE</postalCode>
                    <city>Cambridge</city>
                    <state>Cambridgeshire</state>
                    <countryCode>GB</countryCode>
                    <telephoneNumber>0123456789</telephoneNumber>
                </address>
            </shippingAddress>
            <billingAddress>
                <address>
                    <firstName>Joe</firstName>
                    <lastName>Bloggs</lastName>
                    <address1>34 Cambridge Chase</address1>
                    <address2 />
                    <postalCode>CB2 3NE</postalCode>
                    <city>Cambridge</city>
                    <state>Cambridgeshire</state>
                    <countryCode>GB</countryCode>
                    <telephoneNumber>0123456789</telephoneNumber>
                </address>
            </billingAddress>
            <branchSpecificExtension>
                <airline code="YOUR_AIRLINE_NAME">
                    <airlineName>Your airline name</airlineName>
                    <passenger code="abc">Joe Bloggs</passenger>
                    <ticket code="12345" restricted="0">
                        <issuer>
                            <address>
                                <street>1 Worldpay Way</street>
                                <postalCode>123456</postalCode>
                                <countryCode>GB</countryCode>
                            </address>
                        </issuer>
                        <flight carrierCode="YOUR_CARRIER_CODE">
                            <departureAirport>CLJ</departureAirport>
                            <arrivalAirport>LTN</arrivalAirport>
                            <departureDate>
                                <date dayOfMonth="5" month="7" year="2019" hour="00" minute="00" second="00" />
                            </departureDate>
                            <fare class="F" />
                            <tax>
                                <amount value="10000" currencyCode="GBP" exponent="2" />
                            </tax>
                            <reservationItinerary>
                                <name>Joe Bloggs</name>
                                <departureCity>Cluj-Napoca</departureCity>
                                <arrivalCity>London</arrivalCity>
                                <start>
                                    <date dayOfMonth="15" month="7" year="2019" hour="00" minute="00" second="00" />
                                </start>
                                <end>
                                    <date dayOfMonth="20" month="7" year="2019" hour="00" minute="00" second="00" />
                                </end>
                                <deliveryMethod>email</deliveryMethod>
                                <deliveryRecipient>shopper@worldpay.com</deliveryRecipient>
                                <parties>
                                    <party>
                                        <reference>1</reference>
                                        <firstName>Joe</firstName>
                                        <lastName>Bloggs</lastName>
                                        <salutation>Mr</salutation>
                                    </party>
                                </parties>
                                <amount value="10000" currencyCode="GBP" exponent="2" />
                                <classification>Business</classification>
                            </reservationItinerary>
                            <insurance>
                                <insuranceCompany>Insurance company name</insuranceCompany>
                                <insuranceType>cancellation</insuranceType>
                                <amount value="5000" currencyCode="GBP" exponent="2" />
                            </insurance>
                            <affiliateName>WPG Klarna Affiliate</affiliateName>
                        </flight>
                    </ticket>
                    <agent code="12345678">Eximtur</agent>
                </airline>
            </branchSpecificExtension>
            <statementNarrative>Merchants Statement Narrative</statementNarrative>
            <orderLines>
                <orderTaxAmount>0</orderTaxAmount>
                <termsURL>http://www.worldpay.com?termsURL</termsURL&gt;
                <lineItem>
                    <reference>543671</reference>
                    <name>Pineapples</name>
                    <quantity>1</quantity>
                    <quantityUnit>bag</quantityUnit>
                    <unitPrice>10000</unitPrice>
                    <taxRate>0</taxRate>
                    <totalAmount>10000</totalAmount>
                    <totalTaxAmount>0</totalTaxAmount>
                    <totalDiscountAmount>0</totalDiscountAmount>
                    <productURL>https://www.estore.com/products/f2a8d7e34</productURL&gt;
                    <imageURL>https://www.exampleobjects.com/logo.png</imageURL&gt;
                </lineItem>
            </orderLines>
        </order>
    </submit>
</paymentService>

Supply mandatory airline data in <airline> which is a child of <branchSpecificExtension>:

ElementsChild elements/attributesDescription
<airlineName>The name of the airline (displayed as it would be on a bill).
<passenger>codeThe passenger code.
<agent>codeThe IATA travel agency code.
<ticket>codeThe ticket number.
restrictedCan have the value 0 (false) or 1 (true).
<issuer>With child element<address> which consists of <street>, <postalCode>, <countryCode>.
<flight>Attribute: carrierCode. Flight number/code.
2 characters long,

Note: You can have up to four <flight> elements in a single order.

<nonTicket>subCodeConditional, supply instead of <ticket>. IATA 3 character services industry sub code.

<flight> consists of:

ElementsChild elements/attributesM/ODescription
<departureAirport>MandatoryDeparture Airport Code (IATA Airport Code).
Example “YUL”
<arrivalAirport>MandatoryArrival Airport Code (IATA Airport Code).
Example “LHR”
<departureDate>MandatoryWith child element <date> and attributes dayOfMonth, month, year, hour, minute, second
<fare>MandatoryIATA fare code.
<tax><amount>MandatoryAttributes value, currencyCode, exponent.
<reservationItinerary><name>OptionalName of passenger.
<departureCity>OptionalString: Location of the airport. Example: Cambridge
<arrivalCity>OptionalString: Location of the airport in the arrival city. Example:Cluj-Napoca
<start>OptionalWith child element <date> and attributes dayOfMonth, month, year, hour, minute, second.
<end>OptionalWith child element <date> and attributes dayOfMonth, month, year, hour, minute, second.
<deliveryMethod>OptionalMethod of ticket delivery. Submit the following:
  • pick_up
  • email
  • post
  • phone
<deliveryRecipient>OptionalThe name of the recipient the ticket is delivered to. If email or phone, then use either email address or phone number.
<parties>OptionalWith child element <party> which consists of <reference>, <firstName>, lastName>, <salutation>.
<amount>OptionalSegment price in the specified currency. Attributes: value, currencyCode, exponent
<classification>OptionalString. Example “Economy”
<insurance><insuranceCompany>OptionalName of insurance provider.
<insuranceType>OptionalType of insurance provided. Possible values:
  • cancellation
  • travel
  • cancellation_travel
  • bankruptcy
<amount>OptionalAttributes: value, currencyCode and exponent.
<affiliateName>OptionalName of the affiliate that originated the purchase. If none, leave blank.

Shopper specific EMD options

You provide Extra Merchant Data on a per shopper basis and can submit additional supporting data you have for your shopper using the element <extendedOrderDetail>.

Within the element <extendedOrderDetail> add the relevant data.

Payment Outcomes

Once we have supplied the redirect URL, the payment has a status of SHOPPER_REDIRECTED.

Worldpay queries Klarna for the payment result and then redirects your shopper to the supplied result URL's.

The status of the order changes accordingly and the four possible outcomes are:

  • AUTHORISED - the shopper is redirected to the successURL
  • REFUSED - the shopper is redirected to the failureURL
  • WAITING_FOR_AUTHORISATION - the shopper is redirected to the pendingURL. (In some edge cases, the transaction could still be authorised for up to 30 days.)
  • SHOPPER_CANCELLED - the shopper is redirected to the cancelURL

Order Modifications

Capture

Capturing a payment activates the shopper's invoice with Klarna. To follow Klarna’s shipping policy, you must only submit a capture request when the goods or services are ready to be shipped.

We strongly recommend including a trackingId in yourcapture order modification. A trackingId is the identifier that you and your delivery company use to track the delivery of your order.

Supplying this guarantees your payment with Klarna. It also reduces the chance of chargebacks being passed back to you.

trackingId is an attribute of the child element <shippingInfo>. One order can have multiple trackingId's. This is to cater for individual shipments of multiple items within one order.

Submit the <orderLines> element with its respective trackingId only for items that you want to capture at this time.

Note: The trackingId is alphanumeric and must not exceed 100 characters.

An example order modification with trackingId and <orderLines>:

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService merchantCode="YOUR_MERCHANT_CODE" version="1.4">
    <modify>
        <orderModification orderCode="ORDER_CODE">
            <capture>
                <amount value="1" currencyCode="GBP" exponent="2" debitCreditIndicator="credit"/>
                <shipping>
                    <shippingInfo trackingId="AAA0000000"/>
                    <shippingInfo trackingId="BBB0000000"/>
                    <shippingInfo trackingId="XXX0000000"/>
                </shipping>
                <orderLines>
                    <orderTaxAmount>1</orderTaxAmount>
                    <termsURL>http://www.merchant.com/terms</termsURL>
                    <lineItem>
                        <physical/>
                        <reference>123050</reference>
                        <name>Tomatoes</name>
                        <quantity>3</quantity>
                        <quantityUnit>kg</quantityUnit>
                        <unitPrice>1</unitPrice>
                        <taxRate>0</taxRate>
                        <totalAmount>3</totalAmount>
                        <totalTaxAmount>0</totalTaxAmount>
                        <totalDiscountAmount>0</totalDiscountAmount>
                    </lineItem>
                </orderLines>
            </capture>
        </orderModification>
    </modify>
</paymentService>

Cancel

Cancel the full order value at the AUTHORISED status.

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService merchantCode="YOUR_MERCHANT_CODE" version="1.4">
    <modify>
        <orderModification orderCode="ORDER_CODE">
            <cancel/>
        </orderModification>
    </modify>
</paymentService>

Refund

Full, partial and multiple partial refunds are allowed for Klarna payments up to the value of the captured amount.

You can submit the <orderLines> that you want to refund at this time.

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService merchantCode="YOUR_MERCHANT_CODE" version="1.4">
    <modify>
        <orderModification orderCode="ORDER_CODE">
            <refund>
                <amount value="100" currencyCode="EUR" exponent="2" debitCreditIndicator="credit"/>
                <orderLines>
                    <orderTaxAmount>1</orderTaxAmount>
                    <termsURL>http://www.merchant.com/terms</termsURL>
                    <lineItem>
                        <physical/>
                        <reference>123050</reference>
                        <name>Tomatoes</name>
                        <quantity>1</quantity>
                        <quantityUnit>kg</quantityUnit>
                        <unitPrice>1</unitPrice>
                        <taxRate>0</taxRate>
                        <totalAmount>1</totalAmount>
                        <totalTaxAmount>1</totalTaxAmount>
                        <totalDiscountAmount>0</totalDiscountAmount>
                    </lineItem>
                </orderLines>
            </refund>
        </orderModification>
    </modify>
</paymentService>

Extended Authorisation

You can request Klarna extend the authorisation period beyond the standard 28 days.

If your request is successful the order is extended by 30 days - 58 days in total.

You can request the extension in one of two ways.

Through the MAI

Extended Auth

Through an order modification

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService merchantCode="YOUR_MERCHANT_CODE" version="1.4">
  <modify>
    <orderModification orderCode="ORDER_CODE">
      <extendExpiryDate/>
    </orderModification>
  </modify>
</paymentService>