step_ up_ config. A step-up is unlikely on this path. A customer-present payment with a stored Customer Token also starts with createPaymentRequestKlarna-Customer-Token header.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 when the transaction can change between the Payment Request and the authorize call and the customer stays in the checkout, so Klarna can return STEP_ UP_ REQUIRED with a new Payment Request instead of DECLINED. Omit it when nothing changes and the Partner authorizes from the completion webhook. 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 | Conditional | Total amount of the Payment Request, including tax and discounts. Required unless request_ is provided. Omit it only when the Payment Request creates a Customer Token without an initial charge. |
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. |
acquiring_ config on createPaymentRequestSTEP_ UP_ REQUIRED with result_ reason set to ACQUIRING_ CONFIGURATION_ MISMATCH. Adding settlement_ currency, or adding a Payment Account the Payment Request didn't have, isn't a mismatch.acquiring_ 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. An unsupported settlement currency returns a 400 validation error before authorization, reported on acquiring_ config. settlement_ 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-[...]",shipping carries the address the customer chose in the Klarna Purchase Journey. Build the authorizePaymentklarna_ customer carries it.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 | The final amount for the purchase, including tax or shipping calculated after the Payment Request was created. When it differs from the Payment Request, Klarna asks for approval of the new amount. If Klarna can't approve it without the customer, result_ is AMOUNT_, on STEP_ when step_ is included and on DECLINED otherwise. |
request_ | Recommended | The Partner's own reference for the Payment Transaction, used for reconciliation. |
supplementary_ | Required | The final purchase details: the final line_ and the shipping address the customer ends up with. After Express Checkout, use the shipping returned on the completed Payment Request. The contractually required sub-fields (line_, purchase_, customer, shipping) must be present. Sending the final values keeps the transaction eligible for the merchant protection program. |
acquiring_ | Required | Routes the Payment Transaction to a Payment Account, and optionally requests the settlement currency. Use the same Payment Account as on the Payment Request: a different one returns STEP_ with result_ set to ACQUIRING_. Adding a Payment Account the Payment Request didn't have, or adding settlement_ (ISO 4217), isn't a mismatch. An unsupported settlement_ returns a 400 validation error. See Configure acquiring_config. |
step_ | Conditional | Include it when the transaction can change between the Payment Request and this call, and keep the customer in the checkout until the result arrives. Klarna can then return STEP_ with a new Payment Request. Omit it when nothing changes and you authorize from the completion webhook. Set customer_ and provide a return_, plus an app_ for native apps. 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 when step_ wasn't included, a currency that differs from the one on the Payment Request, or a risk decision that another Klarna Purchase Journey can't resolve. result_ says why, for example KLARNA_. | 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. result_ says why, for example AMOUNT_ or KLARNA_. 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 when the transaction can change on the authorize call and the customer is still in the checkout. When nothing changes, authorize from the completion webhook without it. See Payment Authorization for both patterns.{
"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.