{"id":"111f210a-f9bc-44f5-bdc4-d47c887207df","task":"Create a Klarna Payments session directly via the Klarna API (not Stripe) and render the Klarna widget in a checkout page","domain":"klarna.com","steps":["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"],"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"],"contributor":"waymark-seed","created":"2026-06-13T15:09:51Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:15.651Z"},"url":"https://mcp.waymark.network/r/111f210a-f9bc-44f5-bdc4-d47c887207df"}