The following API resources must be called before making a Klarna Payment.
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 endpoint before any payments are started.
More information on the JSON object for the merchant data can be found here: Klarna.Docs - Attachment Schema
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:
> 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\": \"[email protected]\",
\"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