Cancel Payment Requests efficiently using Klarna’s API, ensuring timely closures for unsuccessful requests and leveraging webhooks for real-time tracking.
A Payment Request remains open for a period of 48 hours, which is not adjustable. Klarna recommends Partners proactively close payment requests which have not resulted in successful transactions, especially if your payment request timeout is less than 48 hours.
To align the default timeout window of their checkout, Acquiring Partners can use the Cancel Payment Request API endpoint:
SUBMITTED
or IN_PROGRESS
can be canceled.CANCELED
.Sample response - State CANCELED
{
"payment_request_id": "krn:payment:eu1:request:552603c0-fe8b-4ab1-aacb-41d55fafbdb4",
"state": "CANCELED",
"previous_state": "SUBMITTED",
"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"
}
This operation also triggers a payment request webhook to which Acquiring Partners can subscribe to.
Event name | When |
---|---|
payment.request.state-change.canceled | To track successful payment request cancellation. |
Sample webhook - State CANCELED
{
"metadata": {
"event_id": "62bb5d9f-33d3-43d0-9d84-1018eb573ed6",
"event_type": "payment.request.state-change.canceled",
"event_version": "v2",
"occurred_at": "2025-03-06T09:51:59Z",
"recipient_account_id": "krn:partner:global:account:test:M48JWZF8",
"subject_account_id": "krn:partner:global:account:test:M4CIYH2N",
"product_instance_id": "krn:partner:global:account:product:payment:131c75cd-[...]",
"webhook_id": "krn:partner:global:notification:webhook:8932d175-[...]",