Token charge Customer Not Present

Learn to initiate payments using the payment:customer_not_present scope token and seamlessly integrate with Klarna's Payment Authorization API for efficient transaction handling.

Integration overview

With a previously created payment:customer_not_present scope token, Partners can initiate Klarna payments for subscriptions:

  1. The Partner sends a request to the Acquiring Partners to create a Klarna payment session that contains purchase details, customer_token or the token equivalent issued by the Acquiring Partner,interoperability_token and interoperability_data.
  2. The Acquiring Partner forwards the required payment context data to Klarna’s Payment Authorization API including:
    1. customer_token
    2. supplementary_purchase_data
      1. subscriptions
    3. step_up_config
    4. request_payment_transaction
  3. Klarna returns one of the following responses:
    1. APPROVED – Transaction is completed, proceed to confirmation and store payment_transaction_id.
    2. DECLINED – If the payment is denied, Acquiring Partners have to inform the Partner that the payment could not be completed.

Step 1: Gather and forward payment context data

Before calling the Payment Authorization APIKlarna Icon, update the Partner-facing API to collect Klarna-specific context provided by the Partner. This data preserves session continuity, enables interoperability across Klarna Network features and improves risk assessment.

Accept Klarna Network data points

  • klarna_network_session_token
    • Encodes Klarna session context, such as payment option preselection, prequalification results, or payment approval
    • May be present on the initial authorization request
    • Required when finalizing authorization after a step-up flow
  • klarna_network_data
    • Encodes additional Klarna Network context supplied by the Partner, including supplementary purchase data
    • Must not be parsed, enriched, or transformed

Below is an example of how Acquiring Partners can accept the Klarna Network parameters in their Partner-facing APIs.

Requirements

  • Accept the Klarna Network parameters in the Partner-facing APIs.
  • Use the field names klarna_network_session_token/klarna_network_data, ensuring that it’s easy for any Partner to identify and use.
  • Validation should be implemented, but it must not be more restrictive than what is specified in Klarna’s Payment Authorize APIKlarna Icon.
  • All printable UTF-8 characters must be supported
  • Forward the Klarna Network parameters unmodified to Klarna.

Supplementary purchase data

Supplementary Purchase Data refers to additional transaction details shared with Klarna that provide greater context about a purchase. These data points—such as line items, subscription details, or industry-specific attributes—help improve underwriting accuracy, fraud assessment, and the customer’s post-purchase experience. They may be required in certain industries and support multiple use cases, including better acceptance rates, enhanced fraud prevention, improved customer experiences within the Klarna app, and more effective risk monitoring.

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

Success rate of subscription charges

To ensure successful subscription token charges, include the relevant subscription data points again when processing the transaction to maximize the success rate.

Step 2: Call Klarna’s Payment Authorization API

The Payment Authorize APIKlarna Icon is used to start the payment process on Klarna Network whether they are with or without customer presence.

Charge an existing reusable customer_token without customer interaction (on-demand/recurring).

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 'Content-Type: application/json' \
  -H 'Klarna-Customer-Token: krn:customer_token:eu1:...' \
  -H 'Klarna-Network-Session-Token: eyJhbGciOiJIU...' \
  -d '{
        "currency": "USD",
        "supplementary_purchase_data": { .. },
        "klarna_network_data": "<serialized-json>",
        "request_payment_transaction": {
          "amount": 2599,
          "payment_option_id": "***",

Step 3: Handle the Payment Authorization result

When performing customer-present authorization through the Payment Authorize APIKlarna Icon, Klarna returns a response that reflects the result of the authorization. Since this flow includes a request_payment_transaction in the request, the response will always contain a corresponding payment_transaction_response object. The result field inside this object indicates the outcome of the authorization and determines the next step to perform.

The result has the following possible values:

ResultDescriptionNext steps

APPROVED

The authorization succeeded and a payment_transaction was created.Payment is authorized and ready for post-purchase operations.

DECLINED

The authorization failed (for example, due to fraud, credit, or risk policy) and no transaction was created.`Authorization ends with a failure.

STEP_UP_REQUIRED

This result is returned only if step_up_config was provided in the request and additional customer interaction is needed to complete authorization. A payment_request is created, representing the step-up process.Customer completes Klarna Purchase Journey before authorization can continue.-

Here's the high level diagram of the payment authorization results and resources it produces:

Payment authorization results

The response schema is as follows:

Result: STEP_UP_REQUIRED

Handle this result when Klarna requires additional customer interaction to complete authorization.

  • Read payment_request_id and payment_request_url from the response.
  • Return the payment_request_url to the Partner without modification.
  • The customer (who must be present) completes the Klarna Purchase Journey.
  • Wait for step-up completion before finalizing authorization.

Sample payload

JSON
{
  "payment_transaction_response": {
    "result": "STEP_UP_REQUIRED"
  },
  "payment_request": {
    "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
    "payment_request_reference": "acquiring-partner-request-reference-1234",
    "amount": 11800,
    "currency": "USD",
    "state": "SUBMITTED",
    "expires_at": "2025-01-02T13:00:00Z",
    "created_at": "2025-01-01T12:00:00Z",

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"
  }
}