# Klarna MCP for AI Agents AI Agent Connect

> Klarna MCP lets you manage the entire payment lifecycle from checkout to fulfillment. Use it to create payment sessions, capture orders, issue refunds, and update shipping details directly through your AI agent. It bridges the gap between your merchant account and your daily operations, handling both the frontend checkout phase and the backend order management phase.

## Overview
- **Category:** money-moves
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_vZdqoCN35YPB9qiS0AGFloESnhsQlmd6Me2hypxH/ai-agent-connect
- **Tags:** checkout, buy-now-pay-later, order-management, payment-gateway, fulfillment, fintech

## Description

Klarna connects your merchant account to your AI agent so you can manage e-commerce payments and order fulfillment through natural language. This Connector handles the heavy lifting of interacting with both the Klarna Payments API and the Order Management API. Instead of hunting through a merchant portal to find specific transaction IDs, you can ask your agent to check a status, trigger a payment capture, or issue a refund. It turns a complex, multi-step API process into a simple conversation. Since Vinkius hosts this, you can plug it into your existing workflow and let your agent do the work of tracking fulfillment and resolving financial discrepancies. You can have your agent pull order metadata, update shipping info, or cancel authorized payments without ever leaving your chat interface. It's about moving from manual data entry to direct action.

## Tools

### capture_klarna_order
Klarna capture_klarna_order triggers the actual payment for an order that was previously authorized. It is useful for finalizing sales once you have shipped the goods.

### create_payment_session
Klarna create_payment_session sets up a new checkout session with the correct amount and currency. Use this to get a client token for your frontend widget.

### get_order_details
Klarna get_order_details fetches all the data, status, and totals for a specific Klarna order. It helps you quickly audit any transaction.

### get_payment_session
Klarna get_payment_session pulls the details for an existing payment session to check its current state. Use it to verify session metadata.

### create_klarna_order
Klarna create_klarna_order places a formal order using a specific authorization token. This is key for managing the two-phase payment flow.

### refund_klarna_order
Klarna refund_klarna_order processes a refund for a captured order to return money to the customer. It simplifies the return process for your support team.

### update_order_shipping
Klarna update_order_shipping updates the shipping address or tracking number for a specific order. Use this to keep your fulfillment data current.

### cancel_authorized_order
Klarna cancel_authorized_order cancels an order that has been authorized but not yet captured. It helps clear pending items from your queue.

## Prompt Examples

**Prompt:** 
```
Check the status of order 55432.
```

**Response:** 
```
I've retrieved the details for order **55432**.

| Field | Details |
| :--- | :--- |
| **Status** | Captured |
| **Total Amount** | $150.00 USD |
| **Shipping** | Shipped |
| **Tracking** | 1Z999AA123456789 |

The payment was successfully processed and the package is in transit.
```

**Prompt:** 
```
I need to refund order 99887.
```

**Response:** 
```
I've processed a full refund for order **99887**.

* **Status:** Refunded
* **Amount:** $45.00 USD
* **Confirmation:** Refund successfully triggered to the customer's original payment method.
```

**Prompt:** 
```
Create a session for a $200 USD order.
```

**Response:** 
```
I've initialized a new Klarna payment session for your order.

* **Session ID:** `kl-sess-882211`
* **Client Token:** `tk_992837465512` 

You can now use this token in your frontend widget to complete the checkout.
```

## Capabilities

### Create checkout sessions
Generate new Klarna payment sessions with specific amounts and currencies.

### Capture authorized payments
Trigger the actual payment for orders that have already been authorized.

### Issue full or partial refunds
Process money back to customers for captured orders via simple commands.

### Update shipping and tracking
Push new shipping addresses or tracking numbers to Klarna for existing orders.

### Fetch order metadata
Retrieve detailed status, financial totals, and order details instantly.

### Cancel pending orders
Cancel orders that have been authorized but not yet captured for payment.

## Use Cases

### Processing a customer refund
A customer wants a refund for a returned item. The user asks the agent to refund order 98765, and the agent uses refund_klarna_order to return the funds.

### Updating tracking for a shipped order
An order is ready for delivery. The user tells the agent to update the tracking for order ABC, and it calls update_order_shipping to sync the data.

### Auditing transaction totals
A finance controller needs to know the status of a high-value order. The agent uses get_order_details to pull the full history and total amount.

### Generating checkout tokens
A developer needs a client token for a new order. The agent uses create_payment_session to generate it for the frontend widget instantly.

## Benefits

- Stop manual data entry by using create_payment_session to set up checkouts instantly without clicking through menus.
- Speed up fulfillment by using update_order_shipping to push tracking numbers to Klarna directly from your chat.
- Reduce refund friction by triggering refund_klarna_order with a simple text command instead of logging into a portal.
- Get instant visibility into transaction totals using get_order_details for any order ID to help with fast auditing.
- Handle complex payment states by using cancel_authorized_order to clear pending items from your dashboard.
- Simplify the two-phase payment flow by using capture_klarna_order to finalize sales once your team is ready.

## How It Works

The bottom line is you get a way to manage Klarna's payment and fulfillment lifecycle through a simple chat interface.

1. Connect your Klarna API Key, Shared Secret, and Region Domain in your Connector client.
2. Give your agent a natural language command like 'Refund order 98765' or 'Update tracking'.
3. The agent calls the specific Klarna API and confirms the action was successful.

## Frequently Asked Questions

**Can the Klarna MCP handle my refunds?**
Yes, it lets your agent process full or partial refunds for captured orders using the refund_klarna_order tool. This saves you from having to manually navigate the merchant portal.

**Does this work for shipping updates?**
Yes, you can use it to push new tracking numbers and shipping details to Klarna for any existing order. It keeps your fulfillment data synced automatically.

**Can I use this to see my total sales?**
You can use get_order_details to see specific totals and metadata for any order in your account. This is great for quick audits or checking specific transaction amounts.

**How do I start a new payment?**
The Connector can create a new payment session with your specific currency and order lines to get a client token. Your agent can do this instantly when a customer starts a checkout.

**Can it cancel orders?**
Yes, it can cancel orders that have been authorized but haven't been captured yet. This is helpful for clearing out pending items that are no longer valid.

**Is this for the Klarna Payments API?**
Yes, it covers both the Payments API for checkouts and the Order Management API for post-purchase tasks. It's a complete solution for your payment lifecycle.

**How do I determine my Klarna Region Domain?**
Use `api.klarna.com` for Europe, `api-na.klarna.com` for North America, or `api.playground.klarna.com` for testing/sandbox environments.

**What is the difference between authorizing and capturing an order?**
Authorizing only reserves the funds. You must use the `capture_klarna_order` tool (typically when shipping) to actually move the money from the customer to your account.

**Can I process partial refunds?**
Yes, the `refund_klarna_order` tool accepts a JSON object where you can specify the exact amount and the specific items being refunded.