# Klarna

```json
{
  "name": "Klarna",
  "slug": "klarna",
  "url": "https://composio.dev/toolkits/klarna",
  "markdown_url": "https://composio.dev/toolkits/klarna.md",
  "logo_url": "https://logos.composio.dev/api/klarna",
  "categories": [
    "e-commerce"
  ],
  "is_composio_managed": false,
  "updated_at": "2026-11-12T05:33:26.884Z"
}
```

![Klarna logo](https://logos.composio.dev/api/klarna)

## Description

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Klarna MCP or direct API to create payment sessions, manage orders, retrieve settlements, and handle customer tokens through natural language.

## Summary

Klarna is a merchant payments platform for checkout, payments, orders, and settlements.
It helps businesses offer flexible payment options with streamlined payment operations.

## Categories

- e-commerce

## Toolkit Details

- Tools: 58

## Images

- Logo: https://logos.composio.dev/api/klarna

## Authentication

- **Api Key**
  - Type: `api_key`
  - Description: Api Key authentication for Klarna.
  - Setup:
    - Configure Api Key credentials for Klarna.
    - Use the credentials when creating an auth config in Composio.

## Suggested Prompts

- List recent Klarna orders awaiting capture
- Retrieve details for Klarna order 12345
- Check settlement status for last month

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `KLARNA_ABORT_CHECKOUT_ORDER` | Abort Checkout Order | Irreversibly abort an incomplete legacy Klarna Checkout order. |
| `KLARNA_ACCEPT_DISPUTE_LOSS` | Accept Dispute Loss | Irreversibly request acceptance of the financial loss for a Klarna dispute. HTTP 202 means Klarna accepted the request for processing; use GET_DISPUTE to verify that the dispute closed and the chargeback was activated. |
| `KLARNA_ACKNOWLEDGE_ORDER` | Acknowledge Order | Acknowledge receipt of a Klarna order so order processing can continue. |
| `KLARNA_ADD_CAPTURE_SHIPPING_INFO` | Add Capture Shipping Info | Append shipping carrier and tracking information to a Klarna capture. |
| `KLARNA_ADD_ORDER_SHIPPING_INFO` | Add Order Shipping Info | Append shipping carrier and tracking information to a Klarna order. |
| `KLARNA_CANCEL_AUTHORIZATION` | Cancel Authorization | Irreversibly cancel a Klarna payment authorization before an order is created from it. |
| `KLARNA_CANCEL_ORDER` | Cancel Order | Irreversibly cancel an uncaptured Klarna order that is not closed. Cancellation cannot be undone. |
| `KLARNA_CAPTURE_ORDER` | Capture Order | Irreversibly capture all or part of an authorized Klarna order and return the created capture ID. |
| `KLARNA_CREATE_CARD_PROMISE` | Create Card Promise | Create a Klarna card promise for an order. This Merchant Card Service operation requires Virtual Card Number (VCN) entitlement. Creating a new promise irreversibly invalidates the previous promise for the same order. |
| `KLARNA_CREATE_CARD_SETTLEMENT` | Create Card Settlement | Create a Klarna settlement for a completed order and issue its encrypted virtual cards. This Merchant Card Service operation requires Virtual Card Number (VCN) entitlement and commits a new settlement, an irreversible effect. |
| `KLARNA_CREATE_CHECKOUT_ORDER` | Create Checkout Order | Create a legacy Klarna Checkout V3 order and return its checkout details. |
| `KLARNA_CREATE_CUSTOMER_TOKEN_FROM_AUTHORIZATION` | Create Customer Token From Authorization | Create a reusable Klarna customer token from a payment authorization token for subscription purchases. |
| `KLARNA_CREATE_HPP_SESSION` | Create HPP Session | Create a Hosted Payment Page session from an existing Klarna Payments session or Checkout order URL. The returned distribution-module token is sensitive and must not be logged or persisted. |
| `KLARNA_CREATE_ORDER_FROM_AUTHORIZATION` | Create Order From Authorization | Create a Klarna order from a customer authorization token. When order.auto_capture is true, Klarna also captures payment automatically. |
| `KLARNA_CREATE_ORDER_FROM_CUSTOMER_TOKEN` | Create Order From Customer Token | Create a Klarna order using a reusable customer token. Setting auto_capture to true captures the payment automatically. |
| `KLARNA_CREATE_PAYMENT_SESSION` | Create Payment Session | Create a Klarna Payments session and return its session ID, sensitive client token, and available payment method categories. |
| `KLARNA_DISABLE_HPP_SESSION` | Disable HPP Session | Irreversibly disable a Klarna Hosted Payment Page session that has not completed. |
| `KLARNA_DISTRIBUTE_HPP_SESSION` | Distribute HPP Session | Distribute a Klarna Hosted Payment Page link by email, SMS, or a documented token access ID. Warning: choosing email or SMS immediately sends a message to the specified external recipient; confirm the destination before calling. |
| `KLARNA_DOWNLOAD_DISPUTE_ATTACHMENT` | Download Dispute Attachment | Download a merchant or customer evidence attachment from a Klarna payment dispute as a bounded file reference. |
| `KLARNA_DOWNLOAD_PAYOUT_PDF` | Download Payout PDF | Download the PDF settlement report for one payout. |
| `KLARNA_DOWNLOAD_PAYOUTS_SUMMARY_PDF` | Download Payouts Summary PDF | Download a PDF payout summary for a payout date-time range. |
| `KLARNA_DOWNLOAD_PAYOUTS_SUMMARY_TRANSACTIONS_CSV` | Download Payouts Summary Transactions CSV | Download a CSV summary of Klarna payouts and transactions for an inclusive payout date-time range. |
| `KLARNA_DOWNLOAD_PAYOUT_TRANSACTIONS_CSV` | Download Payout Transactions CSV | Download a CSV report containing one payout and its transactions. |
| `KLARNA_ENROLL_DISPUTE_MERCHANT` | Enroll Dispute Merchant | Irreversibly activate Disputes v3 handling for one direct Klarna merchant account. This account onboarding cannot be undone through the API. Partners cannot use this operation to enroll individual merchants; HTTP 204 also means the merchant was already enrolled. |
| `KLARNA_ENROLL_DISPUTE_PARTNER` | Enroll Dispute Partner | Irreversibly activate Disputes v3 handling for one Klarna partner account. This account onboarding cannot be undone through the API. partner_id identifies the partner account and client_id supplies the merchant OAuth2 client ID in the request body. Merchants cannot use this operation to enroll a partner; HTTP 204 also means the partner was already enrolled. |
| `KLARNA_EXTEND_CAPTURE_DUE_DATE` | Extend Capture Due Date | First call KLARNA_LIST_CAPTURE_DUE_DATE_OPTIONS for this order and capture, then extend the payment due date using one returned option. Fetch the options before this action because some extensions can cost money. |
| `KLARNA_EXTEND_ORDER_AUTHORIZATION_TIME` | Extend Order Authorization Time | Extend the authorization validity period for an order that is still AUTHORIZED and delayed unexpectedly. Call this before capture or release changes the order state; Klarna does not allow extension after the order expires or is cancelled. For routinely long fulfillment periods, arrange extended authorization during merchant onboarding instead. |
| `KLARNA_GET_CAPTURE` | Get Capture | Return one Klarna capture by order ID and capture ID. |
| `KLARNA_GET_CARD_PROMISE` | Get Card Promise | Retrieve a Klarna card promise and its card specifications. This Merchant Card Service operation requires Virtual Card Number (VCN) entitlement. |
| `KLARNA_GET_CARD_SETTLEMENT` | Get Card Settlement | Retrieve a Klarna card settlement by settlement ID or by its associated order ID. Select the identifier with lookup_by and provide only its corresponding field. This Merchant Card Service operation requires Virtual Card Number (VCN) entitlement and returns encrypted card material that must be handled securely. |
| `KLARNA_GET_CHECKOUT_ORDER` | Get Checkout Order | Return a legacy Klarna Checkout order by order ID. |
| `KLARNA_GET_CUSTOMER_TOKEN` | Get Customer Token | Return a reusable Klarna customer token and its current status. |
| `KLARNA_GET_DISPUTE` | Get Dispute | Return a fully detailed Klarna Disputes v3 record, including associated merchant and customer evidence. The response preserves provider-added fields and accepts all current or future state values. |
| `KLARNA_GET_HPP_SESSION` | Get HPP Session | Return the current details and distribution state of a Klarna Hosted Payment Page session. |
| `KLARNA_GET_ORDER` | Get Order | Return a Klarna order and its current authorization, capture, refund, shipping, and customer details. |
| `KLARNA_GET_PAYMENT_SESSION` | Get Payment Session | Return the current details of a Klarna Payments session by session ID. The response may contain sensitive client or authorization tokens; do not log or persist them. |
| `KLARNA_GET_PAYOUT` | Get Payout | Return one Klarna payout by payment reference. |
| `KLARNA_GET_PAYOUT_SUMMARY` | Get Payout Summary | Return Klarna payout totals grouped by currency for an inclusive payout date-time range. |
| `KLARNA_GET_REFUND` | Get Refund | Return one Klarna refund by order ID and refund ID. |
| `KLARNA_GET_VCC_ORDER_CANCELLATION` | Get VCC Order Cancellation | Retrieve the asynchronous cancellation status for a Klarna order with a Virtual Credit Card settlement. This operation requires Virtual Card Number (VCN) entitlement and does not itself change the order. |
| `KLARNA_LIST_CAPTURE_DUE_DATE_OPTIONS` | List Capture Due Date Options | List the due-date extension options available for a Klarna capture. |
| `KLARNA_LIST_DISPUTES` | List Disputes | Return one page of Klarna Disputes v3 records using all documented filters. Repeated-array and CSV query serialization follow the provider contract; use next_cursor to request one additional page. |
| `KLARNA_LIST_ORDER_CAPTURES` | List Order Captures | Return all captures recorded for a Klarna order. |
| `KLARNA_LIST_PAYOUTS` | List Payouts | Return one offset-controlled page of Klarna payouts, optionally filtered by payout date range and currency. |
| `KLARNA_LIST_SETTLEMENT_TRANSACTIONS` | List Settlement Transactions | Return one offset-controlled page of Klarna settlement transactions, optionally filtered by payout reference or order ID. |
| `KLARNA_REFUND_ORDER` | Refund Order | Irreversibly create a full or partial Klarna refund and return the created refund ID. |
| `KLARNA_RELEASE_REMAINING_AUTHORIZATION` | Release Remaining Authorization | Irreversibly release the uncaptured authorization remaining on a Klarna order. Use only when no further capture is needed; this does not refund captured funds. This may also normalize the order total: in live testing, a partial capture followed by release reduced order_amount to captured_amount. |
| `KLARNA_REQUEST_CUSTOMER_TOKEN_CANCELLATION` | Request Customer Token Cancellation | Request asynchronous cancellation of a reusable Klarna customer token by changing its status to CANCELLED. Once Klarna processes the request, the token can no longer be used for new orders; HTTP 202 confirms acceptance, not that the state change has completed. |
| `KLARNA_REQUEST_VCC_ORDER_CANCELLATION` | Request VCC Order Cancellation | Irreversibly request cancellation of a Klarna order associated with a Virtual Credit Card settlement. This operation requires Virtual Card Number (VCN) entitlement. It mutates the order: an existing cancellation returns CANCELLED, while a new request is queued asynchronously and returns PENDING. |
| `KLARNA_RESEND_CAPTURE_CUSTOMER_COMMUNICATION` | Resend Capture Customer Communication | Irreversibly resend Klarna customer communication for a capture. Calling this action has an operational side effect: Klarna sends a communication to the customer. |
| `KLARNA_RESPOND_TO_DISPUTE` | Respond to Dispute | Submit reason-specific merchant evidence for a Klarna dispute request. |
| `KLARNA_UPDATE_CHECKOUT_ORDER` | Update Checkout Order | Update a legacy Klarna Checkout order and return the resulting order. |
| `KLARNA_UPDATE_ORDER_AUTHORIZATION` | Update Order Authorization | Update the authorized amount and order lines on an existing order. |
| `KLARNA_UPDATE_ORDER_CUSTOMER_DETAILS` | Update Order Customer Details | Update the permitted customer address details on an existing order. |
| `KLARNA_UPDATE_ORDER_MERCHANT_REFERENCES` | Update Order Merchant References | Update the merchant reference values stored on a Klarna order. |
| `KLARNA_UPDATE_PAYMENT_SESSION` | Update Payment Session | Update mutable data on an existing Klarna Payments session, including order amounts and lines, customer and billing or shipping addresses, merchant references and URLs, purchase locale and currency, payment options, and session intent. Klarna returns no session data after a successful update. |
| `KLARNA_UPLOAD_DISPUTE_ATTACHMENT` | Upload Dispute Attachment | Upload one merchant evidence attachment to a Klarna payment dispute. Klarna limits attachments to 7 MB. |
| `KLARNA_UPLOAD_DISPUTE_ATTACHMENTS` | Upload Dispute Attachments | Upload 1-10 merchant evidence attachments to one Klarna payment dispute, sequentially in input order. Each successful upload creates a separate attachment resource. The batch is not atomic: if a later upload fails, attachments uploaded earlier remain created. |

## Supported Triggers

None listed.

## Installation and MCP Setup

### Path 1: SDK Installation

#### Path 1, Step 1: Install Composio

Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
```python
pip install composio composio_openai openai
```

```typescript
npm install @composio/core @composio/openai openai
```

#### Path 1, Step 2: Create a Composio session

Initialize Composio with the OpenAI Responses provider and create a session scoped to Klarna
```python
import json
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
client = OpenAI()

session = composio.create(user_id="your-user-id", toolkits=["klarna"])
tools = session.tools()
```

```typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["klarna"] });
const tools = await session.tools();
```

#### Path 1, Step 3: Run Klarna tools with your agent

Send a request, execute the Klarna tool calls through the session, and print the final answer
```python
response = client.responses.create(
    model="gpt-5.6-sol",
    tools=tools,
    input=[{"role": "user", "content": "Retrieve the details for Klarna order order_12345"}],
)

while True:
    tool_calls = [o for o in response.output if o.type == "function_call"]
    if not tool_calls:
        break
    results = composio.provider.handle_tool_calls(response=response, session=session)
    response = client.responses.create(
        model="gpt-5.6-sol",
        tools=tools,
        previous_response_id=response.id,
        input=[
            {"type": "function_call_output", "call_id": call.call_id, "output": json.dumps(results[i])}
            for i, call in enumerate(tool_calls)
        ],
    )

print(response.output_text)
```

```typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "Retrieve the details for Klarna order order_12345" }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
```

### Path 2: MCP Server Setup

#### Path 2, Step 1: Install Composio

Install the Composio SDK and your agent framework
```python
pip install composio claude-agent-sdk
```

```typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
```

#### Path 2, Step 2: Create a session with MCP enabled

Create a session scoped to Klarna and read its MCP URL and headers
```python
from composio import Composio

composio = Composio()
session = composio.create(user_id="your-user-id", toolkits=["klarna"], mcp=True)
```

```typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["klarna"],
  mcp: true,
});
```

#### Path 2, Step 3: Connect your agent to the MCP server

Pass the session's MCP URL and headers to your agent and run a Klarna request
```python
import asyncio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions, AssistantMessage, TextBlock

options = ClaudeAgentOptions(
    mcp_servers={
        "composio": {
            "type": "http",
            "url": session.mcp.url,
            "headers": session.mcp.headers,
        }
    },
    system_prompt="You are a helpful assistant with access to Klarna tools.",
    tools=[],
    allowed_tools=["mcp__composio__*"],
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query("Retrieve the details for Klarna order order_12345")
        async for message in client.receive_response():
            if isinstance(message, AssistantMessage):
                for block in message.content:
                    if isinstance(block, TextBlock):
                        print(block.text)

asyncio.run(main())
```

```typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "Retrieve the details for Klarna order order_12345",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
```

## Why Use Composio?

### 1. AI Native Klarna Integration

- Supports both Klarna MCP and direct API based integrations
- Structured, LLM-friendly schemas for reliable tool execution
- Rich coverage for reading, writing, and querying your Klarna data

### 2. Managed Auth

- Secure API key handling without hard-coded credentials in agent code
- Central place to manage, scope, and revoke Klarna access
- Per user and per environment credentials for safer deployments

### 3. Agent Optimized Design

- Tools are tuned using real error and success rates to improve reliability over time
- Comprehensive execution logs so you always know what ran, when, and on whose behalf

### 4. Enterprise Grade Security

- Fine-grained RBAC so you control which agents and users can access Klarna
- Scoped, least privilege access to Klarna resources
- Full audit trail of agent actions to support review and compliance

## Use Klarna with any AI Agent Framework

Choose a framework you want to connect Klarna with:

- [ChatGPT](https://composio.dev/toolkits/klarna/framework/chatgpt)
- [Claude Cowork](https://composio.dev/toolkits/klarna/framework/claude-cowork)
- [Hermes](https://composio.dev/toolkits/klarna/framework/hermes-agent)
- [Atomic Agent](https://composio.dev/toolkits/klarna/framework/atomic-agent)

## Related Toolkits

- [Addresszen](https://composio.dev/toolkits/addresszen) - Addresszen is a real-time address autocomplete and verification service. It helps capture accurate, deliverable addresses with instant suggestions and validation.
- [Amazon](https://composio.dev/toolkits/amazon) - Amazon is a global e-commerce marketplace for products, sellers, and digital services. Its broad selection and reliable fulfillment help businesses reach customers worldwide.
- [Asin data api](https://composio.dev/toolkits/asin_data_api) - Asin data api gives you detailed, real-time product data from Amazon, including price, rank, and reviews. Perfect for e-commerce pros and data-driven marketers who need instant marketplace insights.
- [Baselinker](https://composio.dev/toolkits/baselinker) - BaseLinker is an all-in-one e-commerce management platform connecting stores, marketplaces, carriers, and more. It streamlines order processing, inventory control, and automates your sales operations.
- [Bestbuy](https://composio.dev/toolkits/bestbuy) - Best Buy is a leading retailer offering APIs for product, store, and recommendation data. Instantly access up-to-date retail insights for smarter shopping and decision-making.
- [Bluebarry](https://composio.dev/toolkits/bluebarry) - Bluebarry is a customer data and product-advice platform for shopper identities, profiles, and recommendations. It helps teams analyze customer context and synchronize shopper data for better commerce experiences.
- [Btcpay server](https://composio.dev/toolkits/btcpay_server) - BTCPay Server is a free, open-source, self-hosted Bitcoin payment processor. It lets merchants accept Bitcoin payments directly, cutting out middlemen and boosting privacy.
- [Cdr platform](https://composio.dev/toolkits/cdr_platform) - Cdr platform is an API for purchasing carbon dioxide removal services. It enables businesses to offset emissions by accessing verified carbon removal projects.
- [ClickFunnels 2.0](https://composio.dev/toolkits/clickfunnels) - ClickFunnels 2.0 is a sales funnel and online business platform for marketing, commerce, courses, and websites. It helps businesses build and manage customer journeys from one workspace.
- [Cloudcart](https://composio.dev/toolkits/cloudcart) - CloudCart is an e-commerce platform for building and managing online stores. It helps businesses streamline product listings, orders, and customer engagement.
- [Clover](https://composio.dev/toolkits/clover) - Clover is a point-of-sale and merchant platform that provides payments, orders, inventory, and device APIs. Use it to manage orders, customers, employees, payments, and receipts across locations.
- [Commerce Layer](https://composio.dev/toolkits/commerce_layer) - Commerce Layer is a headless commerce platform with transactional APIs for orders, inventory, pricing, customers, and fulfillment. Use it to centralize ecommerce operations and surface real-time commerce data.
- [Countdown api](https://composio.dev/toolkits/countdown_api) - Countdown API gives you real-time, structured eBay product data, reviews, and seller feedback. Perfect for powering price monitoring, product research, or marketplace analytics workflows.
- [Creem](https://composio.dev/toolkits/creem) - Creem is a merchant-of-record platform for managing products, checkouts, subscriptions, customers, licenses, discounts, transactions, refunds, and revenue operations. Helps businesses handle billing, compliance, and revenue workflows with a unified billing stack.
- [Dpd2](https://composio.dev/toolkits/dpd2) - Dpd2 is a robust email management platform for handling, sorting, and automating email workflows. Streamline your communications and boost productivity with advanced sorting, labeling, and response tools.
- [eBay](https://composio.dev/toolkits/ebay) - eBay is an online marketplace for buying and selling products worldwide. Its public APIs help developers access listings, categories, and marketplace data.
- [Finerworks](https://composio.dev/toolkits/finerworks) - FinerWorks is an online platform for fine art and photo printing services. Artists and photographers use it to order custom prints and manage print inventory efficiently.
- [Fingertip](https://composio.dev/toolkits/fingertip) - Fingertip is a business management platform for selling, booking, and customer engagement—all from a single link. It helps businesses streamline operations and connect with customers across social channels.
- [Fraudlabs pro](https://composio.dev/toolkits/fraudlabs_pro) - FraudLabs Pro is an online payment fraud detection service for e-commerce and merchants. It helps minimize chargebacks and revenue loss by detecting and preventing fraudulent transactions.
- [Gelato](https://composio.dev/toolkits/gelato) - Gelato is a print-on-demand platform for creating products, managing orders, checking stock, and finding shipping options. It helps businesses sell globally with local production, pricing, and fulfillment.

## Frequently Asked Questions

### Do I need my own developer credentials to use Klarna with Composio?

Yes, Klarna requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

### Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. [Learn more](https://docs.composio.dev/tool-router/overview).

### Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. [Learn more](https://trust.composio.dev).

### What if the API changes?

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
