Skip to content

Create session



Target audience: Developers

Create purchase session


This endpoint creates a klarna payments purchase session. Needed for placing a klarna payments order.


This API gives access to Klarna payments related endpoints. Since this section is quite specific it has it's own section of documentation. See here for more information.


Environment URI


Identity Scope



Curl example

curl --request POST \
  --url \
  --header 'authorization: Bearer <token-with-identity>' \
  --header 'content-type: application/json' \
  --data '{
    "code": "adeprimo_digital",
    "period_type": "recurring",
    "period_id": "5f0d9ea795cfebfb8544ab12,",
    "confirmation_url": ""


The request should be sent as application/json.

Parameter Description Required Format
code The code of the package or campaign e.g. adeprimo_digital Yes String
period_type limited or recurring. Always set to recurring for campaigns Yes String
period_id Specific payment period id. Required for trial orders For trial orders but not regular orders. Use payment periods API for fetching available payment periods String
confirmation_url URL to your confirmation page for the customer Yes String


The response is sent as application/json.

Example of a successful response:

  "item": {
    "klarna_payments_session_id": "5aba2ca36fc93613f8000012",
    "klarna_client_token": "eyJhbGciOIJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjAwMDAwMDAwMDAtMDAwMDAtMDAwMC0wMDAwMDAwMC0wMDAwIiwidXJsIjoiaHR0cHM6Ly9jcmVkaXQtZXUua2xhcm5hLmNvbSJ9.A_rHWMSXQN2NRNGYTREBTkGwYwtm-sulkSDMvlJL87M",
    "payment_method_categories": [
            "identifier": "direct_debit",
            "name": "Bankkonto",
            "asset_urls": {
              "descriptive": "",
              "standard": ""
            "identifier": "pay_later",
            "name": "Få först. Betala sen.",
            "asset_urls": {
              "descriptive": "",
              "standard": ""

Parameter Description
klarna_payments_session_id The id of the session that you just created. This is needed when you place the order. You should store this in the user's session in your backend
klarna_client_token You need to use this token when you build the Klarna Payments Widget on your site
payment_method_categories Payment methods available for that payment session


This API uses the common error conventions of the Payway API

See common error responses