Klarna Partner Product API - Identity (release/4)

Download OpenAPI specification:Download

Authentication

klarna_api_key

Use the Klarna API key as HTTP Basic Authentication credentials

Security Scheme Type API Key
Header parameter name: Authorization

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.

Request
Security:
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
Request Body schema: application/json
Any of:
email
required
string <email> (Email) (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#...

E-mail address

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.

Request
Security:
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
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:v1:vVQGmYzlfsQ16dko3jcwY5lV8hBgKs9a.96e12495afdc88be3c407087076deabcf50f626242f97c0169779fac4a9acc8f
Request Body schema: application/json
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.

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.

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
application/json
{
  • "customer_token": "krn:partner:us1:live:identity:customer-token:v1:vVQGmYzlfsQ16dko3jcwY5lV8hBgKs9a.96e12495afdc88be3c407087076deabcf50f626242f97c0169779fac4a9acc8f"
}
Response samples
application/json
{
  • "status": "ACTIVE",
  • "scopes": [
    ],
  • "issued_at": 1723791546323,
  • "customer_token_id": "krn:partner:us1:live:identity:customer-token-id:vVQGmYzlfsQ16dko3jcwY5lV8hBgKs9a",
  • "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.

Request
Security:
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
CustomerToken (string) or PurchaseTokenId (string)
Request Body schema: application/json
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.

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-token/revoke
Request samples
application/json
{
  • "customer_token": "krn:partner:us1:live:identity:customer-token:v1:vVQGmYzlfsQ16dko3jcwY5lV8hBgKs9a.96e12495afdc88be3c407087076deabcf50f626242f97c0169779fac4a9acc8f"
}
Response samples
application/json
{
  • "customer_token_id": "krn:partner:us1:live:identity:customer-token-id:vVQGmYzlfsQ16dko3jcwY5lV8hBgKs9a",
  • "customer_token_reference": "partner_customer_token_1234"
}