Who should use this guideThis guide is intended for merchants who:
- Use Payrails as a chargeback
- Use Klarna Disputes
Create and configure a Klarna integration in Payrails
- Log in to the Payrails portal.
- Go to Settings → Integrations.
- Select Add instance to create a new Klarna integration configuration.
- Select the Workspaces where this integration should be available.
About WorkspacesWorkspaces determine where this integration is available. They let you isolate provider setups by region or business line, or share the same configuration across multiple Workspaces.
Step one: Choose the integration type
- Select Dispute.
- Continue to the next step.

Step two: Choose the provider
- Select Klarna.
- Continue to the next step.

Step three: Configure your Klarna integration
Integration instance name
In Payrails- Enter an Instance name for your integration.

API Credential
In Klarna- Sign in to the Klarna Portal Dashboard.
-
Navigate to Settings > Klarna API Keys in the sidebar.

-
Locate your Merchant ID (MID). In the image below, the Merchant ID is K0123456.

- Generate a new Klarna API Key.
Klarna will display a one-time dialog containing a Username (UUID) and a Password (starting with
klarna_test_api_ for sandbox or klarna_live_api_ for production).- Copy the Username and Password.
- Paste the values into the Klarna Account section.

Klarna’s configuration
To enable your account to start working with Disputes via API, you need to interact with their API and reach out to your integration manager or technical point of contact, because they currently does not support the self-service for this whole process.Enrolling your merchant with Klarna Disputes API
Klarna’s Disputes API (V4) requires merchants to be enrolled before they can receive dispute events or call the dispute endpoints.This is a one-time, per-environment action. Call the Self onboarding for merchants endpoint using the credentials and merchant ID (MID) retrieved in the API Credential step. More details in Klarna’s documentation page.Production
Playground
Ask Klarna to register the notification URL
Once enrolled, Klarna still needs to:- Register the Payrails notification URL as the destination for your webhooks.
- Subscribe your account to the dispute webhook event types you need.
- Issue an HMAC signing key that Payrails will use to verify the authenticity of inbound notifications.
What to send
Reach out to your Klarna integration manager or technical point of contact with:- Merchant account identifier (your Klarna MID)
- Environment (Playground or Production)
- Notification URL copied from the Payrails Portal
- Event subscriptions requested:
payment.dispute.state-change.initiatedpayment.dispute.state-change.representmentpayment.dispute.state-change.pre-arbitrationpayment.dispute.state-change.arbitrationpayment.dispute.state-change.closedpayment.dispute.updated
- Request:
Please register the above URL as our notification endpoint, subscribe us to the listed dispute events, and provide the HMAC signing key so we can verify inbound webhooks
Setting up the HMAC signing key
Once you receive back the information requested in the step above, you will get back to your Payrails portal page and include the key in the corresponding field. In Payrails
- Paste the Signature key into the Signing keys field.
Enable the integration
In Payrails- Select Save account to enable the integration.

Next steps
- Run a test payment triggering a chargeback using a supported Klarna test account.
- Verify that:
- The dispute appears in Klarna.
- The chargeback status updates correctly in Payrails.
- Once verified in test mode, repeat the setup in live mode.