> ## Documentation Index
> Fetch the complete documentation index at: https://codebeans-cb-checkout-rules.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How it works

> When rules run, what customers see, and where your rules live in Shopify.

Codebeans Checkout Rules is built on Shopify's own checkout validation feature. Each rule you save becomes a checkout rule in your store, and Shopify runs it on its own servers during checkout. The app doesn't add any script to your storefront or checkout pages.

## When a rule runs

![The customer enters details at checkout, Shopify runs your active rules, and checkout either continues or stops with your message.](https://mintcdn.com/codebeans-cb-checkout-rules/9lVKcptiAqYAtTXj/images/how-it-works.svg?fit=max\&auto=format\&n=9lVKcptiAqYAtTXj\&q=85\&s=2deb769f1ea9ce676d0aed81131c919e)

A rule runs while the customer is moving through checkout and again when they try to complete the order. If the rule finds a problem, Shopify:

1. Stops the customer from continuing.
2. Shows your error message, either next to the field that has the problem or at the top of the checkout page.

When the customer fixes the problem, the message disappears and they can continue.

> [!NOTE]
>
> Rules that check the **shipping address** can only run once Shopify has the full address. In practice, that is when all the required address fields are filled in and the shipping options appear.

### Validating earlier, on add to cart

Every rule has a **Validate on add-to-cart** option. When it is on, the rule also runs when the customer changes their cart, not only at checkout. Some checkout-only details, such as the shipping address, may not be known yet at that point. See [Common rule settings](https://codebeans-cb-checkout-rules.mintlify.site/rules/common-settings.md#checkout-behavior).

## Two kinds of rules

> [card] [Preset rules](https://codebeans-cb-checkout-rules.mintlify.site/preset-rules/overview.md)
>
> Ready-made checks for common problems, like a missing house number or a P.O. Box. You only fill in a few settings and a message. Each preset can be added once.

> [card] [Custom rules](https://codebeans-cb-checkout-rules.mintlify.site/custom-rules/overview.md)
>
> Your own rules, built from conditions on the cart, the customer, the address and the delivery method. You can create several, depending on your plan.

## Where your rules live in Shopify

Every rule you save in the app also appears in your Shopify admin under **Settings → Checkout → Checkout rules**. Manage your rules from the app: the app keeps the rule's settings and status in sync with Shopify when you save, change the status or delete a rule.

## When rules don't run

Shopify only runs checkout rules during the online checkout. They don't run for:

* In-store checkouts in the Shopify POS app.
* Orders created by apps or other systems through Shopify's order API.
* Staff editing an existing order in the Shopify admin.
* Automatic subscription renewals.

See [Limitations](https://codebeans-cb-checkout-rules.mintlify.site/help/limitations.md) for the full list.

## If the app can't check a rule

Each rule has an **Allow checkout if the app has an error** option. When it is on, customers can still place their order if Shopify can't run the rule for any reason. When it is off, Shopify blocks the checkout in that case. It is on by default for new rules.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.