---
title: "Klarna"
description: "The following API resources must be called before making a Klarna Payment."
canonical: "https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/payment-method-details/klarna"
---

# Klarna

> The following API resources must be called before making a Klarna Payment.

Source: https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/payment-method-details/klarna

The following API resources must be called before making a Klarna Payment.

- [Create a shopper address](https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/resources/shoppers#create-new-shopper)
- [Create a new order with billing address key](https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/resources/orders#create-order)
- [Create order items](https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/resources/order-items#create-order-items)

For specific use cases like Airline/Bus/Train/Ferry/Hotel/Car Reservations, Events or Vouchers, Klarna requires additional merchant data. This merchant data can be added to the Order with the [Payment Method Data](https://docs.cm.com/payments/online-payments-legacy/guides/api-reference/resources/payment-method-data) endpoint before any payments are started.

More information on the JSON object for the merchant data can be found here: [Klarna Docs - Extra Merchant Data](https://docs.klarna.com/acquirer/klarna/api/extra-merchant-data/)

**Note**: Only the body content needs to be provided, not the body envelop or the content type which will be added by the Payment System.

```
    // INCORRECT
    {
    "body" : {
      "hotel_reservation_details" : [ ... ],
      "air_reservation_details" : [ ... ]
    },
    "content_type": "application/vnd.klarna.internal.emd-v2+json"
    }

    // CORRECT
    {
    "hotel_reservation_details" : [ ... ],
    "air_reservation_details" : [ ... ]
    }
```

**Klarna Hotel Reservation Details example**

Command line:

```bash
> curl \
    -X POST \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders/F1499C097FFA533D46FB05D52680AB9A/additional_data \
    -d '{
          "method": "KLARNA",
          "data": "{
            \"hotel_reservation_details\": [
              {
                \"pnr\": \"VH67899\",
                \"hotel_intinerary\": [
                  {
                    \"hotel_name\": \"Hotel ltd.\",
                    \"address\": {
                      \"street_address\": \"Storgatan 3\",
                      \"postal_code\": \"113 35\",
                      \"city\": \"Stockholm\",
                      \"country\": \"Sweden\"
                    },
                    \"start_time\": \"2019-01-31T15:00:00Z\",
                    \"end_time\": \"2019-01-31T15:30:00Z\",
                    \"number_of_rooms\": 2,
                    \"ticket_delivery_method\": \"email\",
                    \"ticket_delivery_recipient\": \"jonas.larlsson@klarna.com\",
                    \"hotel_price\": 23050,
                    \"class\": \"Business\",
                    \"passenger_id\": [
                      1
                    ]
                  }
                ],
                \"passengers\": [
                  {
                    \"id\": 1,
                    \"title\": \"mr\",
                    \"first_name\": \"Adam\",
                    \"last_name\": \"Adamson\"
                  }
                ],
                \"insurance\": [
                  {
                    \"insurance_company\": \"Insurance Company X\",
                    \"insurance_type\": \"travel\",
                    \"insurance_price\": 0
                  }
                ],
                \"affiliate_name\": \"TradeMaxi AB\"
              }
            ]"
        }'
 
< Http 201 Created
```
