Klarna Partner Product API - Identity (v1/r7)

Download OpenAPI specification:Download

Identity API

Determine whether the customer already has a Klarna account.

Determine if a customer already has a Klarna account based on the customer's phone number/email address.


SLO Category: The SLO Service Category. Operations that provide read access to verify if a customer has an existing Klarna account or to retrieve details from an account linking token.Read-Only Identity
SLA Service Class: The SLA Service Class this operation is classified at when evaluating SLA compliance. Operations, webhooks and other services that does not directly impact the core purchasing process in real-time and enables supplemental or secondary featuresTransactions Non-critical Services
Ratelimit Category: The Ratelimit Category. other-operation

internal: true
Securityklarna_api_key
Request
path Parameters
account_id
required
string (AccountIdentifier)

The unique identifier of the account for which the action is performed.

Example: krn:partner:global:account:live:LWT2XJSE
validation-info: Validation that is a valid krn
header Parameters
X-Klarna-Client-Id
required
string (IdentityRequestClientId) [ 1 .. 255 ] characters

Used to identify that the request is linked to a specific client with a specific configuration.

Request Body schema: application/json
required
Any of:
email
required
string <email> (The email address of the customer)

E-mail address. Regex ^(?=.{1,64}@.{1,255}$)(?:[a-zA-Z0-9!#$%&'+/=?^_{|}~\p{IsLatin}\p{N}\p{S}-&&[^<>]]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_{|}~\p{IsLatin}\p{N}\p{S}-&&[^<>]]+)|"(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|\[\x01-\x09\x0B\x0C\x0E-\x7F])")@(?:(?:[a-zA-Z0-9\p{IsLatin}\p{N}\p{S}&&[^<>^]}](?:[a-zA-Z0-9\p{IsLatin}\p{N}\p{S}-&&[^<>^]][a-zA-Z0-9\p{IsLatin}\p{N}\p{S}&&[^<>^]])?.)+[a-zA-Z\p{L}]{2,}|[(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d).){3}(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)|[a-zA-Z0-9\p{IsLatin}\p{N}\p{S}-&&[^<>^]]*[a-zA-Z0-9\p{L}\p{N}\p{S}-&&[^<>^]]:(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21-\x5A\x53-\x7F]|\[\x01-\x09\x0B\x0C\x0E-\x7F])+)])$

validation-info: Validation that the format is correct
phone
string (The phone number of the customer) ^\+\d{1,3}\d{1,12}$

Phone number in E.164 format

validation-info: Validation that the phone is in E.164 format
Responses
200

Successful response

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

403

Forbidden, insufficient privileges to perform the requested operation on the resource.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

503

Service Temporarily Unavailable, the system is temporarily unavailable to process the request.

post/v1/accounts/{account_id}/identity/customer-exists
Request samples
application/json

Check if a customer exists using a phone number

{
  • "phone": "+18445527621"
}
Response samples
application/json
{
  • "exists": true
}

Introspect a customer token issued in the account linking flow.

Introspect a customer token issued in the account linking flow to obtain more information regarding the token.


SLO Category: The SLO Service Category. Operations that provide read access to verify if a customer has an existing Klarna account or to retrieve details from an account linking token.Read-Only Identity
SLA Service Class: The SLA Service Class this operation is classified at when evaluating SLA compliance. Operations, webhooks and other services that does not directly impact the core purchasing process in real-time and enables supplemental or secondary featuresTransactions Non-critical Services
Ratelimit Category: The Ratelimit Category. other-operation

Securityklarna_api_key
Request
path Parameters
account_id
required
string (AccountIdentifier)

The unique identifier of the account for which the action is performed.

Example: krn:partner:global:account:live:LWT2XJSE
validation-info: Validation that is a valid krn
header Parameters
X-Klarna-Customer-Token
required
string (CustomerToken) <= 1024 characters

Returned if Account Linking or payment tokenization was requested.

The customer_token represents the tokenized customer and allows you to act on behalf of the customer. You must persist this token in your system associated with the customer account. To de-duplicate customers, you should use the customer_id as the unique identifier.

Example: krn:partner:us1:live:identity:customer-token:vVQGmYzlfsQ16dko3jcwY5lV8hBgKs9a
validation-info: Validation on the length (max length 1024) and the format of the string.
Responses
200

Successful response

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

403

Unauthorized access to the resource customer token.

404

Resource customer token does not exist.

409

Resource customer token has been revoked.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

503

Service Temporarily Unavailable, the system is temporarily unavailable to process the request.

post/v1/accounts/{account_id}/identity/customer-token/introspect
Request samples
Response samples
application/json
{
  • "status": "ACTIVE",
  • "scopes": [
    ],
  • "issued_at": 1723791546323,
  • "customer_token_reference": "partner_customer_token_1234"
}

Revoke a customer token issued in the account linking flow.

Revoke a customer token issued in the account linking flow, so that any subsequent payment requests using the token are rejected.


SLO Category: The SLO Service Category. Operations that allow the revocation or updates of a customer token issued during the account linking process.Identity
SLA Service Class: The SLA Service Class this operation is classified at when evaluating SLA compliance. Operations, webhooks and other services that does not directly impact the core purchasing process in real-time and enables supplemental or secondary featuresTransactions Non-critical Services
Ratelimit Category: The Ratelimit Category. other-operation

Securityklarna_api_key
Request
path Parameters
account_id
required
string (AccountIdentifier)

The unique identifier of the account for which the action is performed.

Example: krn:partner:global:account:live:LWT2XJSE
validation-info: Validation that is a valid krn
header Parameters
required
CustomerToken (string) or PurchaseTokenId (string)
Responses
200

Successful response

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

403

Unauthorized access to the resource customer token.

404

Resource customer token does not exist.

409

Resource customer token has been revoked.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

503

Service Temporarily Unavailable, the system is temporarily unavailable to process the request.

post/v1/accounts/{account_id}/identity/customer-token/revoke
Request samples
Response samples
application/json
{
  • "customer_token_reference": "partner_customer_token_1234"
}

Generate SDK token

Returns an sdk_token that can be used to initialize Web SDK or Mobile SDK in order to personalize customer experience.


SLO Category: The SLO Service Category. Operations that provide read access to verify if a customer has an existing Klarna account or to retrieve details from an account linking token.Read-Only Identity
SLA Service Class: The SLA Service Class this operation is classified at when evaluating SLA compliance. Operations, webhooks and other services that are outside the scope of both Transaction Critical and Transaction Non-critical OperationsAdditional Services
Lifecycle Stage: The Lifecycle Stage tag in operations and attributes defines completeness of the feature for usage Feature under development, may not be fully available and is subject to change as we continue building the service in partnership with early usersEarly Release
Availability in Test environment: Indicates if the feature is available in the Klarna Test environment Feature is not available in the Klarna Test environmentNot available
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is not available in the Klarna Production environmentNot available
Ratelimit Category: The Ratelimit Category. Includes crucial actions for capturing payment transactions.Payment Transaction Capture

Securityklarna_api_key
Request
path Parameters
account_id
required
string (AccountIdentifier)

Identifier of the Account the action is done on behalf of

Example: krn:partner:global:account:live:LWT2XJSE
validation-info: Validation that is a valid krn
header Parameters
required
CustomerToken (string) or PurchaseTokenId (string)
Responses
200

SDK token

400

Bad Request, there was an error in the input of the request. The request can not be retried without modifications.

401

Unauthorized, the request was not authorized.

429

Too Many Requests, the request was rate limited.

500

Internal Server Error, there was an unexpected error in the API.

503

Service Temporarily Unavailable, the system is temporarily unavailable to process the request.

post/v1/accounts/{account_id}/identity/sdk-tokens
Request samples
Response samples
application/json
{
  • "sdk_token": "hbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9zaG9wcGluZ19zZXNzaW9uX2lkIjoia3JuOnNob3BwaW5nOmV1MTpzZ"
}