Menu
Update a session
Update a session
/payments/v1/sessions/{session_id}Use it in a workflow
- Add a step and choose the Klarna connector.
- Pick the Update a session action (under Payments).
- Fill in the fields below, then reference the result from later steps as
{{updateASession.response.data}}.
Request
Path parameters
session_idstringrequiredsession_id
Request body
Enter the body as JSON in the step's Body field.
acquiring_channelstringThe 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
attachmentanyExtra Merchant Data (additional information) required for additional risk check. The required parameters will be described in the appendix of contract agreement.
authorization_tokenstringAuthorization token.
billing_addressanyProvide 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_tokenstringToken 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.
customeranyObject to provide the details of the customer making the payment.
designstringDesign 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
localestringUsed 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. Read more on **[Supported Locals and Currencies](https://docs.klarna.com/klarna-payments/in-depth-knowledge/puchase-countries-currencies-locales/)**.
merchant_datastringPass through field to send any information about the order to be used later for reference while retrieving the order details (max 6000 characters)
merchant_reference1stringUsed for storing merchant's internal order number or other reference.
merchant_reference2stringUsed for storing merchant's internal order number or other reference. The value is available in the settlement files. (max 255 characters).
merchant_urlsanyUsed to send in the different merchant URLs that Klarna needs at different stages of the process.
optionsanyDesign 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)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>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_urlstringURL 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_datastringUsed for storing merchant's internal order number or other reference. Pass through field. (max 1024 characters)
namestringrequiredDescriptive name of the order line item.
product_identifiersanyAdditional information identifying the order line item.
product_urlstringURL 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)requiredQuantity of the order line item. Must be a non-negative number.
quantity_unitstringUnit used to describe the quantity, e.g. kg, pcs, etc. If defined the value has to be 1-8 characters.
referencestringClient 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)requiredTotal 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.
typestringType of the order line item.
One ofphysicaldiscountshipping_feesales_taxdigitalgift_cardstore_creditsurcharge
unit_priceinteger (int64)requiredPrice 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)
subscriptionanySubscription 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_urlsanyAsset URLs for the payment method. Using this dynamic asset will make sure that any design update of Klarna will automatically be propagated.
identifierstringID 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>
namestringName 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_countrystringThe 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_currencystringThe purchase currency of the order. Formatted according to ISO 4217 standard, e.g. USD, EUR, SEK, GBP, etc.
shipping_addressanyThe 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.
statusstringThe current status of the session. Possible values: 'complete', 'incomplete' where 'complete' is set when the order has been placed.
One ofcompleteincomplete
intentstringIntent for the session. The field is designed to let partners inform Klarna of the purpose of the customer’s session.
One ofbuytokenizebuy_and_tokenize
{
"acquiring_channel": "ECOMMERCE",
"attachment": null,
"authorization_token": "string",
"billing_address": null,
"client_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJzZXNzaW9uX2lkIiA6ICIw",
"custom_payment_method_ids": [
"string"
],
"customer": null,
"design": "string",
"expires_at": "2038-01-19T03:14:07.000Z",
"locale": "en-US",
"merchant_data": "{\"order_specific\":[{\"substore\":\"Women's Fashion\",\"product_name\":\"Women Sweatshirt\"}]}",
"merchant_reference1": "ON4711"
}
Response
Returns 204 with a any. Read it in later steps with {{updateASession.response.data.<field>}}.
Need more? See the Klarna guide for connection setup and behaviour shared by every action.