Logotype
For developers
By Qliro
Select search filters:
0
0
/
/
Validate order
Validate the order before completion.
Overview
You can opt to do a final check on an order before submission for payment processing. This is a powerful tool that enables you to double-check whether all items are still in stock or even run some anti-promotional abuse rules.  To make use of integrated validation, implement the desired validation logic on your end then specify the URL as the MerchantOrderValidationUrl in the Create Order request. When the customer submits the order (by clicking  'Complete Purchase' in the checkout), Qliro Checkout will make a request to that URL with information about the order. The response determines whether the order should be approved or not.
Note: If no response is sent within 5 seconds, Qliro will assume that the order is approved.

Optionally, Qliro checkout can be configured to automatically reject the order if no response is received within the same timeframe.
 
How-to
  1. Send the create order request including a value for MerchantOrderValidationURL
  2. Qliro Checkout sends a validate order request to the URL.
  3. Send a reply with a response status code.
  4. If declined Qliro Checkout presents a message to the customer.
 
Request example
POST
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
  "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
    },
    {
      "MerchantReference": "RedHat",
      "Description": "Red hat campaign product",
      "Type": "Product",
      "Quantity": 1,
      "PricePerItemIncVat": 200,
      "PricePerItemExVat": 160,
      "Metadata": {
        "HasRisk": true,
        "Subscription": {
          "Enabled": true
        }
      }
    },
    {
      "MerchantReference": "RedHat",
      "Description": "Free product",
      "Type": "Product",
      "Quantity": 1,
      "PricePerItemIncVat": 0,
      "PricePerItemExVat": 0
    },
    {
      "MerchantReference": "BlackHat",
      "Description": "Original product",
      "Type": "Product",
      "Quantity": 95,
      "PricePerItemIncVat": 143,
      "PricePerItemExVat": 100
    },
    {
      "MerchantReference": "BlueHat",
      "Description": "Original product",
      "Type": "Product",
      "Quantity": 57,
      "PricePerItemIncVat": 69,
      "PricePerItemExVat": 50
    }
  ],
  "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.
1
2
3
{
  "DeclineReason": "OutOfStock"
}



 
Depending on the DeclineReason, Qliro Checkout will present a message to the customer describing what actions to take. 
For supported texts for DeclineReason go to Validate order in the Notifications section.

Good to know
  • Use DeclineReasonMessage if you want a custom error message to be shown to the customer. There is a 150 character limit, be sure not to overstep this limit otherwise the message will be ignored.