Ellipse Gradient for Header

Klarna Integration Guide

Connect Klarna Payments, Checkout, and Order Management APIs with commerce, fulfillment, finance, and customer-service systems using secure workflows and selected webhook notifications.

Klarna integration options at a glance

Klarna’s primary integration model is REST APIs for Payments, Checkout, Order Management, Customer Token, and related merchant capabilities. Merchant API requests generally use API username and password credentials with HTTP Basic Authentication. Klarna also supports webhook-style notifications for selected product-specific lifecycle events, although coverage is not universal. Martini can consume Klarna REST APIs, receive supported callbacks through a Martini API, transform payment and order payloads, and orchestrate downstream updates. Scheduled workflows can retrieve paginated data for reconciliation and synchronization. General-purpose bulk APIs, file exchange, direct database access, GraphQL, and SOAP were not confirmed for core Klarna integrations.

Integration pointSupported by Klarna?Common use casesHow Martini supports it
REST APIsYesKlarna Payments supports payment sessions and authorization; Checkout supports checkout order management; Order Management supports order retrieval, updates, captures, and refunds.Martini can consume Klarna REST APIs from workflows, map request and response payloads, apply business rules, and expose an internal REST façade.
Webhooks / outbound callbacksLimitedKlarna provides webhook-style notifications for selected product-specific order or payment lifecycle events.Martini can expose an API to receive supported callbacks, validate and deduplicate them, acknowledge quickly, and process longer-running work asynchronously.
AuthenticationYesMerchant APIs generally use an API username and password with HTTP Basic Authentication; product-specific token flows may apply in other scenarios.Martini can store credentials in secrets or environment configuration and apply authentication at runtime while separating test and production settings.
Scheduled synchronizationYesScheduled retrieval supports reconciliation and synchronization where relevant Klarna endpoints provide list, search, timestamp, or status information.Martini can schedule workflows, paginate through results, maintain a watermark or cursor, and write normalized data to downstream systems.
Asynchronous processingLimitedSome payment and order operations are asynchronous, but a general-purpose Klarna bulk or batch API was not confirmed.Martini can separate callback acknowledgment from downstream processing and use workflow orchestration, state tracking, and bounded retries.
File import/exportNot confirmedCore Klarna integrations are API-based; a general-purpose file import, export, or attachment API was not confirmed.Martini should use documented Klarna API fields and objects rather than assuming file transfer capabilities.
GraphQL APIsNot confirmedKlarna’s core merchant API documentation is REST-oriented and GraphQL support was not confirmed.Martini integrations should use the confirmed Klarna REST interfaces.
SOAP APIsNoNo SOAP interface was identified in the supplied Klarna developer documentation.Martini should not design the Klarna integration around SOAP.

How Klarna exposes data and business events

Klarna REST APIs

Klarna’s principal merchant integration interface is REST, covering Payments, Checkout, Order Management, Customer Token, and selected merchant-related APIs. Product, region, environment, and account configuration determine the available endpoints and operations.

Martini implementation pattern

Martini implementation pattern: a workflow receives a request or trigger, authenticates with Klarna API credentials, calls the appropriate REST resource, validates the response, maps Klarna objects to a canonical model, and writes the result to downstream applications or returns it through a Martini API.

Implementation sequence

Receive a commerce, fulfillment, refund, or reconciliation request
Select the Klarna product API and environment
Authenticate with protected Klarna API credentials
Map canonical data to the Klarna request model
Call the Klarna REST operation
Validate the HTTP response and payment state transition​s

Klarna webhook notifications

Klarna supports webhook-style notifications for selected product-specific order or payment lifecycle events. Notifications are not universal for every Klarna object or state change, so reconciliation may still be required.

Martini implementation pattern

Martini implementation pattern: expose a controlled Martini API for supported callbacks, validate the request according to Klarna’s requirements, acknowledge quickly, deduplicate the event, and route durable processing to a workflow that retrieves current state when necessary.

Implementation sequence

Receive the Klarna callback at a Martini API
Validate and verify the callback request
Identify the Klarna object and event type
Check whether the notification was already processed
Acknowledge the callback promptly
Update downstream payment or order state

Klarna scheduled synchronization

Scheduled synchronization is useful for reconciliation and for changes that do not generate a supported callback. Klarna list and search behavior should be implemented with pagination and only with the filters and state fields exposed by the relevant product API.

Martini implementation pattern

Martini implementation pattern: a scheduler starts a workflow that reads the last successful watermark, retrieves paginated Klarna data, transforms objects, applies reconciliation rules, writes downstream results, and advances the checkpoint only after successful processing.

Implementation sequence

Start the scheduled synchronization workflow
Read the saved cursor or last-successful timestamp
Retrieve Klarna results page by page
Map orders, payments, captures, or refunds
Apply reconciliation and duplicate rules
Write results and store the new checkpoint

Common Klarna integration patterns

Pattern 1: Orchestrate ecommerce payment and checkout

When to use this pattern

Use this pattern when an ecommerce application needs server-side Klarna session creation, authorization coordination, or order creation without embedding Klarna-specific orchestration in the commerce application. The workflow validates totals, currency, tax, shipping, and order lines before calling Klarna.

Integration direction
Shopify
Martini
Klarna
Example Mapping
Klarna FieldCanonical FieldTarget Field
order_lineslinesorder_lines
order_amounttotalMinorUnitsorder_amount
currencycurrencyCodepurchase_currency
customer.emailcustomerEmailbilling_address.email
Martini implementation pattern

Martini receives the commerce request, maps it to a Klarna Payments or Checkout payload, calls the relevant API, stores the Klarna order or authorization identifiers, and returns a normalized response. Validation failures are rejected without retry, while transient failures use bounded retry and durable error handling.

Martini capabilities used
  • workflows
  • API consumption
  • data mapping
  • business rules
  • error handling

Pattern 2: Capture payments after fulfillment

When to use this pattern

Use this pattern when capture should occur only after a warehouse or order-management process confirms fulfillment. The workflow prevents captures beyond the authorized or remaining amount and records the result for reconciliation.

Integration direction
Warehouse system
Martini
Klarna
Example Mapping
Klarna FieldCanonical FieldTarget Field
fulfillment_statusfulfillmentStatuscapture eligibility
fulfilled_amountcaptureAmountMinorUnitsamount
klarna_order_idexternalOrderIdorder_id
fulfillment_idsourceOperationIdidempotency reference
Martini implementation pattern

A trigger or scheduled workflow retrieves the current Klarna state, confirms that capture is permitted, compares the requested amount with authorized and previously captured amounts, invokes Order Management, and updates the warehouse or ERP. Duplicate requests are detected using source and Klarna identifiers.

Martini capabilities used
  • workflow orchestration
  • API consumption
  • data mapping
  • validation
  • error handling
  • monitoring

Pattern 3: Synchronize refunds safely

When to use this pattern

Use this pattern when a commerce, customer-service, or ERP application initiates full or partial refunds through Klarna. It is appropriate where duplicate requests, partial amounts, and state-dependent operations require a durable integration record.

Integration direction
NetSuite
Martini
Klarna
Example Mapping
Klarna FieldCanonical FieldTarget Field
refund_idsourceRefundIdoperation reference
klarna_order_idexternalOrderIdorder_id
refund_amountrefundAmountMinorUnitsrefunded_amount
reasonrefundReasonrequest metadata
Martini implementation pattern

Martini validates the source refund, checks the captured and already refunded amounts, calls Klarna’s refund operation, persists the response, and updates the source system. A retry first checks the integration ledger so a completed refund is not submitted again.

Martini capabilities used
  • workflows
  • data mapping
  • business rules
  • idempotency
  • error handling

Pattern 4: Process Klarna status notifications

When to use this pattern

Use this pattern where the relevant Klarna product supports callbacks for payment or order lifecycle events. Because coverage is selected rather than universal, combine the callback flow with scheduled reconciliation for missed or unsupported changes.

Integration direction
Klarna
Martini
Salesforce
Example Mapping
Klarna FieldCanonical FieldTarget Field
event_typeeventTypepaymentStatusEvent
order_idexternalOrderIdKlarna_Order_ID
payment_statuspaymentStatusPayment_Status
event_idnotificationIdExternal_Event_ID
Martini implementation pattern

A Martini API validates and acknowledges the callback quickly, then invokes a workflow that checks event uniqueness, retrieves current Klarna state when needed, maps the normalized status to Salesforce, and records failures for retry or reconciliation.

Martini capabilities used
  • APIs
  • webhook consumption
  • workflow orchestration
  • data mapping
  • business rules
  • error handling

Applications commonly integrated with Klarna

Klarna can be integrated with commerce, order-management, ERP, CRM, and customer-service applications through REST APIs and supported lifecycle callbacks. Exact capabilities depend on the Klarna product, merchant account, regional configuration, and the adjacent application’s interfaces.

Application Scenario Direction Martini Pattern
Shopify Synchronize Klarna payment status, orders, captures, and refunds with Shopify checkout and order operations. Shopify → Martini → Klarna Martini receives checkout or order requests, maps customer, address, currency, order-line, tax, shipping, and total fields, calls the appropriate Klarna API, and synchronizes status or refund results back to Shopify.
Adobe Commerce Coordinate Klarna Payments or Checkout with commerce checkout, fulfillment, order updates, and refunds. Adobe Commerce → Martini → Klarna A Martini workflow orchestrates checkout creation and payment authorization, stores Klarna identifiers, and processes fulfillment-triggered captures and refund requests with retry-safe state handling.
Salesforce Commerce Cloud Connect storefront payment authorization, order creation, capture, and refund processes with Klarna. Salesforce Commerce Cloud → Martini → Klarna Martini exposes or consumes REST endpoints for checkout and order events, transforms commerce payloads into Klarna requests, validates payment state, and returns normalized responses to the commerce platform.
WooCommerce Synchronize Klarna payment and order status with WordPress-based store operations. WooCommerce → Martini → Klarna Martini consumes WooCommerce requests or events, invokes Klarna Payments or Order Management operations, and updates WooCommerce with authorization, capture, refund, and status information.
NetSuite Reconcile Klarna orders, captures, refunds, and settlement-related information with financial processes. Klarna → Martini → NetSuite Scheduled or event-driven workflows retrieve Klarna data, map amounts in minor currency units, apply reconciliation and duplicate checks, and write normalized order and payment data to NetSuite.
Salesforce Provide customer-service teams with payment, order, refund, and status context and allow approved service actions to flow back to Klarna. Klarna → Martini → Salesforce Martini consumes Klarna status notifications or scheduled results, maps them to Salesforce objects, and validates refund requests before invoking the relevant Klarna operation.
SAP S/4HANA Coordinate order, fulfillment, invoicing, payment capture, and refund information across enterprise finance and commerce processes. SAP S/4HANA → Martini → Klarna Martini orchestrates APIs between SAP and Klarna, transforms monetary and order-line models, validates state transitions, and records operation references for reconciliation.

How to build a Klarna integration in Martini

Objective

Configure Klarna test and production environments with protected merchant credentials and explicit regional settings.

Instructions in Martini

  • Store the Klarna API username and password in Martini secrets or environment configuration.
  • Separate test and production credentials and endpoint configuration.
  • Do not log authorization headers, customer tokens, or unnecessary payment-related data.

Objective

Select the trigger that matches the business process: incoming application request, supported Klarna callback, fulfillment event, or scheduled synchronization.

Instructions in Martini

  • Use a Martini API for commerce, refund, or callback requests.
  • Use a workflow trigger for application or operational events.
  • Use a scheduler for reconciliation and incremental synchronization.

Objective

Call the relevant Klarna Payments, Checkout, or Order Management endpoint and retrieve current state before state-changing operations.

Instructions in Martini

  • Use REST API calls with the configured Basic Authentication credentials.
  • Page through list or search responses where applicable.
  • Persist a cursor, timestamp, or operation reference for repeatable processing.

Objective

Coordinate Klarna calls, downstream applications, validation, and durable integration state in a maintainable workflow.

Instructions in Martini

  • Separate fast callback acknowledgment from longer-running processing.
  • Use reusable workflow logic for common Klarna authentication, state, and error behavior.
  • Route validation failures and transient failures differently.

Objective

Translate Klarna payment, order, line, capture, and refund models into the target application’s canonical and business-specific structures.

Instructions in Martini

  • Map order lines, tax, shipping, discounts, currency, and totals explicitly.
  • Convert minor currency units and apply documented rounding rules.
  • Preserve Klarna identifiers and source-system references.

Objective

Enforce state, amount, consent, regional, and duplicate-protection rules before calling Klarna or writing downstream data.

Instructions in Martini

  • Confirm authorization before capture and captured value before refund.
  • Prevent cumulative captures or refunds from exceeding permitted amounts.
  • Use idempotency or duplicate-protection mechanisms where documented for the endpoint.

Common Klarna data objects used in integrations

ObjectTypical UseCommon target systemsMartini handling
Payment sessionConfigure available payment methods and initiate a Klarna payment experience.Shopify, Adobe Commerce, Salesforce Commerce Cloud, WooCommerceMartini maps checkout and customer data into the session request, stores the Klarna session reference, and returns the required response to the commerce application.
OrderRepresent a Klarna purchase created through Checkout or Order Management.Commerce platforms, NetSuite, SAP S/4HANA, SalesforceMartini synchronizes order identifiers, status, totals, addresses, and lifecycle changes while applying state and duplicate checks.
Order lineRepresent products, services, shipping, discounts, tax, or other order components.Commerce platforms, ERP and finance systemsMartini maps line quantities, prices, tax, discounts, shipping, and currency values while preserving minor-unit and rounding rules.
AuthorizationRecord the result and token associated with an approved payment.Commerce platforms, order-management systems, ERP systemsMartini stores authorization references securely, validates authorization state before downstream operations, and avoids logging sensitive values.
CaptureCapture all or part of an authorized payment, commonly after fulfillment.Warehouse systems, commerce platforms, NetSuite, SAP S/4HANAA workflow verifies fulfillment and permitted amounts, calls the capture operation, and records the Klarna capture reference.
RefundReturn all or part of captured funds.Commerce platforms, customer-service systems, ERP systemsMartini validates refundable amounts, persists source and Klarna identifiers, invokes the refund operation, and makes retries idempotent.

Authentication and security considerations

Merchant credentials

Klarna merchant APIs generally use an API username and password with HTTP Basic Authentication. Store these values in Martini secrets or protected environment configuration rather than embedding them in workflows.

Environment and access control

  • Use separate credentials and endpoint settings for test and production environments.
  • Restrict credentials to the Klarna products and operations required by each workflow.
  • Do not log authorization headers, customer tokens, or unnecessary payment-related payloads.

Personal and payment-related data

Klarna payloads may contain names, addresses, contact details, order information, and payment-related identifiers. Apply encrypted transport, data minimization, access controls, controlled logging, and appropriate retention policies.

Operational considerations for Klarna integrations

State and amounts

Capture and refund operations are state-dependent. Track authorized, captured, and refunded amounts in minor currency units, including tax, shipping, discounts, currency exponent, and rounding.

Pagination and synchronization

Use pagination for list and search operations and persist a cursor, timestamp, or last-successful checkpoint. Scheduled reconciliation is useful because webhook coverage is limited to selected events.

Retries and idempotency

Use bounded retries with backoff for transient failures, but do not blindly retry validation or authorization errors. Persist source request IDs, Klarna identifiers, operation type, amount, and result to prevent duplicate captures or refunds.

Regional and schema variation

Klarna endpoints, payment methods, API behavior, and available operations can vary by region, currency, merchant account, product, and environment. Isolate Klarna mappings, validate response schemas, and test changes in Klarna’s test environment before production deployment.

Why use Martini instead of scripts or point-to-point integrations?

Orchestrated integration logic

Martini coordinates Klarna API calls, commerce requests, fulfillment events, callbacks, reconciliation, and downstream writes in workflows rather than scattering logic across point-to-point scripts.

Reusable mappings and business rules

Reusable integration assets can centralize currency conversion, order-line mapping, state validation, duplicate checks, and refund or capture rules across multiple applications.

Operational resilience

Martini provides structured error handling, retry logic, checkpointing, callback acknowledgment patterns, and monitoring-friendly workflow behavior for payment and order processes.

Controlled API abstraction

Martini can expose a normalized REST API that hides Klarna-specific payloads from commerce, ERP, CRM, or customer-service applications while retaining the flexibility to call Klarna’s documented native APIs.

Frequently asked questions

How can Klarna be integrated with enterprise systems?

Klarna is primarily integrated through REST APIs for Payments, Checkout, Order Management, Customer Token, and related merchant capabilities. Selected products also provide webhook-style notifications for supported lifecycle events. Enterprise workflows typically combine server-to-server API calls, callback handling, scheduled reconciliation, and downstream synchronization.

Can Martini integrate with Klarna?

Yes. Martini can consume Klarna REST APIs, authenticate with protected merchant credentials, transform Klarna payloads, orchestrate payment and order workflows, and receive supported Klarna webhook notifications through a Martini API. No native Martini connector is documented in the supplied materials.

Do I need a connector to integrate Klarna with Martini?

No. A dedicated Klarna connector is not required. Martini can integrate using Klarna’s confirmed REST APIs, HTTP Basic Authentication, and selected webhook-style callbacks, with workflows handling mapping, validation, state transitions, retries, and downstream synchronization.

Is there any extra Lonti cost to integrate Klarna with Martini?

Lonti does not charge an additional per-connector or per-vendor fee to integrate Klarna. The integration is subject to the provisioned capacity of the Martini environment. Separate costs may apply from Klarna, cloud infrastructure, or other third-party systems based on subscriptions, usage, and deployment model.

Which Klarna APIs should an integration use?

Use Klarna Payments for payment sessions and authorization, Klarna Checkout for checkout order management, and Order Management for operational actions such as order updates, captures, and refunds. Customer Token capabilities should only be used when the relevant product, consent model, and merchant configuration support them.

Does Klarna support events or webhooks?

Klarna supports webhook-style notifications for selected product-specific order or payment lifecycle events, but coverage is not universal. Integrations should validate and deduplicate callbacks and use scheduled reconciliation where a required state change is not covered by notifications.

How does synchronization between Klarna and other systems work?

Synchronization can be event-driven when a supported callback is available, or scheduled through paginated REST API calls. Martini can maintain a timestamp, cursor, or last-successful checkpoint, map Klarna objects to a canonical model, and update commerce, ERP, CRM, or finance applications.

How are Klarna errors, retries, and duplicate operations handled?

Martini workflows can distinguish validation or authorization failures from transient failures, apply bounded retries with backoff, and route unrecoverable errors for investigation. Durable source and Klarna identifiers, operation amounts, state checks, and endpoint-supported idempotency or duplicate-protection mechanisms help prevent duplicate captures and refunds.