Hyperswitch Klarna buy now, pay later integration

A practical guide to offering Klarna pay later and installments through a self-hosted Hyperswitch stack, covering activation, checkout display, captures, refunds and the checks that close each step. Scope and effort depend on the Klarna account and the connector version you run.

On this page

How Hyperswitch Klarna pay later integration works

Hyperswitch can offer Klarna pay later and installments alongside cards by routing those payments through a Klarna connector configured in your own self-hosted Hyperswitch deployment. The merchant sets up the Klarna merchant account, enters its credentials in Hyperswitch, enables Klarna as a payment method at checkout, and sends the payment flows through the same orchestration layer that handles cards and other processors. Because the connector sits in your stack, you keep control of routing, configuration and the records Klarna payments generate.

Before you scope this work, confirm three things against the current Hyperswitch connector documentation and your Klarna merchant agreement: which countries and currencies the Klarna connector supports, which payment flows it implements (such as pay later, installments and pay in parts), and how captures are triggered and reported. Ask Klarna which of your markets and product types your account is approved for, since a connector can support a method that your account does not yet have enabled. Treat each of these as an open item in the scope until you have written confirmation, not as a settled capability. The Hyperswitch docs are the starting point for the connector reference.

These answers drive the rest of the plan. Country and method coverage decide which checkout locations show Klarna and whether you need a second connector for markets it does not reach. Capture behavior decides when your order system must trigger a capture and how partial captures and refunds reconcile with what Klarna reports. Confirm the sandbox and production behavior for each flow with your Klarna contact, and record the answers in the written scope so that build, testing and go-live use the same facts.

What you need before connecting Klarna to Hyperswitch

Five items must be in place before you configure Klarna in Hyperswitch. Three sit in your infrastructure and identity setup, and two depend on decisions and agreements with Klarna. Settle them in this order so the connector work does not stall on access or endpoints.

A self-hosted Hyperswitch version with Klarna

Your deployment must run a Hyperswitch release that includes the Klarna connector. Check the release notes for the version that adds it, then confirm that version is at or above it on the GitHub releases page. Each release lists a compatibility matrix for Control Center and web client versions, so check those too before you upgrade. Plan the upgrade in a non-production environment first.

Hyperswitch releases

Klarna API credentials for each market

Klarna credentials are issued per merchant account, and each market you plan to sell in may need its own account and key set. Ask Klarna which accounts cover which countries and currencies, and record how each set maps to a connector configuration in Hyperswitch. Store the credentials in your secrets manager, not in configuration files, and confirm who on your side can rotate them.

A Control Center role that manages connectors

Hyperswitch manages roles inside the platform, not in your identity provider, so the person configuring Klarna needs a role in the Control Center that permits connector changes. Confirm the permission set with your Hyperswitch administrator before the work starts. Keep at least two people able to make the change so one absence does not block a go-live.

OpenID Connect sign-in for Control Center

The Control Center supports OpenID Connect only for single sign-on. SAML is not supported, there is no just-in-time or SCIM provisioning, and users must be invited before they can sign in. Set up the OIDC client with your identity provider, then invite each operator by hand. Review the SSO setup guide before you plan your identity work.

SSO setup guide

A public HTTPS endpoint for Klarna webhooks

Klarna sends status updates to an HTTPS address that must be reachable from the internet, so your router service needs a public hostname with a valid certificate. Confirm the exact webhook URL pattern and any source addresses Klarna uses with Klarna's documentation and your Hyperswitch setup. Allow only the required path through your firewall and load balancer, and test delivery in a sandbox before you accept live traffic.

Agreed countries and order types

Decide which countries, currencies and Klarna products you will enable before you configure anything. Each market's rules affect checkout display, order limits and which payment methods Hyperswitch offers. Confirm with Klarna which products your merchant accounts are approved for, and record the list in your scope document. Any market left out now will need a separate configuration change later.

How a Klarna payment moves through Hyperswitch

The flow starts at the shopper's checkout and the merchant backend, which calls the Hyperswitch Router inside your self-hosted stack. The Router stores payment state in PostgreSQL and sends the request to Klarna, which is outside your trust boundary. Klarna's outcome returns to the Router through a webhook, and the status then reaches your backend and order system. The capture and refund branches both pass through the Router, so check that webhook endpoints, Klarna credentials and every outbound call are configured and logged on your side of the boundary.

Payment, capture and refund paths across the trust boundary.

Configuration sequence for Klarna in Hyperswitch

This sequence takes a self-hosted Hyperswitch stack from an agreed Klarna market scope to a sandbox where pay later payments authorize, appear in Control Center and report back through webhooks. Each step ends with a check you can see, so a failure traces back to one step.

  1. Confirm Klarna account and market scope

    Your team and Klarna agree which merchant account, countries, currencies and pay later products are covered by the agreement, and which credentials are sandbox and which are production. Ask Klarna to confirm these in writing and record each country and currency pair in your scope document. This step is done when the scope document lists every market and product in scope and a sandbox login works.

  2. Store API credentials in the secrets path

    Place the Klarna API credentials in the secret store your deployment uses, such as a Kubernetes secret or an external secrets manager, and reference them by name from the connector configuration. Keep the values out of Helm values files, environment files and Git repositories. This step is done when the router reads the credential at startup and a search of the configuration repository finds no key values.

  3. Add the Klarna connector in Control Center

    In Control Center, open connector setup, select Klarna and enter the sandbox credentials by secret reference. Give the connector a label that names the market, so operators can tell it apart from other pay later connectors. Confirm the exact fields and the sandbox environment setting in the current Hyperswitch connector documentation before you save. This step is done when the connector shows as active for the merchant account and a test request returns without an authentication error.

  4. Enable pay later for approved markets

    Turn on the pay later payment method only for the country and currency pairs in your scope document. Klarna product availability differs by market, so check which pay later products each pair supports before enabling anything. Hyperswitch payment method settings control what checkout shows, so confirm the mapping there. This step is done when a test business profile lists pay later only for approved country and currency combinations.

  5. Set webhook URL and signing details

    Register your Hyperswitch webhook endpoint with Klarna in the sandbox and set the signing details the connector expects. Store any signing secret the same way as the API credentials. Confirm the endpoint path and signature method in the connector documentation for your Hyperswitch version. This step is done when a sandbox event reaches the endpoint, the signature verifies, and the event is logged against the matching payment ID.

  6. Configure routing for eligible orders

    Create a routing rule that sends orders to Klarna when they meet eligibility conditions you define, such as currency, country, amount or basket attributes, and confirm those conditions with Klarna's eligibility rules. Keep a fallback route to another payment method for ineligible orders. Hyperswitch documents rule-based routing and default fallback routing, so use those mechanisms. This step is done when a test payment that meets the rule selects Klarna and one that does not falls through to the fallback.

  7. Run sandbox test payments

    Run authorization, capture, refund and any partial capture or cancellation cases the connector supports, for each approved market. Record the expected result before each test so mismatches are easy to spot. Compare the payment state in Control Center, the webhook log and the Klarna sandbox dashboard. This step is done when every test case shows the same status in all three places and the outcomes are recorded for sign-off.

How order, payment and refund data maps to Klarna

This table traces one order from the merchant system through the Hyperswitch payment object to the Klarna order fields, and shows how captures, partial captures and refunds are referenced. Read each row as a question to answer in the connector documentation and your own test environment before go-live. Rows marked to confirm are mappings we have not verified against the current Klarna connector, so they should not be assumed.

Data elementHyperswitch payment objectKlarna order field and handling
Merchant order IDMerchant reference carried on the payment, used to match the order in your systemSent as the merchant reference on the Klarna order. Confirm the exact field name and length limit in the connector documentation.
Line items (name, quantity, unit price, tax)Order details array on the payment requestMapped to Klarna order lines. Confirm which tax and discount fields are required, since pay later providers often reject totals that do not reconcile.
Total amount and minor unitsAmount in the smallest currency unit, set at authorizationKlarna expects the order total to equal the sum of lines. Confirm the minor-unit rule for your currencies, including zero-decimal currencies.
Currency and countryCurrency and billing country on the paymentDetermines which Klarna payment methods are offered. Confirm that each market you sell in is enabled for the same merchant account.
Shipping and billing addressesAddress objects on the payment requestSent to Klarna for risk checks and delivery. Confirm which fields are mandatory per country and how partial addresses are handled.
Customer identifiers (email, phone, customer ID)Customer object linked to the paymentUsed for Klarna customer matching. Confirm whether Hyperswitch passes your customer ID or only contact fields.
Capture amount and partial captureCapture request with an amount at or below the authorized amountEach partial capture references the original Klarna order. Confirm the capture limit and whether Klarna allows multiple partial captures per order.
Refund reference and partial refundRefund object linked to the original payment ID, with its own refund IDRefunds reference the captured amount. Confirm how Klarna handles refunds on an order that is not yet fully captured.
Status values returned to the merchantPayment status such as requires capture, partially captured, succeeded, failed or cancelledKlarna authorization and capture outcomes map to these statuses. Confirm the full status list and which webhook events announce each change.

How captures and refunds behave for pay later orders

Pay later orders usually authorize at checkout and capture later, once the goods have shipped or the service has been delivered. That gap is the core design decision: the merchant must decide when Hyperswitch triggers capture, whether that happens automatically or from an order management event, and how partial captures are handled when an order ships in parts. Map each fulfillment event to a capture call in your own system, and confirm with your connector version whether a partial capture is supported for Klarna, how many partial captures are allowed against one authorization, and what happens to the remaining authorized amount if you never capture it. Authorizations for pay later methods also expire, so the time between checkout and capture needs to be checked against the window Klarna allows.

Refunds depend on whether the order has been captured. Before capture, the usual path is to cancel or void the authorization, which releases the customer's pending amount without a refund transaction. After capture, the merchant issues a refund against the captured amount, and a partial refund is a separate operation with its own record. Test each path in a sandbox with your connector version, because the exact call sequence and the statuses Hyperswitch returns can differ between releases. Refund reconciliation then has to match Klarna's own records, not only Hyperswitch's ledger. Klarna's settlement may net fees, adjustments and refunds on different dates, so compare Hyperswitch refund IDs with the Klarna references in your settlement reports before you close a period.

Before go-live, confirm each capture and refund behavior against the connector documentation for the version you run and against Klarna's merchant terms, which set the authorization window, partial capture rules and refund timing for your account. Ask Klarna which events trigger the customer-facing notices for a cancelled or partly refunded order, and check whether your order management system sends matching status updates. Record the answers in your runbook, because a later Hyperswitch upgrade can change how a capture or refund event is reported and your reconciliation job needs to notice it.

Where Klarna appears in checkout

On web checkout, the Klarna option is rendered by the Hyperswitch web SDK from the payment methods returned for the session. The shopper selects Klarna in the payment method list, and the SDK hands off to Klarna's flow. Your team controls placement and the surrounding copy, but Klarna's rules govern how the option and its messaging appear.

  • Method visibility: Klarna shows only when the connector is activated for your profile and the session's country and currency fall within what the connector supports. Confirm supported markets in the connector documentation.
  • Eligibility data: Send the billing address, shipping address, currency and order amount when the session is created, so the method can be evaluated before confirmation. Check which fields are required and test a session with them removed.
  • Return path: The redirect returns the shopper to a page you configure. Treat the browser redirect as a navigation event only, and take the final payment state from the Hyperswitch payment status, since a shopper can close the tab before returning.
  • Klarna display rules: Klarna sets requirements for on-site messaging, logo use and placement, and these change over time. Retrieve the current guidelines before launch and have marketing check page copy against them.

Before launch, run a test session in each target country and confirm the option, the redirect and the final status in the Control Center.

Securing Klarna credentials, webhooks and customer data

A Klarna connector in Hyperswitch touches API credentials, inbound webhooks and customer identity and address data, and each one needs its own control. The cards below cover where those secrets live, how webhook traffic is trusted, who can change connector settings, what stays out of logs, and how the PCI DSS scope conclusion gets confirmed.

Store Klarna API keys securely

Klarna API credentials give full control over payment activity for your merchant account, so they should never sit in configuration files, container images or shared documents. Use a secrets manager your platform team already operates, or the encrypted connector settings path your Hyperswitch deployment provides, and confirm which one applies before go-live. Ask who holds the rotation procedure and how a compromised key is revoked and replaced without downtime on captures and refunds.

Self-hosting docs

Verify webhook authenticity

Klarna sends status changes such as authorization, capture and refund events to your Hyperswitch endpoint, and Hyperswitch uses them to update payment state. Confirm that the connector validates the signature or authentication data Klarna supplies before it trusts a payload, and that rejected events are logged for review. Test this with a replayed or altered payload in a sandbox before live traffic reaches the endpoint.

Restrict webhook endpoint exposure

The webhook route should accept traffic only from the network paths Klarna uses, and nothing else should reach the Router service on that route. Place the endpoint behind your ingress or gateway with source restrictions where Klarna publishes them, apply rate limits, and keep it off administrative hostnames. Ask your network team to show the allowlist and the logs that prove blocked requests were recorded.

Limit Control Center connector access

Anyone who can edit a connector in the Control Center can change where payments are sent, which credentials are used and whether refunds run. Restrict connector configuration to a named payments group, keep roles assigned inside Hyperswitch, and remember that users must be invited first because SSO provisioning is not automated. Review membership on a set schedule and remove accounts when staff change roles.

Control Center SSO docs

Keep identity and address data out of logs

Pay later flows carry a customer's name, email, phone number, billing and shipping addresses and sometimes date of birth. Check that application logs, tracing spans, error reports and the scheduler queue do not record full request or response bodies for Klarna calls. Set a redaction rule for these fields, and confirm that log retention and access follow your data protection policy.

Confirm the PCI DSS scope conclusion

In the pay later path the customer enters personal and order details for Klarna's own flow, and card data is not handled by the merchant, so the scope may be smaller than a card checkout. This conclusion depends on how your checkout and vault are built, so document the data flow and get it reviewed. Ask your qualified assessor to confirm the scope in writing before you rely on it.

Vault deployment models

Common Klarna failures in Hyperswitch and how to fix them

This table lists the failures teams most often hit when Klarna goes live through Hyperswitch, with the likely cause and a check to run for each. Read it as a triage sheet: start with the symptom your team sees, then run the check before changing credentials or code.

SymptomLikely causeCheck and fix
Klarna missing at checkoutKlarna is not enabled for the connector, or the shopper's country, currency or order amount falls outside the configured eligibilityConfirm Klarna is active for the merchant profile, then compare the shopper's country, currency and basket total with the markets your Klarna account was approved for. Ask your Klarna contact to confirm the enabled markets in writing.
Authorization declined on valid ordersCredentials from a different market or environment, such as a test account used in production or a regional account used for another countryCheck which environment the connector points to and that the API credentials match the same Klarna account and region. Run one test order in the sandbox and one live order of low value from the same storefront before opening a support case.
Webhooks not updating order statusThe webhook endpoint is unreachable from Klarna, or the signature check fails because the secret does not match the connector configurationSend a test event and confirm the Hyperswitch endpoint returns a success response through your load balancer and ingress. Compare the webhook secret stored in the connector with the one shown in the Klarna dashboard, and review router logs for signature verification errors.
Capture fails after shipmentThe authorization has expired before capture, or the captured amount differs from the authorized amount because items were removed or shipping changedRecord the authorization date and the amount at each stage. Capture only the final order total, and build a shipment step that checks the order is still open before calling capture. Confirm with Klarna the authorization validity window for your product and markets.
Refund rejectedThe refund was requested against an order that Klarna has not captured, so there is no settled amount to returnCheck the payment status in the Control Center before issuing a refund. If the order is only authorized, cancel or void it instead. Refund only the captured amount and keep a reference to the original capture ID in your order record.
Order totals differ between systemsTax, shipping, discounts or rounding are mapped differently between the storefront, Hyperswitch and Klarna, often per line item versus per orderReconcile one sample order across all three systems line by line. Confirm the amount unit (minor units per currency), the tax mode and how discounts are split. Agree the rounding rule with finance and test it on orders with several items and a discount.

Adding other pay later options beside Klarna

A second pay later provider changes more than the list of payment methods at checkout. Each provider you add becomes another connector with its own credentials, webhooks and eligibility rules, and Hyperswitch has to decide, per payment, which connector receives the request. Before you enable a second option, decide how routing will choose between Klarna and the other provider, what happens when the first choice is ineligible for a basket or customer, and which connector the default fallback routing falls back to. Hyperswitch documents rule-based routing and default fallback routing for cases where no rule applies or a processor is ineligible, so write those rules down as a table your team can review rather than leaving them implicit in configuration.

Checkout display needs the same discipline. Pay later options are shown to a shopper only when the amount, currency, country and basket meet a provider's conditions, so the display logic must be tested for each provider separately. Plan reporting before go-live too: decide how captures, refunds and settlements from each provider will be tagged, reconciled and reviewed side by side, so that a payment made through the second provider does not appear as an unexplained difference in your finance reports. Give each connector its own webhook endpoint configuration and its own reconciliation check, and record which events each one sends.

Do not assume which pay later connectors are available. Connector support changes between Hyperswitch releases, so confirm the exact connector name, supported countries and payment methods in the current Hyperswitch connector list and against the release notes for the version you run. Ask the provider directly for its eligibility rules, settlement terms and refund behavior, and confirm that your Hyperswitch version supports the features you need before you plan a checkout change around them. Treat the second provider as a separate onboarding project with its own test and sign-off, not as a configuration toggle added to the Klarna work.

Questions buyers ask about Klarna integration with Hyperswitch

How much effort does a Klarna integration through Hyperswitch take?

The effort depends mostly on how many markets you sell in, how many checkout channels show Klarna, and how complex your capture and refund workflow is. A single market with one web checkout and automatic capture is a small job. Each added country adds Klarna eligibility rules, local display requirements and reconciliation checks, and each channel (web, mobile SDK, hosted payment page) needs its own display and testing pass. Reconciliation effort rises when orders are partially captured, split across shipments, or refunded after settlement. Ask any partner to size the work by these four drivers rather than by a single lump figure.

How long does the integration take, and what sets the timeline?

The timeline is set by account activation with Klarna, the number of markets and channels in scope, and how much your order system has to change to send captures and refunds correctly. Klarna activation runs on Klarna's own schedule and is outside the build, so start it early. Sandbox testing usually takes longer than the code change because every payment state, including declines, cancellations and partial captures, needs a test case. Your written scope should state the markets, channels and flows included, and the schedule should follow from that scope. Ask for milestones tied to those items.

Can our internal team build the Klarna integration alone?

A team that already runs a self-hosted Hyperswitch stack can usually build the Klarna connection itself, provided it has engineers who can work with Hyperswitch connector configuration, webhook handling, and your order management system. The harder skills are payment state handling, reconciliation against settlement reports, and testing edge cases such as partial captures and refunds after a dispute. Check whether your team has owned a payment integration end to end before. If not, a fixed-scope engagement can cover the build while your engineers take over operations, which keeps knowledge in-house.

What do we need to provide for the Klarna work?

You will need to provide access to a Klarna merchant account with sandbox credentials, a named person who can approve Klarna terms and display requirements, and access to your Hyperswitch environment, including the Control Center and the configuration for the connector. Your engineers must also expose the order events that trigger authorization, capture, cancellation and refund so Hyperswitch receives the correct order data. Expect changes to your order system to send line items and shipping status, because Klarna needs that data for approvals and captures. Confirm each of these items in the written scope before work begins.

What recurring work comes after launch?

Recurring work includes keeping Hyperswitch current, retesting Klarna flows after connector or SDK changes, and updating your checkout when Klarna changes its display or policy requirements. Hyperswitch ships regular minor releases, and each release needs a compatibility check across the router, Control Center and client SDKs before you upgrade. Some upgrades add required dependencies, so read the release notes first. Plan for periodic reconciliation reviews and for monitoring webhook failures. Ongoing support, upgrades and continuous testing can be covered by a retainer rather than ad hoc requests.

What should we ask for in a written quote?

Ask for a quote that lists the markets, checkout channels, Klarna products, and whether other pay later options are included. It should name each deliverable, such as connector configuration, checkout display changes, capture and refund logic, reconciliation checks and documentation, and state what is excluded, including Klarna activation fees and your own engineering time. Request the acceptance criteria, the testing scope in sandbox and production, the handover method, and the post-launch support terms. DeployOpen works fixed-scope, so the quote follows from the written scope rather than a price list. Compare quotes on the same scope, not on the headline total.

How DeployOpen scopes and delivers Klarna on Hyperswitch

DeployOpen plans, configures and hands over Klarna pay later on a Hyperswitch stack that runs in infrastructure you control. We start from your merchant setup, processors and checkout, then agree the scope in writing before any configuration begins. Each step is documented so your payments, security and compliance teams can review what was built.

How we scope

  • Confirm which Klarna markets, currencies and payment methods your checkout needs before any configuration starts.
  • Map the processor path that will carry Klarna alongside your existing acquirers and any planned routing rules.
  • Agree deliverables, test scenarios and handover documents in a fixed-scope written agreement before work begins.

How we build

  • Configure the Klarna connector credentials in a non-production Hyperswitch environment first, then promote through your change process.
  • Wire checkout display, capture and refund flows, and verify webhook delivery and status reconciliation against Klarna test data.
  • Test declined, partially captured and refunded orders so payment states match what your customer support team sees.

How we hand over

  • Deliver configuration records, runbooks for captures and refunds, and a list of the settings your team owns after go-live.
  • Document the webhook endpoints, secrets locations and access roles so your security team can review them independently.
  • Walk your engineers and operations staff through monitoring signals and the steps for a failed capture or refund.

How we support

  • Offer ongoing support, Hyperswitch upgrades and continuous testing as a retainer after go-live.
  • Retest Klarna flows after each Hyperswitch release you adopt, including changes to connector behavior in the release notes.
  • Add further pay later options through the same scoped process, with a separate written scope for each new provider.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.