Token charge Customer Present - Final authorization

When integrating Klarna, the final authorization is a critical step when the step-up scenario occurs. This guide walks you through the creation of a transaction using the klarna_network_session_token provided by Klarna.

{{#lst:Final authorization|Integration overview}}

Final authorization functions the same across all integration methods. If it has already been implemented—for example, with a server-only integration for one-time payments—it can be reused without modification.

Integration details

Request

After receiving the klarna_network_session_token from Klarna, call the Payment Authorize APIKlarna Icon to finalize the authorization. Pass the token in the Klarna-Network-Session-Token request header.

This request is performed entirely on the backend and does not involve customer interaction. As a result, the step_up_config object can be omitted.

Submit the same request payload that was used in the initial authorization request.

The klarna_network_session_token acts as an idempotency key. Repeating the request with the same token returns the same result, which allows safe retries.

In the request to the Payment Authorize APIKlarna Icon, specify the following parameters:

Payment AuthorizeKlarna Icon
POST:/v2/accounts/{partner_account_id}/payment/authorize
Show recommended
ParameterRequiredDescription
partner_account_id
Yes

Unique account identifier assigned by Klarna to the onboarded merchant

Here you can find all required parameters for this operation authorizePaymentKlarna Icon
SHELL
curl https://api-global.test.klarna.com/v2/accounts/{partner_account_id}/payment/authorize \
  -H 'Authorization: Basic <API key>' \
  -H 'Klarna-Network-Session-Token: ***' \
  -H 'Content-Type: application/json' \
  -d '{
        "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
        "currency": "USD",
        "request_payment_transaction": {
          "amount": 11800,
          "payment_option_id": "***",
          "payment_transaction_reference": "finalize-ref-1234"
        },

Response

When the integration is implemented correctly, Klarna approves the authorization and returns a payment_transaction. Klarna validates that the authorized payment amount matches the amount approved by the customer during the step-up flow.

If the supplementary_purchase_data differs materially from the data previously provided, Klarna may decline the authorization based on its risk assessment.

The result field can have the following values:

ResultDescriptionNext step

APPROVED

The authorization succeeded and a payment_transaction was created.Store the payment_transaction_id and proceed with post-purchase operations.

DECLINED

The authorization failed and no transaction was created. This typically indicates an issue with the authorization request, such as an amount mismatch.Review the request data, correct the integration if needed. Raise an incident if the issue persists.

Result: APPROVED

Handle this result when Klarna authorizes the payment without requiring customer interaction.

  • Read the payment_transaction from the response.
  • Store the payment_transaction_id.
  • Return a success response to the Partner.
  • Continue with post-purchase operations (for example, capture or refund) using the

Payment Transactions API.

Sample payload

JSON
{
  "payment_transaction_response": {
    "result": "APPROVED",
    "payment_transaction": {
      "payment_transaction_id": "krn:payment:eu1:transaction:6debe89e-98c0-[...]",
      "payment_transaction_reference": "transaction-reference-1234",
      "amount": 11800,
      "currency": "USD",
      "payment_funding": {
        "type": "INVOICE",
        "details": { }
      },

Result: DECLINED

Handle this result when Klarna rejects the authorization.

  • Do not retry the authorization unless explicitly instructed by Klarna.
  • Return a failure response to the Partner.
  • End the payment flow.

Sample payload

JSON
{
  "payment_transaction_response": {
    "result": "DECLINED",
    "result_reason": "PAYMENT_DECLINED"
  }
}