/place_trial_order

/klarna_payments/place_trial_order

Info

Target audience: Developers
Release version: 4.2.3.1

Introduction

This endpoint creates a klarna payments trial order. Meaning a free campaign that transitions to a standard subscription. The purchase session used to initiate the purchase must support this.

Attention

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.

Klarna payments only supports the use of Direct Debit when doing 0 amount purchases. This requires you to initialize your klarna widget correctly.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/klarna_payments/place_trial_order
Production https://backend.worldoftulo.com/external/api/v1/klarna_payments/place_trial_order

Requirements

Identity Scope
Yes /external/klarna_payments/w

Curl example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
curl --request POST \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/klarna_payments/place_trial_order \
  --header 'authorization: Bearer <token-with-identity>' \
  --header 'content-type: application/json' \
  --data '{
    "klarna_authorization_token": "klarna_authorization_token, received from klarna widget",
    "klarna_payments_session_id": "klarna_payments_session_id, received from create_session",
    "browser_ip": "81.208.13.50",
    "browser_language": "sv-SE",
    "browser_user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
    "traffic_source": "facebook",
    "raise_on_ssn_already_taken_error": true/false
    "raise_on_ssn_already_set_error": true/false
    "raise_on_account_update_error": true/false
    "raise_on_delivery_address_error": true/false
  }'

Request parameters

The request should be sent as application/json.

Parameter Description Default value Required
klarna_authorization_token The authorization token you aquired in step 4. Yes
klarna_payments_session_id The id of the session that was returned to you in the create_session call in step 2. Yes
browser_ip The ip of the browser e.g. 81.208.13.50 Yes
browser_language The browser language e.g. sv-SE Yes
browser_user_agent The user agent Yes
traffic_source The source of the purchase. E.g. facebook, web. Traffic sources need to be setup in PAP No
raise_on_ssn_already_taken_error If set to true the request will raise an exception if the ssn is already taken by another user in Payway true No
raise_on_ssn_already_set_error If set to true the request will raise an exception if an ssn update is performed on a user with an ssn false No
raise_on_account_update_error If set to true the request will raise an exception if errors are encountered during an account update. An account update consists of "name", "birth date" and "account address" updates. false No
raise_on_delivery_address_error If set to true the request will raise an exception if errors are encountered during the order delivery address validation false No

Response

The response is sent as application/json.

Example:

1
2
3
4
5
6
7
{
  "item": {
    "redirect_url": "http://url.to.klarna.se",
    "pw_order_id": "ORDER-123",
    "klarna_order_id": "c8328e81-d476-4e7d-9d03-5ae228240943"
  }
}

Parameter Description
redirect_url Url where you should redirect the user
pw_order_id Payway order-id
klarna_order_id Klarna order-id

Errors

This API uses the common error conventions of the Payway API

See common error responses