younifyd
Menu

Create an order

Create an order

POST/payments/v1/authorizations/{authorizationToken}/order

Use it in a workflow

  1. Add a step and choose the Klarna connector.
  2. Pick the Create an order action (under Payments).
  3. Fill in the fields below, then reference the result from later steps as {{createAnOrder.response.data}}.

Request

Path parameters

authorizationTokenstringrequired

Request body

Enter the body as JSON in the step's Body field.

authorization_tokenstring

Authorization token.

auto_captureboolean

Allow merchant to trigger auto capturing.

Default false

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.

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.

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. 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.

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

json
{
  "order_amount": 2000,
  "order_lines": [
    {
      "name": "Running shoe",
      "quantity": 1,
      "total_amount": 2000,
      "unit_price": 2500,
      "image_url": "https://www.exampleobjects.com/logo.png",
      "merchant_data": "{\"customer_account_info\":[{\"unique_account_identifier\":\"test@gmail.com\",\"account_registration_date\":\"2017-02-13T10:49:20Z\",\"account_last_modified\":\"2019-03-13T11:45:27Z\"}]}",
      "product_identifiers": null,
      "product_url": "https://.../AD6654412.html",
      "quantity_unit": "pcs",
      "reference": "AD6654412",
      "tax_rate": 2000,
      "total_discount_amount": 500
    }
  ],
  "purchase_country": "US",
  "purchase_currency": "USD",
  "authorization_token": "string",
  "auto_capture": false,
  "billing_address": null,
  "custom_payment_method_ids": [
    "string"
  ],
  "customer": null,
  "locale": "en-US",
  "merchant_data": "{\"order_specific\":[{\"substore\":\"Women's Fashion\",\"product_name\":\"Women Sweatshirt\"}]}",
  "merchant_reference1": "ON4711"
}

Response

Returns 200 with an object. Read it in later steps with {{createAnOrder.response.data.<field>}}.

authorized_payment_methodany

The payment method that Klarna has authorized the customer for.

fraud_statusstring

Fraud status for the order. Either ACCEPTED or PENDING. If ACCEPTED, the order could be captured. If PENDING, please wait till you receive the notification from Klarna in the notification URL that the order has been approved. You can find additional information [here](https://docs.klarna.com/payments/after-payments/order-management/more-actions/pending-orders/).

order_idstring

Unique order ID of the transaction. This ID will be used for all order management processes.

redirect_urlstring

URL to redirect the customer to after placing the order. This is a Klarna URL to which the merchant should redirect the customer to. Klarna will place a cookie in the customer’s browser (if redirected) and redirect the customer back to the confirmation URL provided by the merchant. This is not a mandatory step but a recommended one to improve the returning customer’s experience. It is a spontaneous step and does not harm the customer’s experience.

json
{
  "order_id": "string",
  "authorized_payment_method": null,
  "fraud_status": "string",
  "redirect_url": "https://credit.klarna.com/v1/sessions/0b1d9815-165e-42e2-8867-35bc03789e00/redirect"
}

Need more? See the Klarna guide for connection setup and behaviour shared by every action.