Klarna Partner Product API - Payment (v2/r5)

Download OpenAPI specification:Download

Full set of resources to manage the end-to-end lifecycle of a payment.

Payment Request API

The Payment Request API allows you to create and manage payment requests for one-off purchases.

Create a server-to-server payment request

Create a server-to-server payment request.

The payment request will have the state SUBMITTED.

Securityklarna_api_key and klarna_partner_account
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
header Parameters
X-Klarna-Client-Id
string (PaymentRequestClientId) [ 1 .. 255 ] characters

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

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
Request Body schema: application/json
required
Any of:

Payment request for a one-off purchase

currency
required
string (Currency) ^[A-Za-z]{3}$

Currency in ISO 4217 format.

Supported currencies:

  • AUD
  • EUR
  • CAD
  • CZK
  • DKK
  • HUF
  • MXN
  • NZD
  • NOK
  • PLN
  • RON
  • SEK
  • CHF
  • GBP
  • USD
payment_amount
required
integer <int64> (PaymentAmount) [ 1 .. 2147483647 ]

Total amount of a one-off purchase, including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500. This is the amount that Klarna will charge the customer for a one-off purchase. Should not include any amounts for subscriptions.

Invariant: payment_amount = sum(line_items[].total_line_amount)

payment_request_reference
string (PaymentRequestReference) [ 1 .. 255 ] characters

Reference to the payment session or equivalent resource created on your side. This will be exposed in payment request webhooks (payment.request.*) for the purpose of correlating your resource with the Klarna Payment Request.

object (SupplementaryPurchaseData)

Additional information that provide more detailed information about the transaction, which helps reduce the risk of fraud and enhances transparency

required
object

Configuration of the payment request

object

Interoperability configurations for the payment request

Responses
201

Payment request created

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.

404

Not Found, the requested resource was not found.

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.

Callbacks
postWebhook callback
post/v2/accounts/{account_id}/payment/requests
Request samples
application/json

Minimum payment request for a 10 USD purchase

{}
Response samples
application/json
{}
Callback payload samples
POST: Webhook callback
application/json

The payment request has been submitted to Klarna.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Read the state of a Payment Request

Allows you to read the state of a payment request.

Securityklarna_api_key and klarna_partner_account
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
payment_request_id
required
string (PaymentRequestId) <= 255 characters

The Payment Request ID to read

Example: krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4
Responses
200

Payment request object

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.

404

Not Found, the requested resource was not found.

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.

get/v2/accounts/{account_id}/payment/requests/{payment_request_id}
Request samples
Response samples
application/json
{}

Update a Payment Request

Allows you to update a payment request that is in the state SUBMITTED.

Securityklarna_api_key and klarna_partner_account
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
payment_request_id
required
string (PaymentRequestId) <= 255 characters

The Payment Request ID to update

Example: krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4
header Parameters
X-Klarna-Client-Id
string (PaymentRequestClientId) [ 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
currency
string (Currency) ^[A-Za-z]{3}$

Currency in ISO 4217 format.

Supported currencies:

  • AUD
  • EUR
  • CAD
  • CZK
  • DKK
  • HUF
  • MXN
  • NZD
  • NOK
  • PLN
  • RON
  • SEK
  • CHF
  • GBP
  • USD
payment_amount
integer <int64> (PaymentAmount) [ 1 .. 2147483647 ]

Total amount of a one-off purchase, including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500. This is the amount that Klarna will charge the customer for a one-off purchase. Should not include any amounts for subscriptions.

Invariant: payment_amount = sum(line_items[].total_line_amount)

payment_request_reference
string (PaymentRequestReference) [ 1 .. 255 ] characters

Reference to the payment session or equivalent resource created on your side. This will be exposed in payment request webhooks (payment.request.*) for the purpose of correlating your resource with the Klarna Payment Request.

object (SupplementaryPurchaseData)

Additional information that provide more detailed information about the transaction, which helps reduce the risk of fraud and enhances transparency

object (PaymentRequestConfiguration)

Configuration of the payment request

object (PaymentRequestInteroperability)

Interoperability configurations for the payment request

Responses
200

Payment Request updated

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.

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.

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.

patch/v2/accounts/{account_id}/payment/requests/{payment_request_id}
Request samples
application/json
{
  • "currency": "USD",
  • "payment_amount": 2000,
  • "payment_request_reference": "partner-payment-reference-12345",
  • "supplementary_purchase_data": {
    },
  • "config": {},
  • "interoperability": {
    }
}
Response samples
application/json
{}

Cancel payment request

Allows you to cancel a payment request.

Securityklarna_api_key and klarna_partner_account
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
payment_request_id
required
string (PaymentRequestId) <= 255 characters

The Payment Request ID to read

Example: krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4
Responses
200

Payment request object

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.

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.

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.

delete/v2/accounts/{account_id}/payment/requests/{payment_request_id}
Request samples
Response samples
application/json

Shows a canceled payment request.

{
  • "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
  • "state": "CANCELED",
  • "state_reason": "PARTNER_CANCELED",
  • "state_context": { },
  • "state_expires_at": "2024-01-01T15:00:00Z",
  • "expires_at": "2024-01-02T13:00:00Z",
  • "created_at": "2024-01-01T12:00:00Z",
  • "updated_at": "2024-01-01T13:00:00Z",
  • "currency": "USD",
  • "payment_amount": 1000,
}

Confirm a Payment Request using a confirmation token

To confirm a payment request you must provide the payment confirmation token returned after a successful payment flow.

This endpoint is idempotent and can be called multiple times with the same confirmation token, the same response will be returned.

Securityklarna_api_key and klarna_partner_account
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
payment_confirmation_token
required
string (PaymentConfirmationToken) <= 255 characters

The payment confirmation token of the Payment Request to confirm

Example: krn:payment:eu1:confirmation-token:e15432a5-ebcc-45bc-944c-e61399db597b
Request Body schema: application/json
required
Any of:

Confirmation of a one-off purchase, with optional token sign up

currency
required
string^[A-Za-z]{3}$

Currency of the payment amount in 3-letter ISO 4217 currency code.

Must be identical to the value in the payment request creation.

payment_amount
required
integer <int64> [ 1 .. 2147483647 ]

Total payment amount that you want to charge the customer.

Must be identical to the value in the payment request creation.

payment_transaction_reference
string (PaymentTransactionReference) [ 1 .. 255 ] characters

Reference to the payment or equivalent resource created on your side. This will be exposed in the Payment Transaction webhooks for the purpose of correlating your resource with the Klarna Payment Transaction.

object

Additional information that provide more detailed information about the transaction, which helps reduce the risk of fraud and enhances transparency

object (PaymentRequestConfirmConfiguration)

Configuration properties for the payment request confirmation

Responses
200

Payment request confirmed

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.

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.

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.

Callbacks
postWebhook callback
post/v2/accounts/{account_id}/payment/confirmation-tokens/{payment_confirmation_token}/confirm
Request samples
application/json
{
  • "currency": "USD",
  • "payment_amount": 2000,
  • "payment_transaction_reference": "partner-transaction-reference-4567",
  • "supplementary_purchase_data": {
    },
  • "config": {
    }
}
Response samples
application/json

Shows an confirmed payment request

{
  • "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
  • "state": "CONFIRMED",
  • "state_expires_at": "2024-01-01T15:00:00Z",
  • "state_context": {
    },
  • "expires_at": "2024-01-02T13:00:00Z",
  • "created_at": "2024-01-01T12:00:00Z",
  • "updated_at": "2024-01-01T13:00:00Z",
  • "currency": "USD",
  • "payment_amount": 1000,
  • "config": {}
}
Callback payload samples
POST: Webhook callback
application/json

The payment request has been confirmed and the payment is confirmed.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Payment Token API

Charge a tokenized customer for a subscription or on-demand usage.

Charge a tokenized customer for a subscription or on-demand usage.

Securityklarna_api_key and klarna_partner_account
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
header Parameters
X-Klarna-Client-Id
string (PaymentRequestClientId) [ 1 .. 255 ] characters

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

X-Klarna-Customer-Token
required
string (CustomerToken) <= 1024 characters

The customer token of the account linked customer you wish to charge.

Example: krn:partner:us1:live:identity:customer-token:vVQGmYzlfsQ16dko3jcwY5lV8hBgKs9a
Request Body schema: application/json
required
currency
required
string (Currency) ^[A-Za-z]{3}$

Currency in ISO 4217 format.

Supported currencies:

  • AUD
  • EUR
  • CAD
  • CZK
  • DKK
  • HUF
  • MXN
  • NZD
  • NOK
  • PLN
  • RON
  • SEK
  • CHF
  • GBP
  • USD
payment_amount
required
integer <int64> (PaymentAmount) [ 1 .. 2147483647 ]

Total amount of a one-off purchase, including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500. This is the amount that Klarna will charge the customer for a one-off purchase. Should not include any amounts for subscriptions.

Invariant: payment_amount = sum(line_items[].total_line_amount)

payment_request_reference
string (PaymentRequestReference) [ 1 .. 255 ] characters

Reference to the payment session or equivalent resource created on your side. This will be exposed in payment request webhooks (payment.request.*) for the purpose of correlating your resource with the Klarna Payment Request.

payment_transaction_reference
string (PaymentTransactionReference) [ 1 .. 255 ] characters

Reference to the payment or equivalent resource created on your side. This will be exposed in the Payment Transaction webhooks for the purpose of correlating your resource with the Klarna Payment Transaction.

object (SupplementaryPurchaseData)

Additional information that provide more detailed information about the transaction, which helps reduce the risk of fraud and enhances transparency

required
object (PaymentRequestChargeConfiguration)

Configuration properties for the token charge request

Responses
201

The token charge can result in one of the following outcomes:

  • Successful Authorization (state: CONFIRMED): The charge was approved, and the response body includes the Payment Transaction ID.

  • Declined (state: DECLINED): The charge was declined. The response body includes a state_reason for the decline.

  • Step-Up Flow Activation (state: SUBMITTED): The charge was declined, and a step-up authentication flow has been activated. The response body includes the state_context, which provides the distribution URL where the customer must be redirected for payment authorization.

When handling the response, examine the state field to determine the appropriate next steps.

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.

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.

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.

Callbacks
postWebhook callback
post/v2/accounts/{account_id}/payment/token/charge
Request samples
application/json

Charge a customer for a previously created subscription for a customer that is not present. The customer_token is passed in the header X-Klarna-Customer-Token.

{
  • "currency": "USD",
  • "payment_amount": 999,
  • "supplementary_purchase_data": {
    },
  • "payment_request_reference": "partner-payment-reference-1234",
  • "config": {
    }
}
Response samples
application/json

Shows a successful token charge response

{
  • "payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
  • "state": "CONFIRMED",
  • "state_expires_at": "2024-01-01T15:00:00Z",
  • "state_context": {
    },
  • "expires_at": "2024-01-02T13:00:00Z",
  • "created_at": "2024-01-01T12:00:00Z",
  • "updated_at": "2024-01-01T13:00:00Z",
  • "currency": "USD",
  • "payment_amount": 1000,
}
Callback payload samples
POST: Webhook callback
application/json

The payment request has been submitted to Klarna.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Payment Transaction API

Read Payment Transaction

Request to retrieve the details of a payment transaction. A payment transaction encapsulates crucial details such as the authorized amount, currency, line items and shipping information.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
account_id
required
string (account.model_AccountIdentifier)

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

Example: krn:partner:global:account:live:LWT2XJSE
payment_transaction_id
required
string (PaymentTransactionId) <= 255 characters

The unique identifier of the payment transaction.

Example: krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0
Responses
200

Payment Transaction has been successfully retrieved.

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.

404

Not Found, the requested resource was not found.

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.

Callbacks
postWebhook: Payment funding state-change
get/v2/accounts/{account_id}/payment/transactions/{payment_transaction_id}
Request samples
Response samples
application/json

Shows a payment transaction that has been created but not yet acted upon.

{
  • "payment_transaction_id": "krn:payment:us1:transaction:4b8b6350-6b72-42c5-b946-f088adcdc216",
  • "currency": "USD",
  • "payment_amount": 2100,
  • "payment_transaction_reference": "payment-transaction-reference-1234",
  • "payment_funding": {
    },
  • "supplementary_purchase_data": {
    },
  • "payment_captures": [ ],
  • "payment_refunds": [ ],
  • "payment_chargebacks": [ ],
  • "state": "AUTHORIZED",
  • "state_reason": "AUTHORIZED",
  • "created_at": "2024-01-01T13:00:00Z",
  • "expires_at": "2024-01-29T13:00:00Z",
  • "original_authorization_amount": 2100,
  • "remaining_authorization_amount": 2100,
  • "customer_profile": {
    },
  • "payment_pricing": {
    }
}
Callback payload samples
POST: Webhook: Payment funding state-change
application/json

Shows a payment funding pending webhook.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Update Payment Transaction

Request to update details of a payment transaction.

The update operation should be performed when there is a need to change either the payment_transaction_reference or the purchase_reference. These fields are essential for aligning your internal records with Klarna's transaction records and ensuring accurate tracking and reconciliation.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
account_id
required
string (account.model_AccountIdentifier)

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

Example: krn:partner:global:account:live:LWT2XJSE
payment_transaction_id
required
string (PaymentTransactionId) <= 255 characters

The unique identifier of the payment transaction.

Example: krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0
Request Body schema: application/json
object

Supplementary information for the purchase that helps reduce the risk of fraud, enhances transparency, and improves the customer's post-purchase experience.

payment_transaction_reference
string (PaymentTransactionReference) [ 1 .. 255 ] characters

Reference to the payment or equivalent resource created on your side. This will be exposed in the Payment Transaction webhooks for the purpose of correlating your resource with the Klarna Payment Transaction.

Responses
200

Payment Transaction has been successfully updated.

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.

404

Not Found, the requested resource was not found.

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.

patch/v2/accounts/{account_id}/payment/transactions/{payment_transaction_id}
Request samples
application/json

Update purchase reference and payment transaction reference

{
  • "supplementary_purchase_data": {
    },
  • "payment_transaction_reference": "new-payment-transaction-reference-1234"
}
Response samples
application/json

Shows a payment transaction that has been updated prior to completion.

{
  • "payment_transaction_id": "krn:payment:us1:transaction:4b8b6350-6b72-42c5-b946-f088adcdc216",
  • "payment_transaction_reference": "new-payment-transaction-reference-1234",
  • "payment_amount": 2100,
  • "currency": "USD",
  • "supplementary_purchase_data": {
    },
  • "payment_captures": [ ],
  • "payment_refunds": [ ],
  • "payment_chargebacks": [ ],
  • "state": "AUTHORIZED",
  • "state_reason": "AUTHORIZED",
  • "created_at": "2024-01-01T13:00:00Z",
  • "updated_at": "2024-01-02T13:00:00Z",
  • "expires_at": "2024-01-29T13:00:00Z",
  • "original_authorization_amount": 2100,
  • "remaining_authorization_amount": 2100,
  • "customer_profile": {
    },
  • "payment_funding": {
    },
  • "payment_pricing": {
    }
}

Reauthorize Payment Transaction

Request to reauthorize a payment transaction.

The reauthorize operation is necessary when the payment_amount, line_items, or shipping details are changed. This ensures that the payment transaction is reauthorized with the up-to-date details and can be completed without any issues. Note that the reauthorization operation is subject to a second risk assessment and may be rejected.

Additionally, reauthorization should be performed when the existing authorization is close to expiry, and the payment will not be completed within the current authorization period. This will provide sufficient time to complete the payment transaction without any issues. Be aware that a payment transaction is deemed to be CLOSED 7 days following the expiry and cannot be reauthorized thereafter.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
account_id
required
string (account.model_AccountIdentifier)

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

Example: krn:partner:global:account:live:LWT2XJSE
payment_transaction_id
required
string (PaymentTransactionId) <= 255 characters

The unique identifier of the payment transaction.

Example: krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0
Request Body schema: application/json
payment_amount
integer <int64> (PaymentAmount) [ 1 .. 2147483647 ]

Total amount of a one-off purchase, including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500. This is the amount that Klarna will charge the customer for a one-off purchase. Should not include any amounts for subscriptions.

Invariant: payment_amount = sum(line_items[].total_line_amount)

object

Supplementary information for the purchase that helps reduce the risk of fraud, enhances transparency, and improves the customer's post-purchase experience.

extension_days
integer <int64> [ 1 .. 180 ]

The number of days by which the payment authorization period will be extended. If the transaction is expired, the extension_days are added to the current date. Otherwise, the extension_days are added to the current expires_at date.

The new expiration date is calculated using the formula max(current_date, expires_at) + extension_days.

A payment transaction cannot have an authorization period longer than 360 days, and any attempt to extend beyond that period will be rejected.

Constraint: max(current_date, expires_at) + expiration_days <= created_at + '360 days'

Responses
200

The reauthorization of the payment transaction has been processed.

Note that this does not indicate successful reauthorization; it may have been rejected. You should check the result field for the final outcome.

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.

404

Not Found, the requested resource was not found.

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.

Callbacks
postWebhook: Payment transaction state-change
post/v2/accounts/{account_id}/payment/transactions/{payment_transaction_id}/authorize
Request samples
application/json

Reauthorize payment transaction with new payment amount and line items

{}
Response samples
application/json

Shows a payment transaction that has been reauthorized and waiting for further actions.

{
  • "result": "AUTHORIZED",
  • "payment_transaction": {
    }
}
Callback payload samples
POST: Webhook: Payment transaction state-change
application/json

Shows a payment transaction authorized webhook.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Capture Payment Transaction

Request to capture a payment transaction. The capture should be performed in conjunction with the shipment of the purchased goods. Upon successful completion, the process of settling the funds with the merchant will commence.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
account_id
required
string (account.model_AccountIdentifier)

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

Example: krn:partner:global:account:live:LWT2XJSE
payment_transaction_id
required
string (PaymentTransactionId) <= 255 characters

The unique identifier of the payment transaction.

Example: krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0
Request Body schema: application/json
capture_amount
integer (PaymentCaptureAmount) [ 0 .. 2147483647 ]

The amount of the capture including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500. If not specified, a capture for the remaining_authorization_amount will be performed.

Invariant: capture_amount = sum(line_items[].total_amount)

payment_capture_reference
string (PaymentCaptureReference) [ 1 .. 255 ] characters

Reference to the capture or equivalent resource created on your side. This will be exposed in the Payment Transaction webhooks and included in the settlement file.

object (SupplementaryCaptureData)

Supplementary information for the capture that enhances transparency and improves the customer's post-purchase experience.

Responses
201

Payment Transaction has been successfully captured.

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.

404

Not Found, the requested resource was not found.

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.

Callbacks
postWebhook: Payment transaction state-change
postWebhook: Payment transaction captured
post/v2/accounts/{account_id}/payment/transactions/{payment_transaction_id}/capture
Request samples
application/json

Shows a capture request with capture amount and line items

{}
Response samples
application/json

Shows a successful payment capture response

{}
Callback payload samples
application/json

Shows a payment transaction authorized webhook.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Refund Payment Transaction

Request to refund a payment transaction.

The refund should be performed when customers return the purchased items. Upon successful completion, the process of returning the funds to the customer will commence, and the merchant's settlement balance will be adjusted accordingly.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
account_id
required
string (account.model_AccountIdentifier)

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

Example: krn:partner:global:account:live:LWT2XJSE
payment_transaction_id
required
string (PaymentTransactionId) <= 255 characters

The unique identifier of the payment transaction.

Example: krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0
Request Body schema: application/json
refund_amount
required
integer [ 0 .. 2147483647 ]

The amount of the refund including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500.

Invariant: refund_amount = sum(line_items[].total_amount)

Constraint: refund_amount <= sum(captures[].capture_amount) - sum(refunds[].refund_amount)

payment_refund_reference
string (PaymentRefundReference) [ 1 .. 255 ] characters

Reference to the refund or equivalent resource created on your side. This will be exposed in the Payment Transaction webhooks and included in the settlement file.

object (SupplementaryRefundData)

Supplementary information for the refund that enhances transparency and improves the customer's post-purchase experience.

Responses
201

Payment Transaction has been successfully refunded.

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.

404

Not Found, the requested resource was not found.

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.

Callbacks
postWebhook: Payment transaction refunded
post/v2/accounts/{account_id}/payment/transactions/{payment_transaction_id}/refund
Request samples
application/json

Shows a refund request with refund amount and line items

{}
Response samples
application/json

Shows a successful response to a refund operation on a payment transaction.

{}
Callback payload samples
POST: Webhook: Payment transaction refunded
application/json

Shows a payment transaction refunded webhook.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Void Payment Transaction

Request to void a payment transaction.

The void operation should be performed when the payment is no longer intended to be fulfilled. Upon successful completion, any remaining authorization will subsequently be released.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
account_id
required
string (account.model_AccountIdentifier)

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

Example: krn:partner:global:account:live:LWT2XJSE
payment_transaction_id
required
string (PaymentTransactionId) <= 255 characters

The unique identifier of the payment transaction.

Example: krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0
Responses
200

Payment Transaction has been successfully voided.

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.

404

Not Found, the requested resource was not found.

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.

Callbacks
postWebhook: Payment transaction state-change
post/v2/accounts/{account_id}/payment/transactions/{payment_transaction_id}/void
Request samples
Response samples
application/json

Shows a payment transaction that has been partially captured and completed upon a void operation. Any remaining authorization has been released.

{
  • "payment_transaction_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162",
  • "payment_transaction_reference": "payment-transaction-reference-1234",
  • "payment_amount": 15000,
  • "currency": "EUR",
  • "payment_funding": {
    },
  • "supplementary_purchase_data": {},
  • "payment_captures": [],
  • "payment_refunds": [ ],
  • "payment_chargebacks": [ ],
  • "state": "COMPLETED",
  • "state_reason": "VOIDED",
  • "previous_state": "AUTHORIZED",
  • "created_at": "2024-01-01T13:00:00Z",
  • "updated_at": "2024-01-02T13:00:00Z",
  • "expires_at": "2024-01-29T13:00:00Z",
  • "original_authorization_amount": 15000,
  • "remaining_authorization_amount": 0,
  • "customer_profile": {
    },
  • "payment_pricing": {
    }
}
Callback payload samples
POST: Webhook: Payment transaction state-change
application/json

Shows a payment transaction authorized webhook.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Read Payment Capture

Request to retrieve the details of a payment capture. A payment capture encapsulates crucial details such as the capture amount, line items and shipment details.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
account_id
required
string (account.model_AccountIdentifier)

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

Example: krn:partner:global:account:live:LWT2XJSE
payment_capture_id
required
string (PaymentCaptureId) <= 255 characters

The unique identifier of the payment capture.

Example: krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0:capture:1
Responses
200

Payment Capture has been successfully retrieved.

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.

404

Not Found, the requested resource was not found.

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.

get/v2/accounts/{account_id}/payment/captures/{payment_capture_id}
Request samples
Response samples
application/json

Shows a successful payment capture response

{}

Refund Payment Capture

Request to refund a payment capture.

The refund should be performed when customers return the purchased items. Upon successful completion, the process of returning the funds to the customer will commence, and the merchant's settlement balance will be adjusted accordingly.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
account_id
required
string (account.model_AccountIdentifier)

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

Example: krn:partner:global:account:live:LWT2XJSE
payment_capture_id
required
string (PaymentCaptureId) <= 255 characters

The unique identifier of the payment capture.

Example: krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0:capture:1
Request Body schema: application/json
refund_amount
required
integer [ 0 .. 2147483647 ]

The amount of the refund including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Dollars should be 2500.

Invariant: refund_amount = sum(line_items[].total_amount)

Constraint: refund_amount <= sum(captures[payment_capture_id].capture_amount) - sum(refunds[payment_capture_id].refund_amount)

payment_refund_reference
string (PaymentRefundReference) [ 1 .. 255 ] characters

Reference to the refund or equivalent resource created on your side. This will be exposed in the Payment Transaction webhooks and included in the settlement file.

object (SupplementaryRefundData)

Supplementary information for the refund that enhances transparency and improves the customer's post-purchase experience.

Responses
201

Payment Capture has been successfully refunded.

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.

404

Not Found, the requested resource was not found.

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.

Callbacks
postWebhook: Payment transaction refunded
post/v2/accounts/{account_id}/payment/captures/{payment_capture_id}/refund
Request samples
application/json

Shows a refund request with refund amount and line items

{}
Response samples
application/json

Shows a successful response to a refund operation on a payment capture.

{
  • "payment_refund_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162:refund:1",
  • "payment_capture_id": "krn:payment:eu1:transaction:bc42b6ff-b222-463c-b4b2-d8d6a82e0162:capture:1",
  • "payment_refund_reference": "refund-reference-123",
  • "refund_amount": 5000,
  • "refunded_at": "2024-01-02T13:00:00Z",
  • "supplementary_refund_data": {}
}
Callback payload samples
POST: Webhook: Payment transaction refunded
application/json

Shows a payment transaction refunded webhook.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Read Payment Refund

Request to retrieve the details of a payment refund. A payment refund encapsulates crucial details such as the refund amount and line items.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
account_id
required
string (account.model_AccountIdentifier)

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

Example: krn:partner:global:account:live:LWT2XJSE
payment_refund_id
required
string (PaymentRefundId) <= 255 characters

The unique identifier of the payment refund.

Example: krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0:refund:1
Responses
200

Payment refund has been successfully retrieved.

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.

404

Not Found, the requested resource was not found.

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.

get/v2/accounts/{account_id}/payment/refunds/{payment_refund_id}
Request samples
Response samples
application/json

Shows a successful response to a refund operation on a payment transaction.

{}

Read Payment Chargeback

Request to retrieve the details of a payment chargeback. A payment chargeback encapsulates crucial details such as the chargeback amount and chargeback reason.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
account_id
required
string (account.model_AccountIdentifier)

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

Example: krn:partner:global:account:live:LWT2XJSE
payment_chargeback_id
required
string (PaymentChargebackId) <= 255 characters

The unique identifier of the payment chargeback.

Example: krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0:chargeback:1
Responses
200

Payment chargeback has been successfully retrieved.

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.

404

Not Found, the requested resource was not found.

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.

Callbacks
postWebhook: Payment transaction chargeback
get/v2/accounts/{account_id}/payment/chargebacks/{payment_chargeback_id}
Request samples
Response samples
application/json

Shows a payment chargeback created as a result of dispute merchant loss.

{
  • "payment_dispute_id": "krn:payment:eu1:transaction:f9669608-a24d-43ef-9f34-ec3d785dc1ae:dispute:1",
  • "payment_chargeback_id": "krn:payment:eu1:transaction:f9669608-a24d-43ef-9f34-ec3d785dc1ae:chargeback:1",
  • "chargeback_amount": 5000,
  • "chargeback_reason": "DISPUTE_ARBITRATION_LOST",
  • "chargeback_at": "2024-01-02T13:00:00Z",
  • "line_items": []
}
Callback payload samples
POST: Webhook: Payment transaction chargeback
application/json

Shows a payment transaction chargeback webhook.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Payment Dispute API

List Disputes

Retrieve a list of Disputes, segregated by a variety of filter parameters

Securityklarna_api_key and klarna_partner_account
Request
query Parameters
payment_product_instance_id
Array of strings

Product Instance IDs to filter by

Example: payment_product_instance_id=krn:partner:product:payment:ad71bc48-8a07-4919-a2c1-103dba3fc918
payment_transaction_id
Array of strings (PaymentTransactionId)

Payment Transaction IDs to filter by

Example: payment_transaction_id=krn:payment:eu1:transaction:6debe89e-98c0-486e-b7a5-08a4f6df94b0
Array of strings (PaymentDisputeState)

States of disputes to filter by

reason
Array of strings (PaymentDisputeReason)

Dispute reason to filter by

Items Enum: "RETURN_NOT_REFUNDED" "PRODUCTS_NOT_RECEIVED" "PRODUCTS_FAULTY" "CAPTURE_AMOUNT_INCORRECT" "PURCHASE_CANCELED" "PURCHASE_UNAUTHORIZED" "PURCHASE_HIGH_RISK"
Example: reason=PRODUCTS_NOT_RECEIVED
sort_by
Array of strings
Default: ["opened_at"]

Specifies in which order to sort the results. Then results are ordered in ascending order if not prefixed by a - which orders by descending order.

Items Enum: "deadline_expires_at" "-deadline_expires_at" "opened_at" "-opened_at"
purchase_references
Array of strings (PurchaseReference)

Merchant References to filter by

Example: purchase_references=merchant-order-9876
opened_at_start
Array of strings <date-time> (Timestamp)

Used to filter by dispute open dates. Only disputes created after (including) the supplied value will be returned.

Example: opened_at_start=2024-01-01T12:00:00Z
opened_at_end
Array of strings <date-time> (Timestamp)

Used to filter by dispute open dates. Only disputes created before (excluding) the supplied value will be returned.

Example: opened_at_end=2024-01-01T12:00:00Z
closed_at_start
Array of strings <date-time> (Timestamp)

Used to filter by dispute close dates. Only disputes closed after (including) the supplied value will be returned.

Example: closed_at_start=2024-01-01T12:00:00Z
closed_at_end
Array of strings <date-time> (Timestamp)

Used to filter by dispute close dates. Only disputes closed before (excluding) the supplied value will be returned.

Example: closed_at_end=2024-01-01T12:00:00Z
size
integer <int32>

Limits the number of items to be returned. If omitted, the default page size will be used.

Example: size=20
starting_after
string

A cursor used in pagination, referring to a specific item. The last_item returned from a previous call can be used here. The next page will list items after this item. Cannot be used together with ending_before. If both starting_after and ending_before are omitted, the first page will be returned.

Example: starting_after=Zpq6F3mDYtwK8
Responses
200

A paginated list of authorized disputes

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.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

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

get/v2/payment/disputes
Request samples
Response samples
application/json
{
  • "disputes": [
    ],
  • "pagination": {
    }
}

Get Dispute Details

Fetch a fully detailed version of a Dispute, including all the associated requests and responses.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
payment_dispute_id
required
string

ID of dispute to fetch

Responses
200

Complete dispute with all requests and responses

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.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

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

Callbacks
postDispute state changed webhook callback
postDispute updated webhook callback
get/v2/payment/disputes/{payment_dispute_id}
Request samples
Response samples
application/json
{
  • "payment_dispute_id": "krn:payment:eu1:dispute:faulty-products:266091",
  • "dispute_reason": "PRODUCTS_FAULTY",
  • "state": "ARBITRATION_PENDING",
  • "previous_state": "MERCHANT_EVIDENCE_PENDING",
  • "payment_transaction_id": "krn:payment:eu1:authorization:6debe89e-98c0-486e-b7a5-08a4f6df94b0",
  • "purchase_reference": "f420e0e1-971b-417a-8ece-2626387eff36",
  • "payment_product_instance_id": "krn:partner:product:payment:ad71bc48-8a07-4919-a2c1-103dba3fc918",
  • "dispute_details": {
    },
  • "merchant_evidence": [
    ],
  • "config": {
    },
  • "created_at": "2020-04-15T08:31:00Z",
  • "updated_at": "2020-05-09T08:31:00Z",
  • "arbitration_started_at": "2020-05-08T00:00:00Z"
}
Callback payload samples
application/json

A payment dispute has just been submitted to Klarna.

{
  • "metadata": {
    },
  • "payload": {
    }
}

Accept dispute loss

Accept the loss of a dispute, which will be closed with the chargeback activation

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
payment_dispute_id
required
string

ID of dispute to accept loss for

Responses
202

Loss was accepted successfully

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.

404

Not Found, the requested resource was not found.

409

The dispute is not in a state where the loss can be accepted. Read the error details for further information.

429

Too Many Requests, the request was rate limited.

500

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

post/v2/payment/disputes/{payment_dispute_id}/accept-loss
Request samples
Response samples
application/json
{
  • "error_id": "5a3f6b9c-9b3b-4b7e-8f9d-9b9a4b9a4b9a",
  • "error_type": "INPUT_ERROR",
  • "error_code": "INVALID_CONTENT_TYPE",
  • "error_message": "The received input is not valid JSON.\nUnterminated string at 19 [character 20 line 1].\n"
}

Upload merchant evidence attachment

Uploads merchant attachment to be linked to a dispute response. File size limit is 7MB.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
payment_dispute_id
required
string

ID of dispute for which the request to add response to belongs

Request Body schema: multipart/form-data
filename
string

Name of a file to upload

file
required
string <binary>

File contents

Responses
201

Attachment uploaded successfully

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.

404

Not Found, the requested resource was not found.

429

Too Many Requests, the request was rate limited.

500

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

post/v2/payment/disputes/{payment_dispute_id}/attachments
Request samples
Response samples
application/json
{
  • "payment_dispute_attachment_id": "krn:payment:eu1:dispute:256947:attachment:3"
}

Respond to merchant evidence request

Respond to merchant evidence request.

Securityklarna_api_key and klarna_partner_account
Request
path Parameters
payment_dispute_id
required
string

ID of dispute for which the request to add response to belongs

Request Body schema: application/json
required

Response to add to request

One of:

Merchant response to a dispute where the customer claims that the products were faulty

additional_information
string

Free-text string with additional information about the dispute response

Array of objects (PaymentDisputeRespondToEvidenceRequestPayloadAttachment)

List of evidence provided by the merchant to support the dispute response.

required
object
Responses
201

Dispute's evidence request response was submitted successfully

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.

404

Not Found, the requested resource was not found.

409

The dispute is not in a state where a response can be submitted.

429

Too Many Requests, the request was rate limited.

500

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

post/v2/payment/disputes/{payment_dispute_id}/respond
Request samples
application/json

Responding to an evidence request with request type 'RETURN_NOT_REFUNDED'

{
  • "additional_information": "Additional free text information",
  • "created_at": "2020-05-08T08:32:14Z",
  • "attachments": [
    ],
  • "details": {
    }
}
Response samples
application/json
{
  • "response_id": "krn:payment:eu1:dispute:266092:request:1:response:1",
  • "created_at": "2020-05-09T09:32:18Z",
  • "additional_information": "Additional free text information",
  • "attachments": [
    ],
  • "details": {
    }
}