> For the complete documentation index, see [llms.txt](https://help.dollarlabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.dollarlabs.io/dollarlabs-ultimate-discounts/checkout-validation.md).

# Checkout validation

Checkout Validation lets you control **when a cart is allowed to become an order** by enforcing rules based on the cart, customer, or line items. You can **block**, **soft warn**, or **validate at different stages** of the checkout flow—giving you fine-grained control over who can place an order and under what conditions.

This article explains:

* What checkout validation is
* The different validation block types
* How cart groups and rules work
* All supported variables you can use in rules

{% embed url="<https://dollarlabs.neetorecord.com/watch/467ef7a8ee4f11922d1b>" %}

***

### What is Checkout Validation?

Checkout validation allows you to **prevent or warn customers** from completing an order unless specific conditions are met.

Common use cases include:

* Enforcing a **minimum order quantity** (e.g. at least 10 items)
* Enforcing a **minimum cart subtotal**
* Enforcing a minimum **after discounts**, so a discount can't take an order below your minimum
* Restricting orders to **logged-in users or B2B customers**
* Applying rules only for **specific products, customers, or markets**

If a cart does not meet the defined rules, the customer is either:

* Blocked immediately,
* Blocked at checkout completion, or
* Shown a warning (soft block).

***

### Validation Block Types

You can choose **when and how** the validation is applied:

#### 1. **Block at Cart**

* Validation is enforced **while adding items to cart**
* Customers cannot add items if rules aren’t met
* Error message can appear on:
  * Product page
  * Cart page
  * Slide cart

**Example:**\
Customer cannot add items unless the cart quantity is 10 or more.

***

#### 2. **Block at Checkout Completion**

* Customers can freely edit the cart
* Validation happens **only when clicking “Pay Now”**
* Order is blocked if rules are not satisfied

**Example:**\
Customer fills checkout details but is blocked at payment because the minimum quantity is not met.

{% hint style="info" %}
We suggest to stick to this unless you definitely need to block at storefront itself, this is because when set to block at cart – it makes it difficult for the customer to freely modify the existing items in cart.
{% endhint %}

***

#### 3. **Show Warning in Checkout (Soft Block)**

* Displays a warning message in checkout
* **Does not block the order**
* Customer can still proceed and pay

**Example:**\
“The recommended minimum order quantity is 10 items; otherwise, a surcharge of $10 is applied.”

***

### Cart Groups

Checkout validation uses a **group-based logic system**, similar to Shopify’s discount rule builder.

#### How Cart Groups Work

* You can create **multiple cart groups**
* Each group can contain **multiple conditions**
* Conditions within a group can be combined using:
  * **AND**
  * **OR**
* Cart groups can then be referenced in the **Rules** section

This allows you to build **simple or highly advanced logic**, such as:

* Minimum quantity **AND** customer is logged in
* B2B customers **OR** specific product collections
* Different rules for different customer segments

{% hint style="info" %}
For every group, we calculate the following and make it avialable to use in the Rules section.

Total cart amount (after discounts)\
Subtotal cart amount\
Line count\
Quantity sum\
Unique product count\
Unique variant count

**Subtotal cart amount** is the group's value before discounts. **Total cart amount (after discounts)** is the group's value after discounts, including product and order discounts.
{% endhint %}

Based on what is set up in the rules section, the cart either passes the validation or not. If it fails - then the message configured is shown at the touchpoint specified in the **Validation Block Type.**

***

### Example: Enforcing Minimum Cart Quantity

**Goal:** Customer must purchase **at least 10 items**

**Rule setup:**

* Variable: `Cart quantity (Quantity sum)`
* Condition: `greater than`
* Value: `9`\
  *(greater than 9 = 10 or more)*

{% hint style="info" %}
Or alternatively - you could just use the default ALL group and use the Quantity sum > 9 check to validate this without creating a cart group.

<img src="https://2844543096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcVBfwy7Yj4tU8TsxkHEr%2Fuploads%2Fgit-blob-f3169e66e83ddd852b602b9a9d4749b8de97c0fc%2Fimage.png?alt=media" alt="" data-size="original">
{% endhint %}

**Result:**

* With fewer than 10 items → validation message shown
* With 10 or more items → checkout allowed

***

### Example: Minimum Order Value After Discounts

**Goal:** Block orders where discounts bring the cart below **$50**.

A check on the subtotal looks at prices **before** discounts. A $60 cart with a 20% discount still passes it, even though the customer pays $48. To check the amount the customer actually pays for the products, use the after-discounts value.

**Rule setup:**

* Group: `All`
* Variable: `Total cart amount (after discounts)`
* Condition: `greater than`
* Value: `49.99`

**Result:**

* $60 cart with 20% off ($48) → validation message shown
* $70 cart with 20% off ($56) → checkout allowed

{% hint style="info" %}
To set a minimum on a single product line instead, add a cart group condition on **Line total after discounts**. This is the whole line (price × quantity) after its discounts, not the price of one unit.

Enter amounts in your store currency. When a customer checks out in another currency, the app converts your amount to that currency before it compares.
{% endhint %}

***

### Supported Variables

You can mix and match variables across **Cart**, **Customer**, and **Line Item** levels when building conditions.

***

#### Cart Variables

Use these to validate the cart as a whole:

* **Cart attribute**
* **Cart has product**
* **Cart has variant**
* **Cart market**
* **Cart quantity**
* **Cart subtotal**
* **Retail location**

***

#### Customer Variables

Use these to apply rules based on who the customer is:

* **Customer company**
* **Customer ID**
* **Customer is B2B**
* **Customer logged in**
* **Customer tag**
* **Orders count**

***

#### Line Item Variables

Use these to apply rules based on specific products or variants:

* **Line attribute**
* **Line quantity**
* **Line subtotal**
* **Line total after discounts**
* **Product collection**
* **Product ID**
* **Product tag**
* **Variant ID**
* **With selling plan**

***

### If the Validation Can't Run

Rarely, Shopify can't run a validation — for example, because of an error or a timeout. The **Block checkout if app experiences a problem** setting decides what happens then:

* **Off (default):** checkout continues without this validation.
* **On:** customers can't complete checkout until the validation runs again.

Turn it on only for rules that must never be skipped, such as a hard minimum order value. You can set it in the app, on the validation's settings card. You no longer need to change it in Shopify admin.

***

### Combining Conditions (Advanced Logic)

You can build advanced validations such as:

* Cart quantity ≥ 10 **AND** Customer is logged in
* Customer is B2B **OR** Cart subtotal ≥ $500
* Product belongs to Collection X **AND** Variant has selling plan

This makes checkout validation extremely flexible for all use cases.

***

### Need Help?

If you have questions or need help setting up checkout validations:

* Use the in-app chat widget
* Email us at **<support@dollarlabs.io>**
