> The index of all pages is at [llms.txt](https://developers.qliro.com/llms.txt). Add `.md` to any page URL for its Markdown.

# Validate order (/qliro-checkout/checkout-features/validate-order)

## 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](https://developers.qliro.com/api-reference/merchant/orders/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.

<Callout type="info">
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.
</Callout>

![Validate Order](<https://developers.qliro.com/assets/validate-order-BL6w67-f.webp>)

## 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

```json
{
  "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`.

```json
{
  "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](https://developers.qliro.com/qliro-checkout/get-started/notifications-checkout).

## Good to know

* Use `DeclineReasonMessage` to show the customer a custom error message. The limit is 150 characters. Qliro ignores a longer message.

<Cards>
<Card title="Integrated shipping" href="/qliro-checkout/checkout-features/integrated-shipping">
Continue to Integrated shipping
</Card>
</Cards>