Validate order

In order to verify that the articles exists in stock when completing a purchase you can provide a validation uri in the Initialize a Checkout Session request. If provided, a call this uri will be performed before the purchase is completed

During this validate call your backend can (optionally) create an order and send the order reference back in the response as json.

Note that this order should not be considered completed on your side since the purchase is not completed yet. Please read up on the Handle Purchase Callbacks section since the notification callback is the only valid place to consider a purchase to be successful.

If an order reference is provided in the response it will be shown on the thank you page.

Please Note

Even if the validate call was successful (2xx, e.g. 200 OK) the purchase might not be completed due to various reasons. For example, the credit check on the customer might be rejected.

If this call returns a non-2xx http status code, we will stop the purchase and emit a frontend event, read more in section Client-side events. We will follow redirects, e.g. 301.

This call has a timeout of 10 seconds, if the call does not return a response within this timeout the purchase will not be completed and the customer will be shown a message and given the opportunity to try again. Please note that this endpoint might be called several times. For example when the end customer fails the credit check and chooses to purchase by card or direct bank transfer instead. In these cases there will be several calls to this endpoint.

GET /validation-uri-provided-in-initialize HTTP/1.1
Host: yourdomain.se
Please note!

By using this feature the time it takes to complete a purchase will increase, causing longer wait times for the end customer. If you have reservation functionality in your ecommerce system we suggest you use that instead. Reservation in ecommerce systems is a feature to reserve/lock the articles the customer have in the cart when visiting the Checkout page, preventing customers from buying articles that dont exist in stock.

Request properties

There are no request properties.

Properties for successful response

PropertyRequiredExplanation
orderReferenceNoOrder reference to the order just created during the validate call. This can later be used to track the purchase with merchant services. Max 50 chars.

Properties for unsuccessful response

PropertyRequiredExplanation
titleNoThe title of the validation failure displayed in the Checkout. Truncated to max 512 chars.
messageNoThe message with a more descriptive text why the validation failed, and how the customer should proceed. Truncated to max 512 chars.

In order to override the default title and message both title and message must be specified in the response.

The response must be empty or a valid Json document.