Introduction


The Klarna Checkout REST API is the underlying interface for all our available client libraries.
This reference guide was created for those who are developing for platforms currently not supported by our client libraries, or those who are interested in diving into the details of our API.


Entry points

The Klarna Checkout API can be accessed from the following entry points, depending on the environment you are working in:
 

https://checkout.klarna.com/checkout/orders - For transactions in the live environment

https://checkout.testdrive.klarna.com/checkout/orders - For test transactions in Klarna's testing environment.

HTTPS vs HTTP

To help ensure data security, only HTTPS is allowed. HTTP is not supported.
 

JSON, Unicode

JSON is used across all communications as the syntax of the media-types. Only JSON's default UTF-8 encoding is supported.


Authorization


Every API request has to be authenticated by using the Authentication HTTP request header. Only a proprietary Klarna authentication scheme is supported, in the format of Klarna authorization header.

The authorization header is calculated for each request using these steps of this formula: base64 (sha256 (request_payload + shared_secret)), where

  • request_payload is the payload of the request, or an empty string for GET requests
  • shared_secret is the secret key assigned to your EID by Klarna

Authorization: Klarna pwhcueUff0MmwLShJiBE9JHA==


Resource structure

Legend

O, optional

M, mandatory

R, read only

 checkout_complete / created  
 checkout_incomplete  
    
NameDescription  
idUnique identifier of the Klarna Checkout OrderRR
merchant_referenceContainer for merchant reference. Currently supported keys are orderid1 and orderid2OO
purchase_countryCountry in which the purchase is done (ISO-3166-alpha2)MR
purchase_currencyCurrency in which the purchase is done (ISO-4217)MR
localeLocale indicative for language & other location-specific details (RFC1766)MR
statusStatus. `checkout_incomplete` by default, alternatively `checkout_complete`, `created`RO
referenceEnd-consumer friendly referenceRR
reservationReservation number to be used in the XML-RPC APIRR
started_atTimestamp of when the Checkout started (ISO-8601)RR
completed_atTimestamp of when the Checkout was completed (ISO-8601)RR
created_atTimestamp of when the Order was created (ISO-8601)RR
last_modified_atTimestamp of when the Checkout was last modified (ISO-8601)RR
expires_atTimestamp of when the Checkout will expire (ISO-8601)RR
billing_addressBilling address
billing_address.given_nameGiven nameRR
billing_address.family_nameFamily nameRR
billing_address.care_ofc/oRR
billing_address.street_addressOnly in Sweden, Norway and Finland: Street address (street name, street number, street extension)RR
billing_address.street_nameOnly in Germany: Street nameRR
billing_address.street_numberOnly in Germany: Street numberRR
billing_address.postal_codePostal codeRR
billing_address.cityCityRR
billing_address.countryCountry (ISO-3166 alpha)RR
billing_address.emailE-mail addressRR
billing_address.phonePhone numberRR
billing_address.titleOnly in Germany: The customer's title, possible values are "Herr" and "Frau"RR
shipping_addressShipping address
shipping_address.given_nameGiven nameOR
shipping_address.family_nameFamily nameOR
shipping_address.care_ofc/oOR
shipping_address.street_addressOnly in Sweden, Norway and Finland: Street address (street name, street number, street extension)OR
shipping_address.street_nameOnly in Germany: Street nameOR
shipping_address.street_numberOnly in Germany: Street numberOR
shipping_address.postal_codePostal codeOR
shipping_address.cityCityOR
shipping_address.countryCountry (ISO-3166 alpha)OR
shipping_address.emailE-mail addressOR
shipping_address.phonePhone numberOR
shipping_address.titleOnly in Germany: The customer's title, possible values are "Herr" and "Frau"OR
cartCart
cart.total_price_excluding_taxTotal price (excluding tax) in centsRR
cart.total_tax_amountTotal tax amount in centsRR
cart.total_price_including_taxTotal price (including tax) in centsRR
cart.itemsList of cart items
cart.items[0].typeType. `physical` by default, alternatively `discount`, `shipping_fee`OR
cart.items[0].eanThe item's International Article Number. Please note this property is currently not returned when fetching the full order resource.OR
cart.items[0].referenceReference, usually the article numberMR
cart.items[0].nameName, usually a short descriptionMR
cart.items[0].uriItem product page URI. Please note this property is currently not returned when fetching the full order resource.OR
cart.items[0].image_uriItem image URI. Please note this property is currently not returned when fetching the full order resource.OR
cart.items[0].quantityQuantityMR
cart.items[0].unit_priceUnit price in cents, including taxMR
cart.items[0].total_price_excluding_taxTotal price (excluding tax) in centsRR
cart.items[0].total_tax_amountTotal tax amount, in centsRR
cart.items[0].total_price_including_taxTotal price (including tax) in centsRR
cart.items[0].discount_ratePercentage of discount, multiplied by 100 and provided as an integer. i.e. 9.57% should be sent as 957OR
cart.items[0].tax_ratePercentage of tax rate, multiplied by 100 and provided as an integer. i.e. 13.57% should be sent as 1357MR
customerCustomer
customer.date_of_birthIf provided by customer, or retrieved from national ID. The customer's birthdate (YYYY-MM-DD)OR
customer.genderRetrieved from national ID or billing_address.title in Germany. 'female' or 'male'OR
customer.typeType. Currently the only supported value is 'person'RR
guiGUI
gui.layoutLayout. `desktop` by default, alternatively `mobile`OR
gui.optionsAn array of options to define the checkout behaviour. Supported options `disable_autofocus`.OR
gui.snippetHTML snippetRR
merchantMerchant
merchant.idUnique identifier (EID)MR
merchant.terms_uriURI of your terms and conditionsMR
merchant.checkout_uriURI of your checkout pageMR
merchant.confirmation_uriURI of your confirmation pageMR
merchant.push_uriURI of your push-notification pageMR
merchant.validation_uriURI of your validation page, see validate a checkout order.OR
attachmentAdditional purchase information required for some industries, see here.
attachment.content_typeString.OR
attachment.bodyString.OR
external_payment_methodsExternal payment methods
external_payment_methods.nameStringMR
external_payment_methods.redirect_uriURI of external payment method pageMR
external_payment_methods.image_uriURI of external payment method image (https://)OR
external_payment_methods.feeFee in cents, including taxOR
external_payment_methods.descriptionOptional. 500 character limit. Links can be set with the Markdown syntax [Text](URL)OR
external_checkoutsExternal checkout providers
external_checkouts.nameStringMR
external_checkouts.redirect_uriURI of external payment method pageMR
external_checkouts.image_uriURI of external payment method image (https://)OR
external_checkouts.feeFee in cents, including taxOR
optionsCustom design options, read more here.
options.color_buttonOnly hexadecimal values are allowed.OR
options.color_button_textOnly hexadecimal values are allowed.OR
options.color_checkboxOnly hexadecimal values are allowed.OR
options.color_checkbox_checkmarkOnly hexadecimal values are allowed.OR
options.color_headerOnly hexadecimal values are allowed.OR
options.color_linkOnly hexadecimal values are allowed.OR
options.shipping_detailsShipping information displayed on the confirmation page. Maximum 70 characters.OR
options.phone_mandatoryMaking the phone field mandatory (Only available in Germany and Austria)OR
options.allow_seperate_shipping_addressTo allow separate shipping addresses (Only available in Germany and Austria)OR
options.packstation_enabledEnable packstation (Only available in Germany)OR
options.date_of_birth_mandatoryMaking the date of birth mandatory (Type: Boolean)OR

Errors

Klarna uses conventional HTTP response codes to indicate success or failure of an API call. 

Status codeDescription
200OKThe request was successful.
201CreatedThe request was successful and created a new resource at the URI described by the `Content-Location` response header
400Bad RequestThe request did not pass validation due to syntax or semantic errors. Error message should indicate the error.
401UnauthorizedAuthentication failed due to an invalid or missing `Authentication` request header.
403ForbiddenThe server refused to fulfil it.
404Not FoundThere is no resource matching the request URI.
405Method Not AllowedThe resource did not expected the request method.
406Not AcceptableThe server cannot fulfil the `Accept` request header.
415Media Type Not SupportedThe server does not support the media-type specified by the `Content-Type` request header.
 

Versioning

The Klarna Checkout API is versioned through custom media types. When we make changes to the API which are not backwards compatible, we will increment the version number in the media type.

Current version: application/vnd.klarna.checkout.aggregated-order-v2+json


Supported locales

The locale configuration in Klarna Checkout affects the iframe language and all further communication made between Klarna and the consumer.

This table specifies the supported combinations of country, currently and locale. 

CountryLanguagepurchase_countrypurchase_currencylocale
SwedenSwedishSESEKsv-se
FinlandFinnishFIEURfi-fi
FinlandSwedishFIEURsv-fi
NorwayNorwegianNONOKnb-no
 
GermanyGermanDEEURde-de
AustriaGermanATEURde-at
 

Resources

Aggregated Order

Create

Overview

  • Description: Create a new Checkout Order resource
     
  • Request
    • Method: POST
    • URI: https://checkout.testdrive.klarna.com/checkout/orders
    • Accept: application/vnd.klarna.checkout.aggregated-order-v2+json
    • Content-Type: application/vnd.klarna.checkout.aggregated-order-v2+json
    • Body: ...
       
  • Response
    • Location: URI of the new Checkout Order resource

HTTP Request

Once the order is created, the order will contain a HTML snippet that needs to be embedded on your Checkout page.

POST https://checkout.testdrive.klarna.com/checkout/orders HTTP/1.1
Accept: application/vnd.klarna.checkout.aggregated-order-v2+json
Authorization: Klarna pwhcueUff0MmwLShJiBE9JHA==
Content-Type: application/vnd.klarna.checkout.aggregated-order-v2+json

{
    "merchant_reference": {
        "orderid1": "123456789",
        "orderid2": "123456789"
    },
    "purchase_country": "se",
    "purchase_currency": "sek",
    "locale": "sv-se",
    "cart": {
        "items": [
        {
            "reference": "123456789",
            "name": "Klarna t-shirt",
            "quantity": 2,
            "ean": "1234567890123",
            "uri": "http://example.com/product.php?123456789",
            "image_uri": "http://example.com/product_image.php?123456789",
            "unit_price": 12300,
            "discount_rate": 1000,
            "tax_rate": 2500
        },
        {
            "type": "shipping_fee",
            "reference": "SHIPPING",
            "name": "Shipping fee",
            "quantity": 1,
            "unit_price": 4900,
            "tax_rate": 2500
        }
        ]
    },
    "shipping_address": {
        "given_name": "Testperson-se",
        "family_name": "Approved",
        "street_address": "Stårgatan 1",
        "postal_code": "12345",
        "city": "Ankeborg",
        "country": "se",
        "email": "checkout@testdrive.klarna.com",
        "phone": "0765260000"
    },
    "gui": {
        "layout": "desktop"
    },
    "merchant": {
        "id": "0",
        "terms_uri": "http://example.com/terms.php",
        "checkout_uri": "https://example.com/checkout.php",
        "confirmation_uri": "https://example.com/thankyou.php?sid=123&klarna_order={checkout.order.uri}",
        "push_uri": "https://example.com/push.php?sid=123&klarna_order={checkout.order.uri}"
    }
}

HTTP Response

201 (Created)
Content-Type: application/vnd.klarna.checkout.aggregated-order-v2+json
Location: https://checkout.testdrive.klarna.com/checkout/orders/{id}

Read

Overview

  • Description: Read a Checkout Order resource
     
  • Request
    • Method: GET
    • URI: https://checkout.testdrive.klarna.com/checkout/orders/{id}
    • Accept: application/vnd.klarna.checkout.aggregated-order-v2+json
    • Content-Type: -
    • Body: -
       
  • Response
    • A representation of the Checkout Order

HTTP Request

GET https://checkout.testdrive.klarna.com/checkout/orders/{id} HTTP/1.1
Accept: application/vnd.klarna.checkout.aggregated-order-v2+json
Authorization: Klarna pwhcueUff0MmwLShJiBE9JHA==

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/vnd.klarna.checkout.aggregated-order-v2+json

{
    "id": "1A2B3C4D5E6F1A2B3C4D5E6F",
    "merchant_reference": {
        "orderid1": "123456789",
        "orderid2": "123456789"
    },
    "purchase_country": "se",
    "purchase_currency": "sek",
    "locale": "sv-se",
    "status": "created",
    "reference": "Q1W2E3",
    "reservation": "123456789",
    "started_at": "2012-01-18T11:45:00+01:00",
    "completed_at": "2012-01-18T11:51:00+01:00",
    "created_at": "2012-01-18T11:52:00+01:00",
    "last_modified_at": "2012-01-18T11:52:00+01:00",
    "expires_at": "2012-02-01T11:52:00+01:00",
    "shipping_address": {
        "given_name": "Testperson-se",
        "family_name": "Approved",
        "care_of": "Testperson",
        "street_address": "Stårgatan 1",
        "postal_code": "12345",
        "city": "Ankeborg",
        "country": "se",
        "email": "checkout@testdrive.klarna.com",
        "phone": "0765260000"
    },
    "billing_address": {
        "given_name": "Testperson-se",
        "family_name": "Approved",
        "care_of": "Testperson",
        "street_address": "Stårgatan 1",
        "postal_code": "12345",
        "city": "Ankeborg",
        "country": "se",
        "email": "checkout@testdrive.klarna.com",
        "phone": "0765260000"
    },
    "cart": {
        "total_price_excluding_tax": 20280,
        "total_tax_amount": 6760,
        "total_price_including_tax": 27040,
        "items": [
        {
            "reference": "123456789",
            "name": "Klarna t-shirt",
            "quantity": 2,
            "unit_price": 12300,
            "discount_rate": 1000,
            "tax_rate": 2500,
            "total_price_excluding_tax": 16605,
            "total_tax_amount": 5535,
            "total_price_including_tax": 22140,
        },
        {
            "type": "shipping_fee",
            "reference": "SHIPPING",
            "name": "Shipping fee",
            "quantity": 1,
            "unit_price": 4900,
            "tax_rate": 2500,
            "total_price_excluding_tax": 3675,
            "total_tax_amount": 1225,
            "total_price_including_tax": 4900,
        }
        ]
    },
    "customer": {
        "type": "person",
    },
    "gui": {
        "layout": "desktop",
        "snippet": "..."
    },
    "merchant": {
        "id": "0",
        "terms_uri": "http://example.com/terms.php",
        "checkout_uri": "https://example.com/checkout.php",
        "confirmation_uri": "https://example.com/thankyou.php?sid=123&klarna_order={checkout.order.uri}",
        "push_uri": "https://example.com/push.php?sid=123&klarna_order={checkout.order.uri}"
    }
}

Update

Overview

  • Description: Update a Checkout Order resource
     
  • Request
    • Method: POST
    • URI: https://checkout.testdrive.klarna.com/checkout/orders/{id}
    • Accept: application/vnd.klarna.checkout.aggregated-order-v2+json
    • Content-Type: application/vnd.klarna.checkout.aggregated-order-v2+json
    • Body: ...
       
  • Response
    • An updated representation of the Checkout Order

HTTP Request

POST https://checkout.testdrive.klarna.com/checkout/orders/{id} HTTP/1.1
Accept: application/vnd.klarna.checkout.aggregated-order-v2+json
Authorization: Klarna pwhcueUff0MmwLShJiBE9JHA==
Content-Type: application/vnd.klarna.checkout.aggregated-order-v2+json

{
    "merchant_reference": {
        "orderid1": "123456789",
        "orderid2": "123456789"
    },
    "purchase_country": "se",
    "purchase_currency": "sek",
    "locale": "sv-se",
    "cart": {
        "items": [
        {
            "reference": "123456789",
            "name": "Klarna t-shirt",
            "quantity": 4,
            "ean": "1234567890123",
            "uri": "http://example.com/product.php?123456789",
            "image_uri": "http://example.com/product_image.php?123456789",
            "unit_price": 12300,
            "discount_rate": 1000,
            "tax_rate": 2500
        },
        {
            "type": "shipping_fee",
            "reference": "SHIPPING",
            "name": "Shipping fee",
            "quantity": 1,
            "unit_price": 4900,
            "tax_rate": 2500
        }
        ]
    },
    "shipping_address": {
        "given_name": "Testperson-se",
        "family_name": "Approved",
        "street_address": "Stårgatan 1",
        "postal_code": "12345",
        "city": "Ankeborg",
        "country": "se",
        "email": "checkout@testdrive.klarna.com",
        "phone": "0765260000"
    },
    "gui": {
        "layout": "desktop"
    },
    "merchant": {
        "id": "0",
        "terms_uri": "http://example.com/terms.php",
        "checkout_uri": "https://example.com/checkout.php",
        "confirmation_uri": "https://example.com/thankyou.php?sid=123&klarna_order={checkout.order.uri}",
        "push_uri": "https://example.com/push.php?sid=123&klarna_order={checkout.order.uri}"
    }
}

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/vnd.klarna.checkout.aggregated-order-v2+json

{
    "id": "1A2B3C4D5E6F1A2B3C4D5E6F",
    "merchant_reference": {
        "orderid1": "123456789",
        "orderid2": "123456789"
    },
    "purchase_country": "se",
    "purchase_currency": "sek",
    "locale": "sv-se",
    "status": "checkout_incomplete",
    "reference": "Q1W2E3",
    "reservation": "123456789",
    "started_at": "2012-01-18T11:45:00+01:00",
    "completed_at": "2012-01-18T11:51:00+01:00",
    "created_at": "2012-01-18T11:52:00+01:00",
    "last_modified_at": "2012-01-18T11:52:00+01:00",
    "expires_at": "2012-02-01T11:52:00+01:00",
    "shipping_address": {
        "given_name": "Testperson-se",
        "family_name": "Approved",
        "care_of": "Testperson",
        "street_address": "Stårgatan 1",
        "postal_code": "12345",
        "city": "Ankeborg",
        "country": "se",
        "email": "checkout@testdrive.klarna.com",
        "phone": "0765260000"
    },
    "cart": {
        "total_price_excluding_tax": 36885,
        "total_tax_amount": 12295,
        "total_price_including_tax": 49180,
        "items": [
        {
            "reference": "123456789",
            "name": "Klarna t-shirt",
            "quantity": 4,
            "unit_price": 12300,
            "discount_rate": 1000,
            "tax_rate": 2500,
            "total_price_excluding_tax": 33210,
            "total_tax_amount": 11070,
            "total_price_including_tax": 44280,
        },
        {
            "type": "shipping_fee",
            "reference": "SHIPPING",
            "name": "Shipping fee",
            "quantity": 1,
            "unit_price": 4900,
            "tax_rate": 2500,
            "total_price_excluding_tax": 3675,
            "total_tax_amount": 1225,
            "total_price_including_tax": 4900,
        }
        ]
    },
    "customer": {
        "type": "person",
    },
    "gui": {
        "layout": "desktop",
        "snippet": "..."
    },
    "merchant": {
        "id": "0",
        "terms_uri": "http://example.com/terms.php",
        "checkout_uri": "https://example.com/checkout.php",
        "confirmation_uri": "https://example.com/thankyou.php?sid=123&klarna_order={checkout.order.uri}",
        "push_uri": "https://example.com/push.php?sid=123&klarna_order={checkout.order.uri}"
    }
}

Recurring Order

Create

Overview

  • Description: Create a new Recurring Checkout Order resource. You must first have created a aggregated order with the option "recurring" set to true and then use the recurring_token returned on the resource
     
  • Request
    • Method: POST
    • URI: https://checkout.testdrive.klarna.com/checkout/recurring/{recurring_token}/orders
    • Accept: application/vnd.klarna.checkout.recurring­-order-­accepted-­v1+json 
    • Content-Type: application/vnd.klarna.checkout.recurring-­order­-v1+json
    • Body: ...
       
  • Response
    • See examples below

HTTP Request

POST /checkout/recurring/{recurring_token}/orders HTTP/1.1
Accept: application/vnd.klarna.checkout.recurring­-order-­accepted-­v1+json 
Authorization: Klarna o4qs59NZqPKm6IDr6E/GNA==
Content-­Type: application/vnd.klarna.checkout.recurring-­order­-v1+json

{
    "activate": true,
    "cart": {
        "items": [
            {
                "type": "physical",
                "reference": "123456789",
                "name": "Tomatoes (Spain)",
                "quantity": 2,
                "unit_price": 950,
                "discount_rate": 1000,
                "tax_rate": 2500
            },
            {
                "type": "physical",
                "reference": "987654321",
                "name": "Rotten Tomatoes",
                "quantity": 2,
                "unit_price": -100,
                "discount_rate": 0,
                "tax_rate": 0
            }
        ]
    },
    "billing_address": {
        "postal_code": "11218",
        "email": "checkout@testdrive.klarna.com",
        "country": "se",
        "city": "Stockholm",
        "family_name": "Burru",
        "given_name": "Burrusson",
        "street_address": "Burrugatan 12",
        "phone": "0701234567"
    },
    "shipping_address": {
        "postal_code": "11218",
        "email": "checkout@testdrive.klarna.com",
        "country": "se",
        "city": "Stockholm",
        "family_name": "Burru",
        "given_name": "Burrusson",
        "street_address": "Burrugatan 12",
        "phone": "0701234567"
    },
    "purchase_currency": "sek",
    "purchase_country": "se",
    "locale": "sv­se",
    "merchant_reference": {
        "id1": "123456789",
        "id2": "123456789"
    },
    "merchant": {
        "id": "2"
    }
}

HTTP Response

Approved - Auto activate

HTTP/1.1 200 OK
Content­-Type: application/vnd.klarna.checkout.recurring­-order-­accepted­-v1+json

{
    "invoice": "{{_}}"
}

Approved - No auto activate

HTTP/1.1 200 OK
Content­-Type: application/vnd.klarna.checkout.recurring­-order-­accepted­-v1+json

{
    "reservation": "{{_}}"
}

Denied - Not accepted billing country

HTTP/1.1 403 Forbidden
Content-­Type: application/vnd.klarna.error­-v1+json

{
    "http_status_code": 403,
    "http_status_message": "Forbidden",
    "internal_message": "not_accepted_billing_country"
}

Denied - Service unavailable

HTTP/1.1 503 Service Unavailable
Content-­Type: application/vnd.klarna.error­-v1+json

{
    "http_status_code": 503,
    "http_status_message": "Service Unavailable"
}

Denied - Forbidden

HTTP/1.1 403 Forbidden
Content­-Type: application/vnd.klarna.error­-v1+json

{
    "http_status_code": 403,
    "http_status_message": "Forbidden",
    "internal_message": "forbidden_token"
}

Denied - Rejected invoice

Reasons:

  • address
  • rejected
HTTP/1.1 402 Payment Required
Content-­Type: application/vnd.klarna.checkout.recurring-­order­-rejected­-v1+json

{
    "reason": "{{<rejected_rc}}",
    "payment_method": {
        "type": "invoice"
    }
}

Denied - Credit card

Reasons:

  • temporary_failure
  • limit_exceeded
  • card_expired
  • permanent_failure
HTTP/1.1 402 Payment Required
Content­-Type: application/vnd.klarna.checkout.recurring­-order­-rejected­-v1+json

{
    "reason": "{{<cc_failure}}",
    "payment_method": {
        "type": "credit_card",
        "credit_card_data": {
            "number": "**** **** **** 1234",
            "brand": "VISA",
            "expiry_year": 2014,
            "expiry_month": 10
        }
    }
}

Read

Overview

  • Description: Read a Recurring Checkout Order resource
     
  • Request
    • Method: GET
    • URI: https://checkout.testdrive.klarna.com/checkout/orders/{id}
    • Accept: application/vnd.klarna.checkout.recurring-status-v1+json
    • Content-Type: -
    • Body: -
       
  • Response
    • A representation of the Recurring Checkout Order

HTTP Request

GET https://checkout.testdrive.klarna.com/checkout/orders/{id} HTTP/1.1
Authorization: Klarna o4qs59NZqPKm6IDr6E/GNA==
Accept: application/vnd.klarna.checkout.recurring-status-v1+json

HTTP Response

HTTP/1.1 200 Ok
Content-Type: application/vnd.klarna.checkout.recurring-status-v1+json

{
    "id": "1A2B3C4D5E6F1A2B3C4D5E6F",
    "merchant_reference": {
        "orderid1": "123456789",
        "orderid2": "123456789"
    },
    "purchase_country": "se",
    "purchase_currency": "sek",
    "locale": "sv-se",
    "status": "created",
    "reference": "Q1W2E3",
    "reservation": "123456789",
    "started_at": "2012-01-18T11:45:00+01:00",
    "completed_at": "2012-01-18T11:51:00+01:00",
    "created_at": "2012-01-18T11:52:00+01:00",
    "last_modified_at": "2012-01-18T11:52:00+01:00",
    "expires_at": "2012-02-01T11:52:00+01:00",
    "shipping_address": {
        "given_name": "Testperson-se",
        "family_name": "Approved",
        "care_of": "Testperson",
        "street_address": "Stårgatan 1",
        "postal_code": "12345",
        "city": "Ankeborg",
        "country": "se",
        "email": "checkout@testdrive.klarna.com",
        "phone": "0765260000"
    },
    "billing_address": {
        "given_name": "Testperson-se",
        "family_name": "Approved",
        "care_of": "Testperson",
        "street_address": "Stårgatan 1",
        "postal_code": "12345",
        "city": "Ankeborg",
        "country": "se",
        "email": "checkout@testdrive.klarna.com",
        "phone": "0765260000"
    },
    "cart": {
        "total_price_excluding_tax": 20280,
        "total_tax_amount": 6760,
        "total_price_including_tax": 27040,
        "items": [
        {
            "reference": "123456789",
            "name": "Klarna t-shirt",
            "quantity": 2,
            "unit_price": 12300,
            "discount_rate": 1000,
            "tax_rate": 2500,
            "total_price_excluding_tax": 16605,
            "total_tax_amount": 5535,
            "total_price_including_tax": 22140,
        },
        {
            "type": "shipping_fee",
            "reference": "SHIPPING",
            "name": "Shipping fee",
            "quantity": 1,
            "unit_price": 4900,
            "tax_rate": 2500,
            "total_price_excluding_tax": 3675,
            "total_tax_amount": 1225,
            "total_price_including_tax": 4900,
        }
        ]
    },
    "customer": {
        "type": "person",
    },
    "gui": {
        "layout": "desktop",
        "snippet": "..."
    },
    "merchant": {
        "id": "0",
        "terms_uri": "http://example.com/terms.php",
        "checkout_uri": "https://example.com/checkout.php",
        "confirmation_uri": "https://example.com/thankyou.php?sid=123&klarna_order={checkout.order.uri}",
        "push_uri": "https://example.com/push.php?sid=123&klarna_order={checkout.order.uri}"
    }
}