Validate order
Validate the order before completion.
Overview
You can run a final check on an order before it is submitted for payment processing. For example, check that all items are still in stock, or run rules against promotion abuse.
To use integrated validation, implement your validation logic on your side. Then specify its URL as MerchantOrderValidationUrl in the Create Order request. When the customer submits the order with 'Complete Purchase', Qliro Checkout sends the order information to that URL. Your response decides if the order is approved.
If you do not respond within 5 seconds, Qliro approves the order. You can instead configure Qliro Checkout to reject the order if no response arrives within that time.

How-to
1. Send create order request
Send the create order request with a value for MerchantOrderValidationURL.
2. Qliro sends validate order request
Qliro Checkout sends a validate order request to the URL.
3. Send response
Reply with a response status code.
4. Customer message
If you decline the order, Qliro Checkout shows a message to the customer.
Request example
{
"OrderId": 12345,
"MerchantReference": "MerchantReference-d19c4152-f8aa-4889-ab36-afd6fb5c5aa4",
"Currency": "SEK",
"Customer": {
"Email": "email@domain.com",
"MobileNumber": "0701234567",
"PersonalNumber": "111111-1111"
},
"OrderItems": [
{
"MerchantReference": "RedHat",
"Description": "Red hat original product",
"Type": "Product",
"Quantity": 3,
"PricePerItemIncVat": 375.55,
"PricePerItemExVat": 300.35
}
],
"ShippingAddress": {
"PostalCode": "12345"
},
"PaymentMethod": {
"PaymentMethodName": "CREDITCARDS",
"PaymentTypeCode": null
},
"SelectedShippingMethod": null,
"SelectedShippingSecondaryOption": null,
"IdentityVerification": {
"RequireIdentityVerification": false,
"IdentityVerified": null
}
}Response
Approved - Response status code = 200.
Declined - Response status code = 400 + DeclineReason.
{
"DeclineReason": "OutOfStock"
}Qliro Checkout shows the customer a message based on the DeclineReason. The message tells the customer what to do.
For the supported DeclineReason values, see Validate order in Notifications.
Good to know
- Use
DeclineReasonMessageto show the customer a custom error message. The limit is 150 characters. Qliro ignores a longer message.