> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecharlie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Customer Rules

> Control which locations can fulfill orders based on customer properties

Customer rules let you restrict fulfillment based on **who is buying**. When specific customer types or segments place orders, you can control exactly which locations are allowed to fulfill them.

<Info>
  Customer rules are ideal for B2B fulfillment, VIP customer handling, or routing orders from specific customer segments to dedicated locations.
</Info>

## How customer rules work

A customer rule has two parts:

1. **When** (condition): Which customer properties trigger the rule
2. **Then** (filter): Which locations to block or allow when triggered

```mermaid theme={"system"}
flowchart LR
    A[Customer places<br/>order] --> B{Customer matches<br/>rule condition?}
    B -->|No| C[All locations<br/>eligible]
    B -->|Yes| D[Apply location<br/>filter]
    D --> E{Filter action}
    E -->|Include| F[Only specified<br/>locations can fulfill]
    E -->|Exclude| G[Specified locations<br/>blocked]
```

## Create a customer rule

<Steps>
  <Step title="Navigate to Fulfillment Constraints">
    Go to **Charlie → Fulfillment Constraints** and click **Create rule**.
  </Step>

  <Step title="Name your rule and set status">
    Enter a descriptive name (max 75 characters) that explains the rule's purpose, like "B2B orders - Warehouse only" or "VIP customers - Flagship stores".

    Set the **Status** to:

    * **Active**: Rule applies immediately at checkout
    * **Draft**: Rule is saved but won't affect checkout

    <Frame>
      <img src="https://mintcdn.com/charlie-6278c0d1/zIZXpEfAUH7cQkz5/images/constraints-customer-rule-form.png?fit=max&auto=format&n=zIZXpEfAUH7cQkz5&q=85&s=e63991aefccbeacd6addfacf36d011a6" alt="Customer rule form with name, status, and rule type" width="2398" height="1798" data-path="images/constraints-customer-rule-form.png" />
    </Frame>
  </Step>

  <Step title="Select Customer based as the rule type">
    Under **Rule type**, select **Customer based**.
  </Step>

  <Step title="Configure the condition (When)">
    In the **Configuration** section under **When**, set up what triggers the rule:

    **Condition**: Choose the customer property to match

    <Frame>
      <img src="https://mintcdn.com/charlie-6278c0d1/zIZXpEfAUH7cQkz5/images/constraints-customer-condition.png?fit=max&auto=format&n=zIZXpEfAUH7cQkz5&q=85&s=82b417223b3fd4652927f2223364a016" alt="Condition dropdown showing Customer B2B and Customer tags options" width="1546" height="932" data-path="images/constraints-customer-condition.png" />
    </Frame>

    | Condition         | Description                                         |
    | ----------------- | --------------------------------------------------- |
    | **Customer B2B**  | Targets customers with a B2B account in Shopify     |
    | **Customer tags** | Targets customers based on tags assigned in Shopify |

    **Operator**: Select how the condition matches

    | Operator             | Effect                                                   |
    | -------------------- | -------------------------------------------------------- |
    | **Includes**         | Rule triggers when customer matches the condition        |
    | **Does not include** | Rule triggers when customer does NOT match the condition |

    **Value**: Depends on the condition type

    * For **Customer B2B**: No value needed (automatically targets B2B customers)
    * For **Customer tags**: Enter the tag names to match
  </Step>

  <Step title="Configure the location filter (Then)">
    Under **Then**, define which locations are affected when the rule triggers:

    **Action:**

    | Action      | Effect                                                        |
    | ----------- | ------------------------------------------------------------- |
    | **Include** | Only the specified locations can fulfill (all others blocked) |
    | **Exclude** | The specified locations are blocked (all others allowed)      |

    **Property**: Choose how to target locations

    <Frame>
      <img src="https://mintcdn.com/charlie-6278c0d1/zIZXpEfAUH7cQkz5/images/constraints-customer-property.png?fit=max&auto=format&n=zIZXpEfAUH7cQkz5&q=85&s=1e16fdbf2cf12b3d6ac9aa06de1dd5b5" alt="Property dropdown showing Specific locations, Location with tag, and Location with type options" width="1568" height="928" data-path="images/constraints-customer-property.png" />
    </Frame>

    | Property               | Value                       | Use when                                         |
    | ---------------------- | --------------------------- | ------------------------------------------------ |
    | **Specific locations** | Select individual locations | You need precise control over specific locations |
    | **Location with tag**  | Enter tag names             | You want to target locations by capability       |
    | **Location with type** | Warehouse or Store          | You want to target all locations of a type       |
  </Step>

  <Step title="Save the rule">
    Click **Save** to create your rule. If set to Active, it takes effect immediately at checkout.
  </Step>
</Steps>

<Warning>
  You can create up to **10 configurable rules** total across Product, Customer, and Cart rule types. Plan your rules strategically.
</Warning>

## Condition types

<Tabs>
  <Tab title="Customer B2B">
    Automatically targets customers who have a B2B account in Shopify. This uses Shopify's native B2B functionality.

    **Best for:**

    * Wholesale customers requiring dedicated fulfillment
    * B2B orders that need special invoicing or packaging
    * Separating B2B and B2C fulfillment streams

    **Example:** Route all B2B orders to your central warehouse where bulk packaging and commercial invoicing are handled.

    <Info>
      This condition requires [Shopify B2B](https://help.shopify.com/en/manual/b2b) to be enabled on your store.
    </Info>
  </Tab>

  <Tab title="Customer tags">
    Targets customers based on tags you've assigned in Shopify. This gives you flexible segmentation options.

    **Best for:**

    * VIP or loyalty program members
    * Regional customer segments
    * Custom customer classifications

    **Example:** Tag your VIP customers with `vip` and route their orders to locations with dedicated customer service.

    <Tip>
      Customer tags are managed in Shopify Admin under **Customers**. You can add tags manually or use Shopify Flow to automate tagging.
    </Tip>
  </Tab>
</Tabs>

## Location filters

<AccordionGroup>
  <Accordion title="Filter by specific locations">
    Select individual locations from your list. Use this when you need precise control.

    **Example setup:**

    * Action: **Include**
    * Property: **Specific locations**
    * Value: Paris B2B Warehouse, Lyon B2B Warehouse

    **Result:** Only the selected B2B warehouses can fulfill orders from matching customers.
  </Accordion>

  <Accordion title="Filter by location tag">
    Target locations based on tags you've assigned. This is powerful for capability-based routing.

    **Example setup:**

    * Action: **Include**
    * Property: **Location with tag**
    * Value: `b2b-enabled`

    **Result:** Only locations tagged `b2b-enabled` can fulfill orders from matching customers.

    <Info>
      Make sure you've [set up location tags](/locations/tags) before using this filter.
    </Info>
  </Accordion>

  <Accordion title="Filter by location type">
    Target all Warehouses or all Stores at once.

    **Example setup:**

    * Action: **Include**
    * Property: **Location with type**
    * Value: Warehouse

    **Result:** Only warehouses can fulfill orders from matching customers; all stores are blocked.
  </Accordion>
</AccordionGroup>

## Examples

### B2B orders from warehouse only

A fashion brand wants to ensure all B2B orders are fulfilled from their central warehouse where they have dedicated bulk packaging and commercial invoicing processes.

<Steps>
  <Step title="Create the rule">
    * **Name:** B2B orders - Warehouse only
    * **Status:** Active
    * **Type:** Customer based
  </Step>

  <Step title="Set condition (When)">
    * **Condition:** Customer B2B
    * **Operator:** Includes
  </Step>

  <Step title="Set filter (Then)">
    * **Action:** Include
    * **Property:** Location with type
    * **Value:** Warehouse
  </Step>
</Steps>

**Result:** All B2B customer orders are fulfilled exclusively from warehouses, never from retail stores.

***

### VIP customers from flagship stores

A luxury retailer wants to ensure VIP customers receive orders from flagship stores where premium packaging and personalized notes are available.

<Steps>
  <Step title="Tag VIP customers">
    In Shopify Admin, add the tag `vip` to your VIP customers. You can do this manually or use Shopify Flow.
  </Step>

  <Step title="Tag flagship stores">
    Go to [Locations](/locations/overview) and add the tag `flagship` to your flagship stores.
  </Step>

  <Step title="Create the rule">
    * **Name:** VIP customers - Flagship stores
    * **Status:** Active
    * **Type:** Customer based
  </Step>

  <Step title="Set condition (When)">
    * **Condition:** Customer tags
    * **Operator:** Includes
    * **Value:** `vip`
  </Step>

  <Step title="Set filter (Then)">
    * **Action:** Include
    * **Property:** Location with tag
    * **Value:** `flagship`
  </Step>
</Steps>

**Result:** VIP customers' orders are only fulfilled from flagship stores with premium service.

<Warning>
  Make sure at least one flagship store has inventory for the products VIP customers order, otherwise checkout will be blocked.
</Warning>

***

### Exclude new customers from store fulfillment

A retailer wants to fulfill orders from new (untagged) customers only from warehouses to ensure consistent quality control before routing to stores.

<Steps>
  <Step title="Create the rule">
    * **Name:** New customers - Warehouse only
    * **Status:** Active
    * **Type:** Customer based
  </Step>

  <Step title="Set condition (When)">
    * **Condition:** Customer tags
    * **Operator:** Does not include
    * **Value:** `verified`
  </Step>

  <Step title="Set filter (Then)">
    * **Action:** Include
    * **Property:** Location with type
    * **Value:** Warehouse
  </Step>
</Steps>

**Result:** Customers without the `verified` tag can only have orders fulfilled from warehouses.

<Tip>
  Use Shopify Flow to automatically add the `verified` tag after a customer's first successful order.
</Tip>

## Best practices

<CardGroup cols={2}>
  <Card title="Use B2B for wholesale" icon="building">
    If you have wholesale customers, use Shopify's native B2B feature and the Customer B2B condition for clean separation.
  </Card>

  <Card title="Combine with location tags" icon="tags">
    Tag locations by capability (`b2b-enabled`, `vip-service`, `bulk-packaging`) for flexible, maintainable rules.
  </Card>

  <Card title="Automate customer tagging" icon="wand-magic-sparkles">
    Use Shopify Flow to automatically tag customers based on behavior, purchase history, or other criteria.
  </Card>

  <Card title="Test with Draft status" icon="flask">
    Create rules in Draft mode first, verify the logic, then activate. This prevents unexpected checkout blocks.
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="B2B customers see 'no shipping options'">
    This means all locations with stock are blocked for B2B customers.

    **Check:**

    1. Does at least one allowed location (e.g., warehouse) have the product in stock?
    2. Is the B2B customer properly set up in Shopify B2B?
    3. Are there conflicting rules blocking all locations?

    **Quick fix:** Set the rule to Draft temporarily to restore checkout.
  </Accordion>

  <Accordion title="Customer tags rule doesn't apply">
    **Check:**

    1. Is the rule status set to **Active**?
    2. Does the customer actually have the tag in Shopify? (Check Customers > Customer profile)
    3. Is the tag spelled exactly the same (tags are case-sensitive)?
    4. If using "Does not include", remember the logic is inverted

    **Debug tip:** Check the customer's profile in Shopify Admin to verify their tags.
  </Accordion>

  <Accordion title="Rule applies to wrong customers">
    **Check:**

    1. Is the operator correct? ("Includes" vs "Does not include")
    2. For Customer tags, are you targeting the right tag?
    3. Are there other customers with the same tag who shouldn't be affected?

    **Solution:** Use more specific tags or combine multiple conditions.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Product Rules" icon="box" href="/constraints/product-rules">
    Restrict locations based on what's in the cart
  </Card>

  <Card title="Cart Rules" icon="cart-shopping" href="/constraints/cart-rules">
    Restrict locations based on cart properties
  </Card>

  <Card title="Location Tags" icon="tags" href="/locations/tags">
    Set up tags to use in your rules
  </Card>

  <Card title="Order Routing" icon="route" href="/order-routing/overview">
    Prioritize locations instead of blocking them
  </Card>
</CardGroup>
