payment_ request_ id.payment. request. state-change. completed event to obtain the klarna_ network_ session_ token.payment. request. state-change. completed webhook event.return_ url on the Partner's domain (and an app_ return_ url for native mobile apps) where Klarna redirects the customer after the Klarna Purchase Journey.customer_ interaction_ config. method = HANDOVER. See Step 1: Create a Payment Request.
payment_ request_ id and a payment_ request_ url.payment_ request_ url. See Step 2: Redirect the customer to the Klarna Purchase Journey.
return_ url once the Klarna Purchase Journey ends.payment. request. state-change. completed webhook when the Payment Request transitions to COMPLETED. See Step 3: Receive the klarna_network_session_token.Klarna-Network-Session-Token header. Include step_ up_ config so Klarna can return STEP_ UP_ REQUIRED (and a new Payment Request) instead of DECLINED when additional customer interaction is needed. See Step 4: Authorize the payment.
STEP_ UP_ REQUIRED, redirect the customer through the new Klarna Purchase Journey, wait for the new Klarna Network Session Token, and call authorizePaymentcustomer_ interaction_ config describing how Klarna should hand the customer over to the Klarna Purchase Journey. Set method = HANDOVER and provide a return_ url (and an app_ return_ url for native apps).| Parameter | Requirement | Description |
|---|---|---|
currency | Required | Currency in ISO 4217 format. |
amount | Required | Total amount of the Payment Request, including tax and discounts. |
customer_ | Required | Set to HANDOVER for the redirect-based flow. |
customer_ | Required | URL on the Partner's domain where Klarna redirects the customer after the Klarna Purchase Journey. |
customer_ | Recommended | Application URL scheme that returns the customer to the Partner's native app after a mid-flow handover to a third-party app (for example, a bank app or the Klarna app). Not a substitute for return_. |
payment_ | Recommended | The Partner's own reference for the Payment Request, used for reconciliation. |
supplementary_ | Required | Purchase context required by Klarna. The following sub-fields are contractually required: line_, purchase_, customer, and shipping. See Supplementary purchase data. |
acquiring_ | Required | Routes the Payment Request to a specific Payment Account. See Configure acquiring_config below. |
acquiring_ config on createPaymentRequestacquiring_ config consistently on createPaymentRequestacquiring_ config property identifies which Payment Account processes the Payment Transaction. There are two ways to identify a Payment Account.payment_ acquiring_ account_ id and payment_ account_ reference to identify the Payment Account. This option is useful when the Partner manages Payment Accounts by their own reference strings rather than Klarna-generated IDs.| Property | Description |
|---|---|
payment_ | Unique identifier assigned by Klarna to the Acquiring Account. KRN format. |
payment_ | The Partner's own unique reference for the Payment Account, used to identify it without relying on Klarna-generated IDs. Maximum 255 characters. |
payment_ account_ id on its own to identify the Payment Account directly. This option is simpler when the Partner already has the Klarna-assigned Payment Account ID.| Property | Description |
|---|---|
payment_ | Unique Payment Account identifier assigned by Klarna. KRN format. |
settlement_ currency (ISO 4217) inside acquiring_ config to specify the currency Klarna uses to settle the Payment Transaction. When omitted, settlement defaults to the Payment Transaction currency. See Request settlement currency.curl https://api-global.test.klarna.com/v2/payment/requests \
-H 'Authorization: Basic <API key>' \
-H 'Content-Type: application/json' \
-d '{
"currency": "USD",
"amount": 11800,
"payment_request_reference": "partner-request-reference-1234",
"customer_interaction_config": {
"method": "HANDOVER",
"return_url": "https://partner.example/klarna-redirect?id={klarna.payment_request.id}",customer_ interaction_ config. interaction_ expiry to override the default 3-hour Payment Request lifetime. See Custom Payment Request expiry.SUBMITTED state, including the payment_ request_ url to redirect the customer to in Step 2:{
"payment_request_id": "krn:payment:us1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
"payment_request_reference": "partner-request-reference-1234",
"currency": "USD",
"amount": 11800,
"state": "SUBMITTED",
"state_context": {
"customer_interaction": {
"method": "HANDOVER",
"payment_request_id": "krn:payment:us1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",payment_ request_ url returned in Step 1.return_ url (or app_ return_ url on mobile) provided in customer_ interaction_ config, and issues a klarna_ network_ session_ token used to finalize the authorization.
return_ url and app_ return_ url set inside customer_ interaction_ config tell Klarna where to send the customer after they complete or stop the Klarna Purchase Journey.return_ urlreturn_ url after they finish, whether they complete or stop the flow.app_ return_ urlapp_ return_ url brings the customer back to the Partner's mobile app when this happens.yourapp:/ /klarna) that resumes the payment flow. Klarna invokes this URL after the customer completes a native app-based step. Resume the mobile app in its last state without applying state changes or deep link navigations.return_ url and app_ return_ url are not mutually exclusive. Depending on the device and environment, either or both may be triggered:| Scenario | Description |
|---|---|
| Pure web flow | The customer starts the Klarna Purchase Journey in a desktop browser. After completing the flow, Klarna redirects them to return_. |
| App-to-app flow | The Partner's native app opens the Klarna Purchase Journey using a universal link. When the Klarna app is installed, the customer goes directly into it. After completion, Klarna redirects them to app_. |
| WebView flow with app handover | The Partner's native app starts the Klarna Purchase Journey in a System WebView. When the customer must continue in an external native app, app_ returns them to the Partner's app mid-flow. They then resume in the WebView and, on completion, are redirected to return_. |
klarna_ network_ session_ token and the Payment Request transitions to COMPLETED. This token is used in Step 4 to finalize the authorization.klarna_ network_ session_ token is valid for only 1 hour and must be used within this time frame to finalize the authorization.payment. request. state-change. completed webhook (required)COMPLETED state, indicating that the customer has approved the purchase and the authorization can be finalized. Subscribe via the Webhooks registration guide.{
"metadata": {
"event_type": "payment.request.state-change.completed",
"event_id": "d9f9b1a0-5b1a-4b0e-9b0a-9e9b1a0d5b1a",
"event_version": "v2",
"occurred_at": "2024-01-01T12:00:00Z",
"correlation_id": "2d1557e8-17c3-466c-924a-bbc3e91c2a02",
"subject_account_id": "krn:partner:global:account:test:HGBY07TR",
"recipient_account_id": "krn:partner:global:account:test:LWT2XJSE",
"product_instance_id": "krn:partner:product:payment:ad71bc48-8a07-4919-[...]",payment. request. state-change. completed in two stages. In the webhook handler, verify the event, persist the payload — including the klarna_ network_ session_ token — durably against metadata. event_ id, and return a 2xx response immediately. Run everything that follows asynchronously, after the acknowledgment is sent.metadata. event_ id you have already recorded, confirm that it is recorded and return a 2xx response without repeating the work. Set up your webhooks defines the accepted acknowledgment responses and the retry schedule Klarna applies when one doesn't arrive.COMPLETED state, the token is available in state_ context. klarna_ network_ session_ token.{
"payment_request_id": "krn:payment:us1:request:552603c0-fe8b-4ab1-[...]",
"payment_request_reference": "partner-request-reference-1234",
"state": "COMPLETED",
"previous_state": "IN_PROGRESS",
"state_context": {
"klarna_network_session_token": "krn:network:us1:test:session-token:eyJhbGciOiJIU..."
},
"currency": "USD",
"amount": 11800,klarna_ network_ session_ token in the Klarna-Network-Session-Token request header. Klarna creates the Payment Transaction and returns the result.payment_ option_ id.| Parameter | Requirement | Description |
|---|---|---|
Klarna-Network-Session-Token (header) | Required | The Klarna Network Session Token received in Step 3. |
currency | Required | Same currency used in the Payment Request. |
request_ | Required | Same amount used in the Payment Request. |
request_ | Recommended | The Partner's own reference for the Payment Transaction, used for reconciliation. |
supplementary_ | Required | Same supplementary data sent on the Payment Request. The contractually required sub-fields (line_, purchase_, customer, shipping) must be present. Significant differences from the Payment Request may cause Klarna to require re-confirmation. |
acquiring_ | Required | Routes the Payment Transaction to the same Payment Account used on the Payment Request. Add settlement_ (ISO 4217) when settling in a currency that differs from the Payment Transaction currency. See Configure acquiring_config. |
step_ | Recommended | Opts the Partner in to the STEP_ outcome. When included, Klarna can request additional customer interaction (returning a new Payment Request) instead of declining cases where it needs more risk signals. Without it, those cases are returned as DECLINED. Set customer_ and provide a return_ (and an app_) so Klarna knows where to send the customer back after the step-up Klarna Purchase Journey. See Payment Authorization. |
curl https://api-global.test.klarna.com/v2/payment/authorize \
-H 'Authorization: Basic <API key>' \
-H 'Content-Type: application/json' \
-H 'Klarna-Network-Session-Token: krn:network:us1:test:session-token:eyJhbGciOiJIU...' \
-d '{
"currency": "USD",
"request_payment_transaction": {
"amount": 11800,
"payment_transaction_reference": "partner-transaction-reference-1234"
},payment_ transaction_ response object. The result field indicates the outcome and determines the next action:| Result | Description | Next steps |
|---|---|---|
APPROVED | The authorization succeeded and a payment_ was created. | Store the payment_ and proceed with post-purchase operations (capture, refund, etc.). Show the customer a confirmation page. |
DECLINED | The authorization was not approved. No transaction is created. Common causes include an expired Klarna Network Session Token, significant discrepancies between the Payment Request and the authorize call, or risk evaluation requiring additional customer interaction when step_ was not included in the request. | Show the customer a decline or alternative payment page. |
STEP_ | Klarna requires additional customer interaction before approving. Only returned when step_ was included in the authorize request. The response includes a new Payment Request with state_. | Redirect the customer to the new payment_, wait for the new Klarna Network Session Token (via webhook or by reading the Payment Request), and call authorizePayment |
step_ up_ config in the authorize request, Klarna cannot return STEP_ UP_ REQUIRED. It returns DECLINED instead in cases where additional customer interaction would have been needed. Klarna recommends including step_ up_ config by default to recover those cases.{
"payment_transaction_response": {
"result": "APPROVED",
"payment_transaction": {
"payment_transaction_id": "krn:payment:us1:transaction:6debe89e-98c0-[...]",
"payment_transaction_reference": "partner-transaction-reference-1234",
"amount": 11800,
"currency": "USD",
"payment_pricing": {...},
"payment_funding": {klarna_ network_ response_ data is only present in the response when klarna_ network_ data was sent in the request. Treat the value as opaque.