Supported workflows
| Workflow | Supported |
|---|---|
| Payrails SDK | ✔ |
| Payrails API | ✔ |
| Delayed / Manual Capture | ✔ |
| Instant Capture | ✔ |
| Cancel / Void | ✔ |
| Refund / Reverse | ✔ |
| Save Instruments | ✔ |
| Merchant Initiated Transaction (MIT) | ✔ |
Before you begin
Complete these steps before you send your first Klarna payment through Stripe:- Set up a Stripe integration in your workspace. Follow the Stripe integration setup guide if you don’t have one yet.
- Turn on Klarna in your Stripe Dashboard payment method settings, and check that your Stripe account is eligible for Klarna.
- In the Payrails Portal, go to Settings → Integrations, open your Stripe integration, select Klarna under Payment methods, and save.
- Add Klarna as a payment option in your workflow.
Request fields for Stripe
Send these fields in the authorize request, in addition to the standard authorize fields. Required fields must be present for the payment to succeed. Payrails sends Optional fields to the PSP when you include them.Authorize a Klarna payment
Call authorize a payment withklarna as the paymentMethodCode and hpp as the integrationType. The response includes the redirect to Klarna.
Authorize request
success or error URL. Confirm the result through webhook notifications or the execution status before you fulfill the order.
Save Klarna and charge it later
Save Klarna
To save Klarna for later payments, setstoreInstrument to true and futureUsage to Subscription or UnscheduledCardOnFile. Set holderReference on the execution. The customer still confirms the payment on a Klarna page.
Authorize request that saves Klarna
paymentInstrumentId for later payments.
To save Klarna without charging the customer, for example at the start of a free trial, send "value": "0" in both amounts with storeInstrument set to true. The customer approves at Klarna, and the instrument is ready for an MIT straight away.
Charge a saved Klarna instrument
For an MIT, create an execution with the sameholderReference, then authorize with the saved paymentInstrumentId and set meta.order.processingType. The payment completes without a redirect.
MIT authorize request
Subscription as the processing type for recurring payments on a schedule.
Subscription details
When you sendmeta.subscription, Payrails passes the subscription to Stripe on the first payment, the zero-amount setup and every MIT. meta.subscription.chargeFrequency maps to the Stripe interval as follows. Payrails rejects any other value.
Payrails sends the saved instrument’s ID as the subscription reference, so it stays the same on every payment in the series.
Subscription for a zero-amount setup
How Stripe handles Klarna
- With delayed capture, Payrails creates the Stripe payment with manual capture, so you capture or cancel it later. With instant capture, Stripe captures the payment when the customer confirms it.
- When you save Klarna, Payrails stores the Stripe payment method as a PSP token, with the Stripe customer as its holder.
SubscriptionandUnscheduledCardOnFileset Klarna up for off-session use, andCardOnFilesets it up for on-session use. - An MIT is an off-session Stripe payment on the saved payment method, confirmed straight away. Send an amount greater than zero.