Shopify checkout validation lets you check a cart against store rules and stop an order when the cart does not qualify. A merchant can install a validation app, configure the rule, activate it under Settings > Checkout > Checkout rules, and test both valid and invalid carts. Developers can build the underlying server-side logic with Shopify Functions.
This guide explains both routes, with an operational setup process for merchants and a clear handoff point for custom development.
What is Shopify checkout validation?
Shopify checkout validation is a server-side check that decides whether a shopper can proceed through checkout or complete an order. When a cart fails a validation, Shopify blocks progress and displays the error message returned by the rule.
Typical policies include:
- Limiting the quantity of a product or collection.
- Requiring a minimum cart value.
- Preventing restricted products from being purchased together.
- Restricting a purchase by country, discount, shipping method, payment method, or customer profile, such as when you need to block Shopify checkout by customer tag.
- Requiring information such as a custom checkout field.
Validation is different from a warning that appears only in the theme. A theme message can help a shopper, but server-side validation enforces the policy when the cart or checkout is submitted.
Should you use a validation app or build a Shopify Function?
Choose the simplest approach that can express and maintain the policy.
| Requirement | Best starting point |
|---|---|
| Configure common cart, customer, product, location, discount, shipping, or payment conditions | A cart and checkout validation app |
| Let store operators change rules without deploying code | An app with a merchant-facing rule builder |
| Implement proprietary logic or data relationships unique to the business | A custom app using Shopify Functions |
| Control the app interface, deployment, logs, and API version internally | A custom Shopify Function |
Shopify’s merchant documentation directs stores to install a third-party app that supports cart and checkout validations. Shopify’s developer documentation explains how apps implement these checks with the Cart and Checkout Validation Function API.
For most merchants, an app is the practical route. A custom Function is an engineering project: it requires an app, development-store access, Shopify CLI, deployment, activation, testing, and ongoing ownership.
What should you define before adding a checkout rule?
Write the policy before opening a rule builder. A useful specification contains 5 parts:
- Invalid state: the exact cart or checkout state to block.
- Scope: the products, variants, collections, customers, or markets affected.
- Threshold or comparison: for example, fewer than 6 units or a subtotal over $500.
- Shopper correction: what the shopper must change to continue.
- Exceptions: customer tags, products, markets, or order paths that should remain eligible.
For example:
Block checkout when the cart contains any product from the Wholesale Cases collection and the combined quantity of those products is fewer than 6. Tell the shopper to increase the quantity to 6 or remove the wholesale products.
This is safer than starting with a vague instruction such as “add a wholesale rule.” It gives the person configuring the validation a testable outcome.
Test how multiple rules interact
When several validations can reject the same cart, test them together rather than approving each rule in isolation. Build a cart that fails two rules and record which messages appear, whether both corrections can be made at once, and whether fixing the first error reveals a second one. Check that one rule’s correction does not trigger another rule unexpectedly. Include combinations that share the same products, customer segment, market, or threshold. If the result is confusing, narrow the conditions or rewrite the messages so shoppers know which change to make first. Keep this conflict test in the launch checklist whenever a new rule joins the stack.
How to add a Shopify checkout validation rule with an app
The labels inside each app differ, but the Shopify activation flow is consistent. Confirm your app’s current plan, supported conditions, and checkout surfaces before configuring a live store.
1. Install a cart and checkout validation app
Choose an app that supports the inputs and rule combinations in your written policy. CartBlock on the Shopify App Store lists conditions including quantity, cart, price, discount, product, variant, collection, purchase frequency, customer tags, geolocation, payment methods, and shipping methods.
Do not assume every condition works on every plan or surface. Check the current listing and in-app configuration before committing the store policy to a particular setup.
2. Create and name the rule
Open the app from Shopify admin and create a validation rule. Use an operational name that explains its scope, such as Wholesale cases: minimum 6 or Restricted collection: US only.
A specific name makes the rule easier to audit when several validations are active.
3. Configure the invalid condition
Translate the policy into conditions. Check every comparison and every AND/OR group.
For example:
Cart contains a product in Wholesale Cases AND collection quantity is less than 6.
Changing AND to OR would be much broader: it could block an unrelated cart merely because its total quantity is below 6. Read the complete rule back as a sentence before saving it.
4. Write a corrective error message
Tell the shopper what failed and how to fix it.
Good message:
Wholesale cases must be ordered in quantities of 6 or more. Increase the quantity to 6, or remove the wholesale items to continue.
Weak message:
Cart is invalid.
Avoid internal rule names, codes, and vague warnings. The error should reduce support questions, not create one.
5. Save the rule in the app
Review its scope, thresholds, exception logic, and message. Save the configuration, then follow the app’s instructions for making the validation available to Shopify Checkout.
6. Activate it in Shopify checkout settings
In Shopify admin:
- Go to Settings > Checkout.
- Open Checkout rules.
- Click Add rule.
- Select the validation supplied by the installed app.
- Choose the available settings and save.
- Turn on the rule.
Shopify also exposes an Allow all customers to complete checkout behavior for errors with the rule. Review that setting deliberately: it controls how checkout responds when the validation itself encounters an error, not whether your written policy is valid.
7. Test valid, invalid, and boundary carts
Use a repeatable test matrix before relying on the rule.
| Test | Expected result |
|---|---|
| Cart clearly outside the rule’s scope | Checkout proceeds |
| Invalid cart one unit below a minimum | Checkout is blocked with the correct message |
| Cart exactly at the minimum | Checkout proceeds |
| Invalid cart one unit above a maximum | Checkout is blocked with the correct message |
| Eligible customer or market exception | Checkout proceeds |
| Shopper corrects the invalid cart | Error clears and checkout proceeds |
| Draft order, if used by staff | Follows the store’s documented validation/override policy |
Also test the storefront cart, standard checkout, and relevant accelerated checkout paths. Shopify states that validation errors can be exposed through the Storefront API, cart templates, and checkout; the surfaces that shoppers see still depend on the app, theme, configuration, and targeted validation error.
How do developers create custom Shopify checkout validation?
Developers create a cart and checkout validation Function inside a Shopify app. The high-level workflow is:
- Create or open a Shopify app and development store.
- Generate a cart and checkout validation extension with Shopify CLI.
- Define the Function input query so it requests only the data the rule needs.
- Implement the validation logic in a supported language.
- Return a validation error with a helpful message and target when the cart is invalid.
- Preview and test the Function on a development store.
- Deploy the app, add the rule under Shopify checkout settings, and activate it.
- Review Function executions and replay failures during testing.
Shopify Functions run on Shopify’s servers. A validation error can target the cart or a supported checkout field, such as an email, phone number, or delivery-address field. Use the current Shopify Cart and Checkout Validation documentation for API-version requirements, supported targets, and deployment steps.
Merchants should not start here unless the business rule genuinely needs custom engineering. The code is only one part of the work; someone must also own configuration, version upgrades, monitoring, and incident response.
What checkout validation mistakes should you avoid?
Blocking more carts than the policy requires
Misgrouped AND/OR conditions are a common source of overblocking. Test unrelated products and customers, not only the cart that should fail.
Writing an error without a correction
“Checkout blocked” confirms that something happened but does not help the shopper recover. State the quantity, product, address, or cart change needed.
Testing only the happy path
Test below, at, and above every numeric boundary. Test signed-in and guest shoppers, relevant markets, customer exceptions, and the order paths your team actually uses.
Treating validation as fraud analysis
A validation rule enforces the conditions you configure. It does not score fraud or guarantee that an order is legitimate. Use Shopify’s fraud tools, payment controls, operational review, and narrowly written preventive rules for their separate purposes.
If your policy is intended to stop fake orders on Shopify, treat it as a focused prevention workflow and keep fraud assessment separate.
Forgetting draft-order behavior
Shopify states that cart and checkout validation rules apply to draft orders by default, while staff can override all validation rules before completing a draft order. Document who may use that override and when.
Shopify checkout validation launch checklist
- Write the invalid state and affected scope in plain language.
- Choose an app or custom Function based on ownership and complexity.
- Confirm current plan, condition, and surface availability.
- Review related implementations when you need to block an ineligible discount code at Shopify checkout or block a shipping method at Shopify checkout.
- Name the rule so another operator can identify it.
- Check all comparisons and AND/OR groups.
- Write a specific, corrective error message.
- Decide how Function errors should affect checkout.
- Test invalid, valid, boundary, exception, and correction cases.
- Test relevant storefront, checkout, accelerated, and draft-order paths.
- Record the rule owner and a review date.
Frequently asked questions
Can I add checkout validation without Shopify Plus?
Cart and checkout validation apps can be available to stores below Shopify Plus, but individual app features and checkout customizations can have separate plan requirements. Check the current app listing and the exact validation you plan to use. Do not treat eligibility for one feature as eligibility for every checkout feature.
Where do I activate a Shopify checkout rule?
Go to Settings > Checkout > Checkout rules, add the validation supplied by the installed app, save it, and turn it on. Configure the business logic inside the app first.
Do Shopify checkout validation rules affect draft orders?
Shopify says validation rules apply to draft orders by default. Staff can override all validation rules before completing a draft order, so merchants should define an internal override policy.
Can a checkout validation show a custom error message?
Yes. Shopify’s validation Function API returns an error message and target when a rule fails. The message should identify the problem and tell the shopper how to correct it.
How many checkout validation Functions can a store activate?
Shopify’s current Function API reference states that a store can activate up to 25 validation Functions. Recheck this volatile platform limit before designing a large validation stack.
Add the rule, then prove it works
A Shopify checkout validation rule is ready only when the written policy, configured conditions, shopper message, and test results agree. Start with one narrow invalid state, activate it through Shopify checkout settings, and test every boundary and exception that matters.
Explore CartBlock on the Shopify App Store if you need configurable validation conditions for products, carts, customers, locations, discounts, shipping methods, or payment methods. Confirm current plan eligibility and follow the installed app’s current setup guidance.

Install Now