Klarna Partner Product API - Identity (v1/r5)

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.

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
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> (Email)

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])+)])$

phone
string (Phone) ^\+\d{1,3}\d{1,12}$

Phone number 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.

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
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
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.

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
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.

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