Everything you need to know about subscription and on-demand use cases.
Learn more about the use cases:
Both use cases are facilitated by the "customer token".
A customer token is the combination of customer details and payment method data, together with a connection to a specific merchant.
A customer token helps speed up the checkout process. You only have to collect a customer's details and payment method information once to be able to reuse it for recurring orders. The customer doesn't need to take action as you can create orders on their behalf.
When you create an order using a customer token, we run a risk and fraud assessment to ensure that the customer can be offered credit for the order amount.
Customer tokens are stored in Klarna’s internal secure databases and no private information linked to customer tokens is shared externally.
You have to inform your customers that you're creating customer tokens for them and explain how you'll use the tokens to create orders. You can include this information in your store's terms and conditions.
You can create a customer token by sending a [ request through Klarna payments API].
A customer token can be either active, suspended, or canceled. When a token is created, its status is set to active by default.
You can use the Klarna payments API to perform three actions related to a customer token:
intent
set to tokenize
or buy_and_tokenize
.A customer token doesn't have an expiration date. It stays active until you cancel it.
Once you know that you'll not use a customer token anymore, for example, if your customer unsubscribes from your service or deletes their account, you can cancel a customer token using the Klarna payments API.
To check the status of a customer token, send a request using the Klarna payments API.
Yes, you can share a customer token between multiple Merchant IDs (MIDs) used by your company (for example, one MID dedicated to customer signup and another for placing orders). This is known as token clustering.
Initially, we assign a new customer token to the MID you got when you were onboarded to Klarna. If you want to link a customer token to other MIDs, contact Merchant support.
If you're using customer tokens in your checkout, you need to:
Only tokenizing or connecting it to the purchase flow? You can create a free-standing signup flow for customers to sign them up for tokens. You can also combine a purchase and create a customer token in the same session.
The information related to subscriptions is included in the subscription object inside the request's order_lines. This information lets us make better underwriting decisions and present the most fitting payment options (for example, monthly subscriptions vs. annual).
This object plays a key role in the post-purchase display of automatic payments in the Klarna app.
Technical considerations:
The subscription object contains the following elements:
Element | Format | Description | Required |
---|---|---|---|
name | string | The name of the subscription product. This string shouldn't include the name of the merchant or partner. The recommended format includes a subscription id and double curly brackets, for example Premium Membership {{12394832}} | Y |
interval | string | The cadence unit for the subscription plan. Allowed values: DAY , WEEK , MONTH , YEAR | Y |
interval_count | integer | The number corresponding to the interval unit | Y |
For example, if you want to charge for a subscription once a quarterly, set the value of interval
to "MONTH" and interval_count
to 3. For a charge happening annually, set interval
to "YEAR" and interval_count to 1.
In the example for the name
object in the table above, Premium Membership {{12394832}}
, “Premium Membership” is the name of the subscription product and “12394832” is the identifier used for this subscription for this customer. Klarna may group multiple orders related to the same identifier for the same subscription product when presenting payment information to your customer.
A customer subscribed to a monthly streaming subscription for 15.99/month with a free 14-day trial.
A sample create session request with the subscription
object included in order_lines
.
A sample create customer token request with the subscription
object included in order_lines
.
A customer subscribed to regularly receive 2 different products at different time intervals: Ink cartridges every month and deodorant creme every 2 months.
A sample create session request. Note two subscription
objects, one per product and cadence, included in order_lines
.
A sample capture request including the subscription
object.