Using and placing orders with Klarna customer tokens

The Klarna Customer Token let's you store customers on file, making it possible for you to use Klarna's payment methods for e.g. subscriptions. In this article, it will described how to charge, update and read Klarna customer tokens.

Date: 11.07.2019

Summary

When you have a customer token on file, as described in the use case article for signing consumers up to tokens, you can use this token to either place, read or update orders.

For more information about the lifecycle of a token, read the in-depth article here .

Getting it to work

As a merchant, you can get Klarna to do three things with created customer tokens:

  1. Place new orders from a customer token.
  2. Update the status of a customer token.
  3. Read payment details from a customer token

Placing new orders from a customer token

The customer token already contains all customer details and payment method details to place an order. The only thing that you will have to do to place an order using an already created token is thus to create a cart and use that to place an order using the desired token.

From Klarna’s side a risk and fraud assessment is being done when you attempt to place an order using a token. This is to ensure that we can offer the consumer of the customer token the credit necessary for the specific cart and order.

You are responsible for setting the logic of when new orders should be created using customer tokens. In case you, for example, are using customer tokens to charge your customers for recurring purchases, such as subscription fees, you could have a schedule for triggering the right purchases. In case you are using tokens to store payment methods in your online checkout, you must track the consumer and charge the right token accordingly.

When your implemented logic for placing an order using a token is triggered, you should use the create_customer_token_order call. Please ensure that you refer to the right customer token ID when this is done, together with the cart for the order you want to place.

Details of this is described in the article on the place order from token call .

Klarna will respond with a reason for why an order was rejected. Depending on this reason you should act differently. Please ensure that you handle the following responses:

  1. If technical issue - try again.
  2. If rejection without reason - will not work a second time.
  3. If card input issues - you can offer a way for the consumer to re-enter their details according to the previously used customer token signup flow .

Updating the status of a customer token

All customer tokens have a status that is either active, cancelled or suspended. When a token is created, it is automatically set to ‘active’. To get more information about the full life cycle of a token and when the statuses are applied, please read this article .

As a merchant, you can decide to cancel a Klarna customer token if you do not intend to use it anymore – e.g. if the customer has revoked a subscription. This is achieved by changing the status of the customer token to ‘cancelled’. This will make it unusable for future order placements.

You can read about the details on updating token calls here .

Reading payment details from a customer token

All customer tokens have information about the customer and payment method details. Customer data will not be shared when reading a token, but if you want to get information about the payment method details on a token, you may read it.

This will return payment method details, such as expiry date and obfuscated card details, which you may display to a consumer on your subscription page. You can use the read-call on the customer token, which is described in detail here .

What logic do you need on your end?

  1. Be able to securely store the tokens.
  2. Be able to correctly map your customer to our customer token ID.
  3. Have logic on your side that tells you when to trigger purchases from a token.