Klarna Docs - Validations in the payment process

Validations in the payment process

Here you find information on the validations that occur throughout the payment process.

Different data validations occur in the three steps of the payment process:

  1. Initiate a payment.
  2. Check out.
  3. Create an order.

When initiating a payment, the Klarna payments API uses the request payload to validate the attributes of the created session. We validate that:

  • locale and purchase_country are aligned
  • tax is aligned to the standards in the Handle tax article
  • value types and restrictions on specific fields are aligned to the guidelines in the API documentation.

When updating the cart, the Klarna payments API takes any updated data as a new session to validate.

When getting the authorization, the authorize() call triggers a risk and fraud assessment on Klarna’s side.

In this step, we check that the address fulfills all country standards and exists in the records of that specific country. If this information is broken, the validation fails.

If any address field - in either billing or shipping - is incorrect, you get an error message specifying what field is failing.

When creating an order, we validate the data against the most recent purchase and customer information you send us. This applies to both scenarios, recurring and one-time payments.

By considering the last payload you send, we ensure that both yours and our side keep the most updated data. We validate the following:

  • the billing and shipping address objects are the same when creating an order and getting authorization. Any difference makes the order invalid
  • the order lines in the payload are the same when creating an order and getting authorization. This object is treated as a list.

If the data shared when creating an order matches the data shared when getting authorization and no other details have been added in between, the validation is successful.

If you share customer details up until creating an order but not when getting authorization, an empty payload matches the customer data you are sending, and the validation is successful.