Pick the Create a session action (under Payments).
Fill in the fields below, then reference the result from later steps as {{createASession.response.data}}.
Request
Request body
Enter the body as JSON in the step's Body field.
acquiring_channelstring
The acquiring channel in which the session takes place. Ecommerce is default unless specified. Any other values should be defined in the agreement.
One ofECOMMERCEIN_STORETELESALES
attachmentany
Extra Merchant Data (additional information) required for additional risk check. The required parameters will be described in the appendix of contract agreement.
authorization_tokenstring
Authorization token.
billing_addressany
Provide the billing address of the customer, if you have collected already. If not, then Klarna will collect the details inside the iFrame before authorization.
client_tokenstring
Token to be passed to the JS client
custom_payment_method_idsarray<string>
Promo codes - The array could be used to define which of the configured payment options within a payment category (pay_later, pay_over_time, etc.) should be shown for this purchase. Discuss with the delivery manager to know about the promo codes that will be configured for your account. The feature could also be used to provide promotional offers to specific customers (eg: 0% financing). Please be informed that the usage of this feature can have commercial implications.
customerany
Object to provide the details of the customer making the payment.
designstring
Design package to use in the session. This can only by used if a custom design has been implemented for Klarna Payments and agreed upon in the agreement. It might have a financial impact. Delivery manager will provide the value for the parameter.
expires_atstring (date-time)
Session expiration date
localestring
Used to define the language and region of the customer. The locale follows the format of [RFC 1766](https://datatracker.ietf.org/doc/rfc1766/), meaning its value consists of language-country. Default value is "en-US".
Read more on **[Supported Locals and Currencies](https://docs.klarna.com/klarna-payments/in-depth-knowledge/puchase-countries-currencies-locales/)**.
merchant_datastring
Pass through field to send any information about the order to be used later for reference while retrieving the order details (max 6000 characters)
merchant_reference1string
Used for storing merchant's internal order number or other reference.
merchant_reference2string
Used for storing merchant's internal order number or other reference. The value is available in the settlement files. (max 255 characters).
merchant_urlsany
Used to send in the different merchant URLs that Klarna needs at different stages of the process.
optionsany
Design customization options for the Klarna Payments iframe. The design options are limited to changing colors. It is not possible to change the font or other designs at the moment.
order_amountinteger (int64)required
Total amount of the order including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Euros should be 2500.
order_linesarray<object>required
The array containing list of line items that are part of this order. Maximum of 1000 line items could be processed in a single order.
image_urlstring
URL to an image that can be later embedded in communications between Klarna and the customer. (max 1024 characters).
A minimum of 250x250 px resolution is recommended for the image to look good in the Klarna app, and below 50x50 px won't even show. We recommend using a good sized image (650x650 px or more), however the file size must not exceed 12MB.
merchant_datastring
Used for storing merchant's internal order number or other reference. Pass through field. (max 1024 characters)
namestringrequired
Descriptive name of the order line item.
product_identifiersany
Additional information identifying the order line item.
product_urlstring
URL to the product in the merchant’s webshop that can be later used in communications between Klarna and the customer. (max 1024 characters)
quantityinteger (int64)required
Quantity of the order line item. Must be a non-negative number.
quantity_unitstring
Unit used to describe the quantity, e.g. kg, pcs, etc. If defined the value has to be 1-8 characters.
referencestring
Client facing article number, SKU or similar. Max length is 256 characters.
tax_rateinteger (int64)
Tax rate of the order line. Non-negative value. The percentage value is represented with two implicit decimals. I.e 2000 = 20%.
total_amountinteger (int64)required
Total amount of the order line. Must be defined as minor units. Includes tax and discount. Eg: 2000=20 euros
Value = (quantity x unit_price) - total_discount_amount.
(max value: 200000000)
total_discount_amountinteger (int64)
Non-negative minor units. Includes tax. Eg: 500=5 euros
total_tax_amountinteger (int64)
Total tax amount of the order line. Must be within ±1 of total_amount - total_amount 10000 / (10000 + tax_rate). Negative when type is discount.
typestring
Type of the order line item.
One ofphysicaldiscountshipping_feesales_taxdigitalgift_cardstore_creditsurcharge
unit_priceinteger (int64)required
Price for a single unit of the order line. Must be defined as minor units and exclude any discount. Typically including taxes, however some countries may include specific requirements, see [Tax handling guidelines](https://docs.klarna.com/payments/web-payments/additional-resources/error-handling-and-validations/tax-handling/) for further details. (max value: 200000000)
subscriptionany
Subscription details
order_tax_amountinteger (int64)
Total tax amount of the order. The value should be in non-negative minor units. Eg: 25 Euros should be 2500.
payment_method_categoriesarray<object>
Available payment method categories
asset_urlsany
Asset URLs for the payment method. Using this dynamic asset will make sure that any design update of Klarna will automatically be propagated.
identifierstring
ID of the payment method category to be used while loading the widget later.
The possible values are:<ul><li>klarna</li><li>pay_later</li><li>pay_now</li><li>pay_over_time</li><li>direct_bank_transfer</li><li>direct_debit</li></ul>
namestring
Name of the payment method category. These names are dynamic depending on what payment method is in the category. Using this dynamic asset will make sure that any copy update of Klarna will automatically be propagated, or any updates of included payment methods by you.
purchase_countrystringrequired
The purchase country of the customer. The billing country always overrides purchase country if the values are different. Formatted according to ISO 3166 alpha-2 standard, e.g. GB, SE, DE, US, etc.
purchase_currencystringrequired
The purchase currency of the order. Formatted according to ISO 4217 standard, e.g. USD, EUR, SEK, GBP, etc.
shipping_addressany
The shipping address of the consumer. Please note that this is not needed unless the customer has explicitly chosen to enter a separate shipping address. Otherwise the billing address will be automatically cloned.
statusstring
The current status of the session. Possible values: 'complete', 'incomplete' where 'complete' is set when the order has been placed.
One ofcompleteincomplete
intentstring
Intent for the session. The field is designed to let partners inform Klarna of the purpose of the customer’s session.
One ofbuytokenizebuy_and_tokenize
step_up_idstring
Step-up recovery identifier obtained from a failed token charge. Use this ID to create a recovery session for customer flow.
Returns 200 with an object. Read it in later steps with {{createASession.response.data.<field>}}.
client_tokenstring
Client token to be passed to the JS client while initializing the JS SDK in the next step.
payment_method_categoriesarray<object>
Available payment method categories for this particular session
asset_urlsany
Asset URLs for the payment method. Using this dynamic asset will make sure that any design update of Klarna will automatically be propagated.
identifierstring
ID of the payment method category to be used while loading the widget later.
The possible values are:<ul><li>klarna</li><li>pay_later</li><li>pay_now</li><li>pay_over_time</li><li>direct_bank_transfer</li><li>direct_debit</li></ul>
namestring
Name of the payment method category. These names are dynamic depending on what payment method is in the category. Using this dynamic asset will make sure that any copy update of Klarna will automatically be propagated, or any updates of included payment methods by you.
session_idstring
ID of the created session. Please use this ID to share with Klarna for identifying any issues during integration.
json
{"client_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJzZXNzaW9uX2lkIiA6ICIw","session_id":"0b1d9815-165e-42e2-8867-35bc03789e00","payment_method_categories":[{"asset_urls":null,"identifier":"klarna","name":"Pay with Klarna"}]}
Need more? See the Klarna guide for connection setup and behaviour shared by every action.