Authenticate with Klarna's API using HTTP Basic Auth with your Klarna API username and password (available in the Klarna Merchant Portal); the base URL is region-specific (e.g. api.klarna.com for EU, api-na.klarna.com for NA)
POST /payments/v1/sessions with order_lines (array of line items with name, quantity, unit_price, total_amount), order_amount (total in minor units), purchase_country, purchase_currency, and locale
The response contains a client_token; load the Klarna JavaScript library (js.klarna.com/web-sdk/v1/klarna.js) and call Klarna.Payments.init with the client_token
Call Klarna.Payments.load with the container selector to render the Klarna widget; the customer selects their preferred BNPL plan in the widget
On form submit, call Klarna.Payments.authorize with billing_address and shipping_address; on success the callback returns an authorization_token; POST this token to your server to create the Klarna order
Known gotchas
The session expires after a period (check Klarna documentation for current TTL); do not create sessions too far in advance of rendering the widget
Klarna requires order_lines to sum exactly to order_amount including tax and shipping; a mismatch causes a 400 error from Klarna's session endpoint
The authorization_token is single-use; if the customer navigates away and returns, you must call Klarna.Payments.authorize again to get a fresh token before creating an order
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp