For a number of different reasons there could be a need to validate the order before it is completed. You can register a callback (where you can do the final merchant validation) on the order create that KCO will call when the consumer clicks the buy button.
Read more in the API documentation
*See Cards and 3D Secure
Make sure to include the optional property merchant_urls.validation. when you configure the checkout order.
Note: All communication with the validation URI will be encrypted. For that reason you must use the HTTPS protocol for this URI.
When the consumer clicks “buy now” a POST request will be sent to the merchant_urls.validation. The body of the request will contain the current order information. The structure of the order information is identical to the result of fetching the order, as you saw in render the checkout.
Note: There is no need to fetch the order from KCO since all the order information is included in the POST request body.
Once you receive the POST request, our system will expect a response within 3 seconds. If KCO does not receive a response and the order is created without require_validate_callback_success: true, we will approve the purchase. If the order is created with require_validate_callback_success: true and KCO does not receive a response within 10 seconds the order approval fails. The response you provide KCO will determine whether or not the purchase will be completed:
Note: The rejection page needs to be hosted by you, and we highly recommend that you give the consumer detailed information as to why you rejected the order.
Responding to the validation callback with HTTP
status 200 OK
will not always guarantee that the order is completed, for example if the consumer is paying using card and triggering 3D Secure authentication. When authentication is completed then a reservation is made on the customer’s card, in case a validation callback is fired after the authentication event and is responded to with an HTTP 303
(in this context: deny purchase) response status, Klarna will still retain the reservation on the customer’s card.
Hence, whenever Klarna reserves money this happens as the last part of the purchase flow. Therefore an HTTP 200 OK
response status followed by failed 3D Secure
authentication does not allow for completing the order and does not redirect the customer to the confirmation page.