Ensure your payment is completed by using the payment token within 60 minutes to authorize the transaction and receive a payment transaction ID.
Once the customer successfully completes the Payment Request, it will transition to the COMPLETED
state, and Klarna will return a payment_token
via a webhook. More information on subscribing to webhooks is available in Subscribing to webhook events. The payment_token
is crucial to authorize the payment and generate the payment_transaction_id
.
The payment_token
is valid for 60 minutes. You must confirm the payment within the time limit otherwise the transaction will be lost.
For tokenized payments, the response will also include a klarna_customer
object. Within this object, you'll find the customer_token
, which can be used for future charges on customer accounts.
Further details on the tokenized payment flow will be available soon.
The Acquiring Partner will then have to use this payment_token
to create the transaction, by making a second request to the Payment Authorize API.
In this request, the Acquiring Partner will specify the following parameters:
Path Parameter:
Parameter name | Description |
---|---|
partner_account_id | Identifier of the Partner account the action is done on behalf of. |
Header parameter:
Parameter name | Description |
---|---|
Klarna-Payment-Token | The payment_token issued by Klarna on a completed Payment Request. |
Request body:
Parameter name | Description |
---|---|
currency | Currency in ISO 4217 format. |
request_payment_transaction | Represents a request to authorize a payment transaction. The amount parameter is sent through this object. |
Below an example request body for the second request to the Payment Authorize API. The Klarna-Payment-Token
must be sent as a HTTP header.
{
"currency": "USD",
"request_payment_transaction": {
"amount": 11800,
"payment_transaction_reference": "acquiring-partner-transaction-reference-1234"
}
}
When the Payment Request has been successfully confirmed, Klarna will return an HTTP 200 OK response and the response body will contain the payment_transaction_id
which you will need to perform all Payment Transaction management.
This endpoint is idempotent, meaning the same authorization request can be called multiple times with the same payment_token
, and it will return the same response each time. This ensures that the payment confirmation process is reliable and repeatable without any risk of double processing. More information available in Idempotency.
Response body
Parameter name | Description |
---|---|
payment_transaction_response | The response for a payment transaction will contain the result parameter which specifies the outcome of the 2n authorization. In case of a successful Authorization (result APPROVED ), the response body includes the Payment Transaction object. |
payment_transaction | The Payment Transaction object represents a single payment transaction This field is only returned if the payment_transaction_response.result is set to APPROVED The payment_transaction_id returned is necessary to manage the Payment Transaction through the Payment Transaction API. |
Sample request
{
"payment_transaction_response": {
"result": "APPROVED",
"payment_transaction": {
"payment_transaction_id": "krn:payment:eu1:transaction:6debe89e-98c0-[...]",
"payment_transaction_reference": "acquiring-partner-transaction-reference-1234",
"amount": 11800,
"currency": "USD",
"payment_funding": {...},
"payment_pricing": {...}