Enable mutual TLS (mTLS) authentication for Klarna Payments callbacks so Klarna webhooks platform authenticates to your endpoint using client certificates.
Mutual Transport Layer Security (mTLS) extends standard TLS by requiring both parties to authenticate during the connection handshake. While standard TLS only verifies the server's identity, mTLS also verifies the client's identity using certificates. For callbacks, this means both Klarna and your endpoint authenticate to each other, providing stronger security guarantees than HMAC signatures alone.
Hosted Payment Page (HPP) distribution update callbacks
Authorization callbacks are server-side callbacks sent after a successful payment authorization. These callbacks help optimize conversion rates by ensuring order creation even when client-side communication fails. For detailed information about authorization callbacks, refer to the Authorization callback documentation.
HPP status update callbacks notify your system whenever the status of an HPP session changes based on consumer actions (e.g., IN_PROGRESS, COMPLETED, FAILED, CANCELLED). HPP distribution update callbacks notify your system when an HPP session is distributed to a consumer. For detailed information about HPP callback payloads and behavior, refer to the HPP Status Callbacks documentation.
By default, callbacks sent via the Klarna Network webhooks platform do not include HMAC authentication.
Important: Once a callback configuration is registered as a webhook for a given legacy merchant ID, it will be fully respected. This means callbacks matching the subscribed event types will be sent to the URL specified in the registered webhook configuration, rather than the callback URLs specified in the individual payment requests.
If your integration requires callbacks to be secured with authentication:
HMAC authentication only: Register your Klarna Payments callbacks as webhooks through the Notifications API using the following event types. This enables HMAC signature verification for callback requests:
klarna_payments.kp.authorization - for authorization callbacks
klarna_payments.hpp.status_update - for HPP status update callbacks
klarna_payments.hpp.distribution_update - for HPP distribution update callbacks
HMAC authentication + mTLS: Register your callbacks as webhooks with the event types listed above and configure them with the outbound_client_certificate_id field. Follow the step-by-step guide below to enable both HMAC and mTLS authentication for your callbacks.
When you enable mTLS for callbacks, you gain:
Bidirectional authentication: Klarna authenticates to your endpoint using a client certificate when delivering callbacks as webhooks, and your endpoint validates Klarna's identity before processing payloads.
Defense-in-depth security: mTLS works in conjunction with HMAC signature verification for layered protection.
This guide walks you through configuring mTLS for callbacks sent as webhooks.
sequenceDiagram
participant Partner as PARTNER
participant API as NOTIFICATIONS API
participant Webhook as WEBHOOK ENDPOINT
participant Platform as KLARNA WEBHOOKS PLATFORM
autonumber
Partner->>Webhook: Configure endpoint to require mTLS
Partner->>API: Create signing key
Note over Partner, API: POST /v2/notification/signing-keys
API-->>Partner: Return signing_key_id and signing_key
Partner->>API: Create webhook with mTLS
Note over Partner, API: POST /v2/notification/webhooks<br/>with outbound_client_certificate_id
API-->>Partner: Return webhook_id
Partner->>API: Test webhook
Note over Partner, API: POST /v2/notification/webhooks/{id}/simulate
API->>Platform: Trigger webhook delivery
Platform->>Webhook: Deliver webhook with client certificate
Note over Platform, Webhook: mTLS handshake
Webhook->>Webhook: Verify client certificate
Webhook->>Webhook: Verify HMAC signature
Webhook-->>Platform: Return 200 OK
The outbound_client_certificate_id field is an optional parameter used when creating or updating webhooks. This field enables mTLS authentication for webhook deliveries:
Purpose: Specifies which client certificate Klarna webhooks platform should present when connecting to your webhook endpoint
Type: Optional string field
Format: Must be a valid client certificate ID (e.g., krn:partner:global:notification:client-certificate:a1b2c3d4-e5f6-4a5b-8c7d-9e0f1a2b3c4d)
Availability: Reach out to your Klarna contact to obtain the valid certificate_id for your account
When to use: Include this field when creating callback configuration if you want Klarna to authenticate using mTLS when delivering notifications to your endpoint
If you omit the outbound_client_certificate_id field when configuring a callback as a webhook, Klarna delivers callbacks without mTLS client certificate authentication. You can add it later by updating the webhook.
Best practice: Implement both mTLS certificate verification and HMAC signature verification for defense-in-depth security. HMAC authentication is supported when you configure your callback endpoint as a webhook.
If you have an existing callback configured as a webhook and want to add mTLS, use the PATCH endpoint (contact your designated technical point of contact at Klarna to request access to the API reference documentation):
Use the certificate_id provided by your Klarna integration manager.
Recommendation: Test the updated callbacks as webhooks configuration thoroughly before using it for production traffic. Use the webhook simulation feature to validate the setup.
All certificate management including rotation, expiration monitoring, and lifecycle management is handled entirely by Klarna. You don't need to perform any certificate management tasks.
Use defense in depth: Implement both mTLS and HMAC signature verification
2.
Validate certificate details: Verify the CN matches the expected Klarna-managed certificate CN (webhooks-client.klarna.com for production, webhooks-client.test.klarna.com for playground)
3.
Log authentication failures: Monitor and alert on mTLS authentication failures
4.
Test thoroughly: Use the webhook simulation feature to validate your setup before going live
5.
Do not pin certificates: Never pin the specific certificate as Klarna may rotate it without notice. Always verify the certificate is valid and matches the expected CN instead.