Skip to main content
Klarna is a buy now, pay later option that lets eligible buyers split purchases into installments.

Setup

Follow the Stripe setup instructions before configuring Klarna. After setting up your Stripe account, make sure Klarna is enabled as a payment method in Stripe. For shared APM credentials and payment IDs, see Stripe APM credentials.

Capabilities

Supported countries

Supported currencies

Webhooks

Klarna payments and refunds can be completed asynchronously, so webhooks must be configured to update the status of transactions. Webhooks are configured in the Stripe Dashboard within Developer Settings under Webhooks. Each Gr4vy connection has its own webhook URL and needs its own event destination. See Stripe webhooks. The Klarna connector relies on the following Stripe webhooks:
  • charge.expired
  • charge.refund.updated
  • charge.refunded
  • payment_intent.succeeded
  • payment_intent.amount_capturable_updated
  • payment_intent.payment_failed
  • payment_intent.partially_funded
  • payment_intent.canceled
  • checkout.session.async_payment_succeeded
When a transaction stores the buyer’s Klarna payment method with store: true, the stored payment method stays processing until Stripe sends payment_intent.succeeded or payment_intent.amount_capturable_updated. If neither arrives within 8 days, the payment method moves to failed. See payment method statuses.

Integration

The default integration for Klarna via Stripe uses a redirect to a payments page hosted by Gr4vy.

Redirect integration

Start by creating a new transaction with the following required fields.
After the transaction is created, the API response includes a payment_method.approval_url and the status is set to buyer_approval_pending.
Redirect the buyer to the approval_url (open in a browser or Webview), where they can complete the payment. Once the buyer completes the payment, the transaction progresses to an authorization_succeeded or capture_succeeded state.

Direct integration

If you intend to use your own hosted page, you can include an integration_client parameter set to web, ios or android when creating a new transaction.
After the transaction is created, the API response includes a session_token. You use this token with the session endpoint to retrieve the session data for the transaction and build a custom page.

Mobile redirect integration completion

On mobile integrations you should send a GET request to the default_completion_url provided in the session response.

Storing Klarna for future payments

When you store a Klarna payment method with store: true, Gr4vy tells Stripe how you intend to use it, based on the transaction rather than the store flag alone:
  • If payment_source is recurring or installment and is_subsequent_payment is false, Gr4vy sets Stripe’s setup_future_usage to off_session.
  • In all other cases, Gr4vy sets setup_future_usage to on_session.
Set payment_source on the transaction that stores the payment method if you plan to charge it later without the buyer present.

Payment IDs

When creating the transaction, the payment_service_transaction_id is the client secret, and in the extra_xids field you can find the payment intent ID as payment_id. After the transaction is approved by the user, the payment_service_transaction_id is updated to the payment intent ID.