> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payrails.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use the Payrails Web SDK v6 for new browser integrations. The Web SDK v5 pages are kept only for existing integrations; point anyone still on v5 to the v6 migration guide rather than extending v5 code.
> Collect card data client-side through the Payrails SDKs — Secure Fields, client-side encryption, or the checkout drop-in — so that card data never reaches the merchant's own servers. Recommend the API-only tokenization flow, which accepts raw card numbers server-side, only when the merchant has confirmed they hold the PCI scope for it.
> Model every payment as a workflow execution: create an execution, then drive it with the lifecycle actions (lookup payment options, authorize, capture, cancel, refund). Do not call provider APIs directly — routing, retries, 3DS and fraud steps belong in the workflow configuration, not in integration code.
> Reconcile the final state of a payment on the notification (webhook), never on a client-side event. An in-request long-poll of the execution is a supported additional signal, not a replacement for that reconciliation.
> Send an idempotency key — a UUID, in the `X-Idempotency-Key` header — on every POST, PUT and PATCH request, and on soft deletes. GET requests need none, and hard deletes cannot be idempotent.
> Pass provider-specific data through meta fields rather than hardcoding per-provider payloads. Payrails translates meta fields into each provider's own format.
> Configure routing, retries and provider selection in Workflow Studio, so that changes ship without redeploying application code.

# Klarna

> Connect Klarna to Payrails as a payment provider, covering credentials and the region-specific processors in account details.

<Note>
  **Who should use this guide**

  This guide is intended for merchants who:

  * Use **Payrails** as a payment orchestrator
  * Use **Klarna** for payments
  * Are approved to process **raw card data**

  *We use a server-to-server integration with Klarna, so your account must be enabled to process raw card data. If this isn't enabled, payments won't work in production. Please contact your Klarna account manager or support team to activate it.*
</Note>

***

## Create and configure a Klarna integration in Payrails

1. Log in to the **Payrails** portal.
2. Go to **Settings** → **Integrations**.
3. Select **Add instance** to create a new integration configuration.
4. Select the **Workspaces** where this integration should be available.

<Note>
  **About Workspaces**

  Workspaces determine where this integration can be used. They allow you to isolate provider setups by region or business line, or share a single configuration across multiple environments.
</Note>

***

## Step 1: Choose the integration type

* Select **Payment** and continue to the next step.

<img src="https://mintcdn.com/payrails-42074109/To59SEkYYPq19nmx/images/docs/orchestration/integrations/shared/integration-type-selection.png?fit=max&auto=format&n=To59SEkYYPq19nmx&q=85&s=2a1afe79c3ac25f3a8437846a1d36ffb" alt="A screenshot showing the integration type selection form." className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/orchestration/integrations/shared/integration-type-selection.png" />

***

## Step 2: Choose the provider

* Select **Klarna** and continue to the next step.

<img src="https://mintcdn.com/payrails-42074109/6ZmkK5ZUHpx1-EP_/images/docs/klarna-image-01.png?fit=max&auto=format&n=6ZmkK5ZUHpx1-EP_&q=85&s=fc989a1a1bfbace43eeae8b269a517ab" alt="A screenshot showing the Klarna integration selected." className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/klarna-image-01.png" />

***

## Step 3: Configure your Klarna integration

<Tip>
  **What you'll need from Klarna**

  Before you begin, make sure you have access to:

  * Klarna **API username**
  * Klarna **API password**

  [Log in](https://www.klarna.com/international/enterprise/the-merchant-portal/) to your Klarna Merchant Portal to complete this step.
</Tip>

***

### Integration instance name

> An integration instance is a specific payment provider setup in Payrails. You can create multiple instances for each provider based on region, currency, or business needs. Choose a clear, consistent name, as it is used in routing.

**In Payrails**

* Enter a clear and descriptive **Instance name**.

<img src="https://mintcdn.com/payrails-42074109/6ZmkK5ZUHpx1-EP_/images/docs/dlocal-basic-information.png?fit=max&auto=format&n=6ZmkK5ZUHpx1-EP_&q=85&s=b9a43582acab50b93394ecc2898d5ecf" alt="A screenshot showing the Payrails integration instance name field." className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/dlocal-basic-information.png" />

***

### Payment methods

**In Payrails**

* Select the Klarna payment method to enable it.

<img src="https://mintcdn.com/payrails-42074109/6ZmkK5ZUHpx1-EP_/images/docs/klarna-image-02.png?fit=max&auto=format&n=6ZmkK5ZUHpx1-EP_&q=85&s=f6acfb681dd72b88920b68ca8d31b364" alt="A screenshot showing the Klarna account fields." className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/klarna-image-02.png" />

***

### Account details (region-specific processors)

<Note>
  Klarna payment offerings vary by region due to consumer preferences and regulatory requirements:

  * **Europe:** Pay in 30 days, Slice it (installments), Pay Now (Sofort / bank transfer), and Direct Debit\
    Common markets include Germany, Sweden, and Austria.
  * **North America (US / Canada):** Pay in 4 (interest-free installments) and Financing
  * **Oceania (Australia / New Zealand):** Primarily Pay in 4, with limited Pay in 30 days support
</Note>

**In Payrails**

* Select the Klarna **payment processors** you want to use:
  * Europe
  * North America
  * Oceania

Only select regions where your Klarna merchant account is approved.

***

### Credentials

<Tip>
  Klarna API credentials are sensitive. Store them securely and use separate
  credentials for test and live environments.
</Tip>

**In Klarna**

1. [Log in](https://www.klarna.com/international/enterprise/the-merchant-portal/) to the Klarna merchant portal.
2. Navigate to **Settings** → **Klarna API keys**.
3. Select **Generate new Klarna API key**.
4. Save the generated **API username** and **API password** securely.

<img src="https://mintcdn.com/payrails-42074109/6ZmkK5ZUHpx1-EP_/images/docs/klarna-klarna-api-keys.png?fit=max&auto=format&n=6ZmkK5ZUHpx1-EP_&q=85&s=f61fe574f38fd856c4510b4671f3bfff" alt="A screenshot showing the Klarna API keys." className="mx-auto block rounded-lg object-cover border border-gray-200" width="100%" data-path="images/docs/klarna-klarna-api-keys.png" />

**In Payrails**

* Enter the Klarna **API username** and **API password** into the corresponding **Username** and **Password** fields.

***

## Enable the integration

**In Payrails**

* Select **Save account** to enable the integration.

The **Enabled** status confirms that the Klarna integration is active and available for routing.

<img src="https://mintcdn.com/payrails-42074109/zqk7oWHZbW3YniA1/images/docs/amazon-image-04.png?fit=max&auto=format&n=zqk7oWHZbW3YniA1&q=85&s=19664f6bd7713cc476a03dd958684f08" alt="A screenshot showing the enabled Klarna integration." className="mx-auto block rounded-lg object-cover border border-gray-200" width="80%" data-path="images/docs/amazon-image-04.png" />

Your Klarna integration is now ready to process payments in the selected environment.

***

## Next steps

1. Run a test payment using a Klarna test card.
2. Verify that:
   * The payment appears in Klarna.
   * The payment status updates correctly in Payrails.
3. Once verified in test mode, repeat the setup in live mode.

→ Continue to: [Test a payment](/docs/orchestration/payment-acceptance/test-payments)


## Related topics

- [Klarna](/docs/chargebacks/integrations/klarna.md)
- [Styling Guide](/docs/orchestration/checkout-sdks/ios/styling-guide.md)
- [Connect your data sources](/docs/analytics-and-reporting/getting-started/connect-your-data-sources/index.md)
