Recurring Payments - Klarna
Klarna supports a variety of recurring & tokenized payment use cases such as subscriptions (with or without free trial), on-demand, and mixed payments.
When processing a payment for the first time
Step 1: Create a Customer
Create a customer
with the Create a Customer API API if the customer is new, otherwise this step is optional.
Step 2: Create a Payment Intent
Create a Payment Intent with the Create a Payment Intent API API.
POST /api/v1/pa/payment_intents/create
If the payment is not intended to charge the shopper for the first time, such as a subscription with a free trial, please set the amount
to zero.
If the payment has a fixed frequency, such as a yearly subscription, please add subscription
to order.products.type
and indicate the expected amount for each payment.
Otherwise, please pass the dummy product info:
You are strongly advised to send any available additional_info.customer_activity_data.purchase_summaries
to improve the success rate. Klarna uses such info for shopper credit and risk evaluations.
Step 3: Confirm the Payment Intent With Consent Info
When you want to redirect the shopper to authorize the Consent with Klarna, call the Confirm a Payment Intent API API with the Payment Consent info to get a redirect URL.
Note that Klarna has different types of recurring & tokenized payments, this needs to be passed as recurring_type
:
Recurring type | Descriptions | Sample use case |
---|---|---|
TOKENIZE | Allow shoppers to grant a recurring Payment Consent without an initial payment. Only use when the intent amount is set to zero | Subscription with a free trial |
BUY_AND_TOKENIZE | Allow shoppers to grant a recurring Payment Consent with an initial payment. Subsequent payments will apply the same payment schedule as the initial payment. - For subsequent payments, the payment fund source and schedule will be identical to the first payment. For example, if the initial payment is pay-in-4 by Direct Debt, subsequent payments will also be pay-in-4 on the same Direct Debt. - The available payment schedule will differ based on the recurring frequency. A payment schedule is only available if it’s shorter than the recurring frequency. For example, the typical pay-in-4 has a 2-month shopper payment schedule. If the subscription is a monthly subscription (<2 months), pay-in-4 will not be available. | Subscription without a free trial |
BUY_AND_DEFAULT_TOKENIZE | Allow shoppers to grant a recurring Payment Consent with an initial payment. Subsequent transactions are pay-in-full transactions. - For subsequent payments, the payment fund source will be identical to the first payment, however, they will always be a pay-in-full transaction. For example, if the initial payment is pay-in-4 by credit card, subsequent payments will be pay-in-full on the same card. | - Mixed payment: Includes a one-time product and a monthly subscription; - Additional charge: Includes a one-time product with an additional service charged separately. |
POST /api/v1/pa/payment_intents/{id}/confirm
If the subsequent payments are scheduled on a fixed frequency, please send the payment schedule in terms_of_use
.
If the subsequent payments are triggered by the shopper, such as mixed payments, please send terms_of_use
similar to the following:
Once the shopper completes the payment, the Payment Consent will be verified automatically, and Airwallex will notify you of the Payment Consent status asynchronously via the webhook. Please refer to the webhook documentation to set up your webhook accordingly.
To query the payment status and capture the Payment Intent, please refer to Klarna one-off payment flow Step 3 and Step 4 .
When initiating a subsequent transaction
Step 1: Initialize a Payment Intent
When you are ready to process the subsequent recurring payment, create a Payment Intent with the Create a Payment Intent API API.
Please send products
for each subsequent payment, regardless of the initial recurring_type
.
products
should be specific to each payment, especially for mixed payments where the subsequent products
information might differ from the initial payment.
POST /api/v1/pa/payment_intents/create
Step 2. Complete payment with verified consent
Confirm the subsequent payment with the verified Payment Consent by calling the Confirm a Payment Intent API API.
POST /api/v1/pa/payment_intents/{id}/confirm