Klarna Notifications API (v1/r6)

Download OpenAPI specification:Download

next

Webhooks

Create webhook

Creates a new webhook for the given account. Webhook will trigger for the declared events and send notifications to the provided URL.


SLO Category: The SLO Service Category. Operations that enable the management of an existing partner account, supporting retrieval, updates, and deletion.Account Operations
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 available in the Klarna Test environmentAvailable
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is available in the Klarna Production environmentAvailable

Securityklarna_api_key
Request
Request Body schema: application/json
required
url
required
string <url> (WebhookEndpoint)

Specifies the HTTPS URL to which the webhook notifications will be delivered. The value must be a valid, secure URL (HTTPS) where the partner's system can receive HTTP POST requests upon the occurrence of subscribed events.

validation-info: Validation that is a valid url.
event_types
required
Array of strings (WebhookEventTypes) unique

Specifies the types of events to which the webhook is subscribed. This field supports the wildcard (*) notation that allows for broader event subscriptions. For example, specifying payment.* subscribes the webhook to all events related to the Payment Product.

Items Enum: "payment.request.state-change.submitted" "payment.request.state-change.prepared" "payment.request.state-change.in-progress" "payment.request.state-change.pending-confirmation" "payment.request.state-change.canceled" "payment.request.state-change.authorized" "payment.request.state-change.expired" "payment.request.state-change.declined" "partner.account.state-change.operational" "partner.account.product.payment.state-change.disabled" "partner.account.product.payment.state-change.enabled"
validation-info: Validation that event types exists.
event_version
required
string <enum> (WebhookEventVersion)

Specifies the version of events to which the webhook is subscribed. All the subscribed event types will adhere to the schema of the specified event version.

Value: "v1"
validation-info: Strict validation that version exists
signing_key_id
required
string (SigningKeyId)

The signing_key_id field represents the identifier of the HMAC signing key that will be used for signing the webhook event notifications. This signing key, which must be created separately, accordingly enables the HMAC signing process for the webhook event notifications. Each event notification delivered to the webhook endpoint will carry a signature header, which is produced using the specified HMAC signing key. The inclusion of this signature provides a mechanism for partners to confirm the authenticity of incoming notifications, reinforcing the security of the communication process.

validation-info: There is validation that the id/resource exists
status
string <enum> (WebhookStatus)
Default: "ENABLED"

The status dictates the active/inactive state of the webhook subscription. If set to ENABLED, the webhook subscription is active and the associated endpoint is eligible to receive event notifications. Conversely, if set to DISABLED, the webhook subscription is inactive, preventing the endpoint from receiving any event notifications. When this field is not provided, it defaults to ENABLED.

Enum: "ENABLED" "DISABLED"
validation-info: Validation against the enum of possible values.
Responses
201

Webhook created successfully.

400

Bad Request, there was an error in the input of the request.

401

Unauthorized, the request was not authorized.

409

The webhook configuration already exists

post/v1/notification/webhooks
Request samples
application/json
{
  • "event_types": [
    ],
  • "event_version": "v1",
  • "signing_key_id": "krn:partner:global:notification:signing-key:49bcd37b-79a7-4e6e-b067-2903b45fef42",
  • "status": "ENABLED"
}
Response samples
application/json
{
  • "webhook_id": "krn:partner:global:notification:webhook:120e5b7e-dee8-43ca-9858-dca726e639b5",
  • "event_types": [
    ],
  • "event_version": "v1",
  • "signing_key_id": "krn:partner:global:notification:signing-key:49bcd37b-79a7-4e6e-b067-2903b45fef42",
  • "created_at": "2024-01-01T12:00:00Z",
  • "status": "ENABLED"
}

List webhooks

Retrieves all webhooks for the given account.


SLO Category: The SLO Service Category. Operations that enable the management of an existing partner account, supporting retrieval, updates, and deletion.Account Operations
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 available in the Klarna Test environmentAvailable
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is available in the Klarna Production environmentAvailable

Securityklarna_api_key
Responses
200

Webhooks returned successfully.

400

Bad Request, there was an error in the input of the request.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

get/v1/notification/webhooks
Request samples
Response samples
application/json
{
  • "webhooks": [
    ]
}

Get webhook

Retrieves details of a specific webhook for the given account.


SLO Category: The SLO Service Category. Operations that enable the management of an existing partner account, supporting retrieval, updates, and deletion.Account Operations
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 available in the Klarna Test environmentAvailable
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is available in the Klarna Production environmentAvailable

Securityklarna_api_key
Request
path Parameters
webhook_id
required
string (WebhookIdentifier)

The unique identifier of the webhook

Example: krn:partner:global:notification:webhook:120e5b7e-dee8-43ca-9858-dca726e639b5
validation-info: There is validation that the resource exists. There is validation about the KRN format (to-be-removed).
Responses
200

Webhook returned successfully.

400

Bad Request, there was an error in the input of the request.

401

Unauthorized, the request was not authorized.

get/v1/notification/webhooks/{webhook_id}
Request samples
Response samples
application/json
{
  • "webhook_id": "krn:partner:global:notification:webhook:120e5b7e-dee8-43ca-9858-dca726e639b5",
  • "event_types": [
    ],
  • "event_version": "v1",
  • "signing_key_id": "krn:partner:global:notification:signing-key:49bcd37b-79a7-4e6e-b067-2903b45fef42",
  • "created_at": "2024-01-01T12:00:00Z",
  • "status": "ENABLED"
}

Update webhook

Updates a specific webhook for the given account. Webhook will remain intact for the fields not mentioned in the request.


SLO Category: The SLO Service Category. Operations that enable the management of an existing partner account, supporting retrieval, updates, and deletion.Account Operations
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 available in the Klarna Test environmentAvailable
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is available in the Klarna Production environmentAvailable

Securityklarna_api_key
Request
path Parameters
webhook_id
required
string (WebhookIdentifier)

The unique identifier of the webhook

Example: krn:partner:global:notification:webhook:120e5b7e-dee8-43ca-9858-dca726e639b5
validation-info: There is validation that the resource exists. There is validation about the KRN format (to-be-removed).
Request Body schema: application/json
required
url
string <url>

Optional - The new endpoint URL to be called when the event happens if you want to update it

validation-info: Validation that is a valid url.
event_types
Array of strings (WebhookEventType) unique

Optional - A new set of event types for the webhook if you want to update it

Items Enum: "payment.request.state-change.submitted" "payment.request.state-change.prepared" "payment.request.state-change.in-progress" "payment.request.state-change.pending-confirmation" "payment.request.state-change.canceled" "payment.request.state-change.authorized" "payment.request.state-change.expired" "payment.request.state-change.declined" "partner.account.state-change.operational" "partner.account.product.payment.state-change.disabled" "partner.account.product.payment.state-change.enabled"
validation-info: Validation that event types exists.
event_version
string <enum>

Optional - A new event version configured for the webhook if you want to update it

Value: "v1"
validation-info: Strict validation that version exists
signing_key_id
string

Optional - A new signing key id for the webhook if you want to update it

validation-info: There is validation that the id/resource exists
status
string <enum>
Default: "ENABLED"

Optional - A new status (ENABLED/DISABLED) for the webhook if you want to update it

Enum: "ENABLED" "DISABLED"
validation-info: Validation against the enum of possible values.
Responses
200

Webhook updated successfully.

400

Bad Request, there was an error in the input of the request.

401

Unauthorized, the request was not authorized.

patch/v1/notification/webhooks/{webhook_id}
Request samples
application/json
{
  • "event_types": [
    ],
  • "signing_key_id": "krn:partner:global:notification:signing-key:49bcd37b-79a7-4e6e-b067-2903b45fef42",
  • "status": "ENABLED"
}
Response samples
application/json
{
  • "webhook_id": "krn:partner:global:notification:webhook:120e5b7e-dee8-43ca-9858-dca726e639b5",
  • "event_types": [
    ],
  • "event_version": "v1",
  • "signing_key_id": "krn:partner:global:notification:signing-key:49bcd37b-79a7-4e6e-b067-2903b45fef42",
  • "created_at": "2024-01-01T12:00:00Z",
  • "status": "ENABLED"
}

Delete webhook

Deletes a specific webhook for the given account.


SLO Category: The SLO Service Category. Operations that enable the management of an existing partner account, supporting retrieval, updates, and deletion.Account Operations
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 available in the Klarna Test environmentAvailable
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is available in the Klarna Production environmentAvailable

Securityklarna_api_key
Request
path Parameters
webhook_id
required
string (WebhookIdentifier)

The unique identifier of the webhook

Example: krn:partner:global:notification:webhook:120e5b7e-dee8-43ca-9858-dca726e639b5
validation-info: There is validation that the resource exists. There is validation about the KRN format (to-be-removed).
Responses
204

Webhook deleted successfully.

400

Bad Request, there was an error in the input of the request.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

delete/v1/notification/webhooks/{webhook_id}
Request samples
Response samples
application/json

The request contained a validation error.

{
  • "error_id": "4e2f6b5e-df81-40e6-83d5-f34f68d4e2f4",
  • "error_type": "INPUT_ERROR",
  • "error_code": "VALIDATION_ERROR",
  • "errors": []
}

Simulate a webhook

Simulates a webhook notification by using webhook id for given event type and event version.


SLO Category: The SLO Service Category. Operations that enable the management of an existing partner account, supporting retrieval, updates, and deletion.Account Operations
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 available in the Klarna Test environmentAvailable
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is available in the Klarna Production environmentAvailable

Securityklarna_api_key
Request
path Parameters
webhook_id
required
string (WebhookIdentifier)

The unique identifier of the webhook

Example: krn:partner:global:notification:webhook:120e5b7e-dee8-43ca-9858-dca726e639b5
validation-info: There is validation that the resource exists. There is validation about the KRN format (to-be-removed).
Request Body schema: application/json
required
event_type
required
string (WebhookEventType)

Defined webhook events

Enum: "payment.request.state-change.submitted" "payment.request.state-change.prepared" "payment.request.state-change.in-progress" "payment.request.state-change.pending-confirmation" "payment.request.state-change.canceled" "payment.request.state-change.authorized" "payment.request.state-change.expired" "payment.request.state-change.declined" "partner.account.state-change.operational" "partner.account.product.payment.state-change.disabled" "partner.account.product.payment.state-change.enabled"
validation-info: Validation that event type exists.
event_version
required
string <enum> (WebhookEventVersion)

Specifies the version of events to which the webhook is subscribed. All the subscribed event types will adhere to the schema of the specified event version.

Value: "v1"
validation-info: Strict validation that version exists
Responses
202

Webhook notification simulated successfully.

400

Bad Request, there was an error in the input of the request.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

post/v1/notification/webhooks/{webhook_id}/simulate
Request samples
application/json
{
  • "event_type": "payment.request.state-change.authorized",
  • "event_version": "v1"
}
Response samples
application/json
{
  • "metadata": {
    },
  • "payload": {
    }
}

Signing Keys

Create signing key

Creates a new signing key for the given account. Webhook notifications can be verified with the signing key generated.


SLO Category: The SLO Service Category. Operations that enable the management of an existing partner account, supporting retrieval, updates, and deletion.Account Operations
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 available in the Klarna Test environmentAvailable
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is available in the Klarna Production environmentAvailable

Securityklarna_api_key
Responses
201

Signing key created successfully.

400

Bad Request, there was an error in the input of the request.

401

Unauthorized, the request was not authorized.

403

Operation forbidden

post/v1/notification/signing-keys
Request samples
Response samples
application/json
{
  • "signing_key_id": "krn:partner:global:notification:signing-key:49bcd37b-79a7-4e6e-b067-2903b45fef42",
  • "signing_key": "b040893b9e02f6445b205ae2102e3e9e1d0aa9035e61cdebde39b5c230a7bc5a",
  • "created_at": "2024-01-01T12:00:00Z"
}

List signing keys

Retrieves all signing keys for the given account.


SLO Category: The SLO Service Category. Operations that enable the management of an existing partner account, supporting retrieval, updates, and deletion.Account Operations
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 available in the Klarna Test environmentAvailable
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is available in the Klarna Production environmentAvailable

Securityklarna_api_key
Responses
200

Signing keys returned successfully.

400

Bad Request, there was an error in the input of the request.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

get/v1/notification/signing-keys
Request samples
Response samples
application/json
{
  • "signing_keys": [
    ]
}

Get signing key

Retrieves details of a specific signing key for the given account.


SLO Category: The SLO Service Category. Operations that enable the management of an existing partner account, supporting retrieval, updates, and deletion.Account Operations
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 available in the Klarna Test environmentAvailable
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is available in the Klarna Production environmentAvailable

Securityklarna_api_key
Request
path Parameters
signing_key_id
required
string (SigningKeyId)

The unique identifier of the signing key

Example: krn:partner:global:notification:signing-key:49bcd37b-79a7-4e6e-b067-2903b45fef42
validation-info: There is validation that the id/resource exists
Responses
200

Signing key returned successfully.

400

Bad Request, there was an error in the input of the request.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

get/v1/notification/signing-keys/{signing_key_id}
Request samples
Response samples
application/json
{
  • "signing_key_id": "krn:partner:global:notification:signing-key:49bcd37b-79a7-4e6e-b067-2903b45fef42",
  • "in_use": false,
  • "created_at": "2024-01-01T12:00:00Z"
}

Delete signing key

Deletes a specific signing key for the given account.


SLO Category: The SLO Service Category. Operations that enable the management of an existing partner account, supporting retrieval, updates, and deletion.Account Operations
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 available in the Klarna Test environmentAvailable
Availability in Production environment: Indicates if the feature is available in the Klarna Production environment Feature is available in the Klarna Production environmentAvailable

Securityklarna_api_key
Request
path Parameters
signing_key_id
required
string (SigningKeyId)

The unique identifier of the signing key

Example: krn:partner:global:notification:signing-key:49bcd37b-79a7-4e6e-b067-2903b45fef42
validation-info: There is validation that the id/resource exists
Responses
204

Signing key deleted successfully.

400

Bad Request, there was an error in the input of the request.

401

Unauthorized, the request was not authorized.

404

Not Found, the requested resource was not found.

409

Conflict, there was a conflict in using the resource. Idempotency violation or concurrent updates to a resource occurred.

delete/v1/notification/signing-keys/{signing_key_id}
Request samples
Response samples
application/json

The request contained a validation error.

{
  • "error_id": "4e2f6b5e-df81-40e6-83d5-f34f68d4e2f4",
  • "error_type": "INPUT_ERROR",
  • "error_code": "VALIDATION_ERROR",
  • "errors": []
}