# Klarna setup for PopMCP

You paste one Klarna API key from the Merchant Portal. PopMCP works out from the key whether it is live or playground, and finds its region by trying it.

- Auth: API credentials
- Setup time: 3 min
- API base URL: Live: https://api.klarna.com (Europe), https://api-na.klarna.com (North America), https://api-oc.klarna.com (Oceania). Playground: the same with .playground, such as https://api.playground.klarna.com. PopMCP picks the right one.
- Credentials screen: https://portal.klarna.com/
- Provider docs: https://docs.klarna.com/acquirer/klarna/get-started/integration-resilience/authentication/

## Before you begin

- A Klarna merchant account. For test data only, a free test account at portal.playground.klarna.com is enough.
- A login to the Klarna Merchant Portal (Klarna's documents also call it the Partner Portal) with the rights to manage API keys.
- Klarna taken directly from Klarna. If you offer Klarna through a payment provider, you may not have a Klarna API key of your own.

## Get your credentials

### 1. Open Klarna API keys

Sign in to the Merchant Portal: `portal.klarna.com` for live, `portal.playground.klarna.com` for test data. Open Settings, then Klarna API keys. If you have more than one store, choose the one you want first: a key belongs to one merchant id.

Screen: https://portal.klarna.com/

### 2. Generate a key and save it

Select Generate new Klarna API key. Klarna shows the key only once, so download it. It starts with `klarna_live_api_` on live and `klarna_test_api_` on the playground. A new key just for PopMCP is the safest choice, because you can disable it on its own.

Screen: https://portal.klarna.com/

### 3. Paste it into PopMCP

Open Klarna in PopMCP, paste the key into Klarna API key, and connect. There is nothing else to fill in: PopMCP reads live or playground from the key and finds your region, Europe, North America or Oceania, by trying it. It then asks for an order that cannot exist and reads one payout, which change nothing.

### 4. Only if yours is an older credential

Most people skip this. If Klarna gave you a username and password rather than a key that starts with `klarna_`, put the password in Klarna API key and the username under More options. Older credentials do not say live or playground, so PopMCP tries each until one answers.

### 5. Turn on disputes once, if you use them

The Disputes API has to be turned on once for your merchant id. Allow writes on the connection, then ask the AI to enroll your merchant id with `klarna_enroll_merchant_in_disputes`. Until then the dispute list can come back empty or refused, even when you have disputes.

Screen: https://portal.klarna.com/

## Fields PopMCP asks for

- Klarna API key (apiKey) [required]: From Settings > Klarna API keys in the Klarna Merchant Portal: Generate new Klarna API key. Stored encrypted, used server-side only.
- Username (only for older credentials) (username): Only if your credential came as a username and password. Put the password in the API key box above.

## Verify

PopMCP shows Klarna as Verified, named with your merchant id when it can read one, the region, and live or playground. Ask for an overview: klarna_account_overview answers with the system, your latest payouts and the disputes waiting on you.

## Troubleshooting

### "Klarna did not accept this key on any of its systems"

Cause: The key was copied incompletely, disabled, or deleted. Klarna switches off keys unused for two months and deletes them after ten.

Fix: Generate a new key under Settings, Klarna API keys, and paste that.

### "New Klarna keys start with klarna_live_api_ or klarna_test_api_"

Cause: What you pasted is not a key, or it is the password of an older credential.

Fix: Paste the whole key. For an older credential, add its username under More options.

### "Klarna knows this key but refused it"

Cause: The key was disabled, or belongs to a different kind of account, such as one run by a payment provider.

Fix: Check the key is active in the portal, or generate a new one. If a payment provider runs your Klarna, ask them.

### A tool says the order does not exist

Cause: Klarna only finds orders by their own UUID, not your order number or the short Klarna reference, and playground orders do not exist on live.

Fix: Copy the order id from the Merchant Portal or your store. Klarna has no way to search orders by other fields.

### A capture or refund is refused

Cause: The amount is more than the order allows, or the order is cancelled or expired.

Fix: Ask for the order: klarna_get_order shows can_capture_up_to, can_refund_up_to and can_cancel.

### The dispute list is empty, or answers 403

Cause: The Disputes API is not turned on for this merchant id, or the account uses an older version.

Fix: Run klarna_enroll_merchant_in_disputes once, or try the v3, v2 and v1 tools through klarna_search_tools.

### Payout tools answer 403

Cause: This key cannot read settlements.

Fix: Generate a new key, or ask Klarna merchant support to allow it.

---

Source: https://www.docs.popmcp.com/docs/integrations/klarna/