Klarna Docs - New components
New components

xxxx xxxxx xxxxxxxxx xxxx xxxxx xxxxxxxxx xxxx xxxxx xxxxxxxxx xxxx xxxxx xxxxxxxxx xxxx xxxxx xxxxxxxxx xxxx xxxxx xxxxxxxxx xxxx xxxxx xxxxxxxxx

To create an order for a one-time payment, send a POST request to the {apiUrl}/payments/v1/authorizations/{authorizationToken}/order endpoint and include authorization_token in the path.

For example, if the authorization_token is b4bd3423-24e3, send your request to the {apiUrl}/payments/v1/authorizations/b4bd3423-24e3/order endpoint.

Success response

When you receive a success response, the customer gets charged and the Klarna payments session is closed.

As part of the response, you receive the following details:

  • order_id, an order identifier that you can later use to capture or refund the order using the Order management API
  • redirect_url, a URL to which you redirect the customer. This isn't included in the response received if you didn't include the URL when initiating a payment
  • fraud_status, an indicator of whether the transaction is suspected to be legitimate or fraudulent
  • authorized_payment_method, the payment method selected by your customer for this purchase

To charge the customer at checkout, send a POST request to the {apiUrl}/payments/v1/authorizations/{authorizationToken}/order endpoint. Include the authorization token as a path parameter.

For example, if the authorization_token is b4bd3423-24e3, send your request to the {apiUrl}/payments/v1/authorizations/b4bd3423-24e3/order endpoint.

Include subscription details in the subscription object. These should match the details you previously shared with Klarna when initiating the payment session.

For recurring payments, you have to create a customer token before placing the order. This token identifies your customer and the payment method selected for the purchase. It also lets you charge the customer later, ad-hoc or at regular intervals.

For payments where you charge the customer at checkout and enable a recurring charge (intent set to buy_and_tokenize), you have to send two separate create order requests:

  1. In the first request, use authorization_token to charge the customer at checkout.
  2. In the second request, use customer_token for future recurring payments.

If you're not charging the customer at checkout (intent set to tokenize), you need to send only the second request to place the order and charge the customer at a later date.

If you're creating an order related to a subscription, include the subscription object in your create order request. Learn more about sharing subscription details with Klarna.

Complete step 1

Complete step

Complete step 3

Complete step 4