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

# Ranked location groups

> Prioritize fulfillment locations using automatic grouping

Ranked location groups let you control which locations should fulfill orders first by automatically grouping similar locations together. Instead of manually arranging individual locations, you define groups based on location type or tags.

<Info>
  This is the most commonly used routing rule. It's ideal for basic strategies like "warehouses first, then stores" without manually managing each location.
</Info>

## How ranked groups work

You create prioritized groups of locations. Shopify tries to fulfill from the highest-priority group first, then falls back to lower-priority groups if needed.

```mermaid theme={"system"}
flowchart LR
    A[Order placed] --> B[Group 1:<br/>Warehouses]
    B --> C{Stock<br/>available?}
    C -->|Yes| D[✅ Fulfill from warehouse]
    C -->|No| E[Group 2:<br/>Large stores]
    E --> F{Stock<br/>available?}
    F -->|Yes| G[✅ Fulfill from store]
    F -->|No| H[Group 3:<br/>All other locations]
```

<Note>
  **Shopify's native ranked locations** requires you to manually drag and drop each location. If you have 50 warehouses, you arrange all 50 manually. With Charlie's ranked groups, all warehouses automatically get the same priority.
</Note>

## Configure ranked location groups

<Steps>
  <Step title="Access order routing settings">
    Go to **Charlie → Settings → Order routing** or **Shopify → Settings → Shipping and delivery → Order routing**.
  </Step>

  <Step title="Add the Ranked Location Groups rule">
    Find Charlie's **Ranked Location Groups** rule and add it to your routing strategy.
  </Step>

  <Step title="Create your first group (highest priority)">
    Add a group and choose how to select locations:

    | Selector type          | Description                          |
    | ---------------------- | ------------------------------------ |
    | **Specific locations** | Choose individual locations manually |
    | **Location type**      | All Warehouses or all Stores         |
    | **Location tag**       | Locations with specific tags         |
  </Step>

  <Step title="Add additional groups (lower priorities)">
    Create more groups in order of preference. Locations matching the first group get priority 1, second group gets priority 2, and so on.
  </Step>

  <Step title="Enable the rule">
    Toggle the rule to **Enabled** when you're ready to apply it to live orders.
  </Step>
</Steps>

<Warning>
  **Limits:** Maximum 10 groups, 5 selectors per group, 100 manual locations total, and 10 tags per selector.
</Warning>

## Selector types

<Tabs>
  <Tab title="Specific locations">
    Choose individual locations manually, similar to Shopify's native rule but grouped together.

    **Best for:** Small groups of specific locations that don't share common characteristics.

    **Example:** Your two flagship stores that should always have priority.
  </Tab>

  <Tab title="Location type">
    Automatically group all locations of the same type.

    | Type          | Description                          |
    | ------------- | ------------------------------------ |
    | **Warehouse** | Distribution and fulfillment centers |
    | **Store**     | Retail locations                     |

    **Best for:** Simple warehouse vs store separation.

    <Tip>
      Make sure you've [set up location types](/locations/types) before using this selector.
    </Tip>
  </Tab>

  <Tab title="Location tag">
    Group locations that have specific tags you've assigned.

    **Common tags:**

    * `3pl` — Third-party logistics providers
    * `b2b` — Business customer fulfillment
    * `fast-shipping` — Expedited fulfillment capable
    * `east-coast`, `west-coast` — Regional routing

    **Best for:** Flexible grouping based on capabilities or characteristics.

    <Tip>
      Make sure you've [set up location tags](/locations/tags) before using this selector.
    </Tip>
  </Tab>
</Tabs>

## Combining selectors

### Multiple selectors in one group (OR logic)

When you add multiple selectors to the same group, a location matches if it meets **any** of the criteria:

**Example:** Warehouses OR locations tagged `3pl`

```
Group 1:
  - Selector: Location type = Warehouse
  - Selector: Location tag = 3pl
```

**Result:** Any warehouse matches, AND any location tagged `3pl` matches (even if it's a store).

### Multiple tags in one selector (AND logic)

When you add multiple tags to a single selector, a location must have **all** the tags:

**Example:** Locations tagged BOTH `fast-shipping` AND `vip`

```
Group 1:
  - Selector: Location tags = fast-shipping, vip
```

**Result:** Only locations with both tags match.

### Priority order matters

Locations are checked against groups in order. Once a location matches a group, it gets that group's priority and isn't checked against later groups.

**Example:**

* Group 1: Locations tagged `vip`
* Group 2: All warehouses
* Group 3: All stores

A warehouse tagged `vip` gets **first priority** (from Group 1), not second priority (from the warehouse group).

## Examples

### Warehouses first, then stores

The most common setup: prioritize warehouses for online orders while keeping stores for walk-in customers.

<Steps>
  <Step title="Create Group 1">
    * **Selector:** Location type
    * **Value:** Warehouse
  </Step>

  <Step title="Create Group 2">
    * **Selector:** Location type
    * **Value:** Store
  </Step>
</Steps>

**Result:** All warehouses get priority 1, all stores get priority 2.

***

### Own locations first, then 3PL

When you work with external fulfillment partners but want to prioritize your own locations.

<Steps>
  <Step title="Tag your locations">
    * Tag your own warehouses with `owned`
    * Tag third-party locations with `3pl`
  </Step>

  <Step title="Create Group 1">
    * **Selector:** Location tag
    * **Value:** `owned`
  </Step>

  <Step title="Create Group 2">
    * **Selector:** Location tag
    * **Value:** `3pl`
  </Step>

  <Step title="Create Group 3">
    * **Selector:** Location type
    * **Value:** Store
  </Step>
</Steps>

**Result:** Your own locations are tried first, then 3PL partners, then stores as last resort.

***

### Fast shipping locations first

Route orders to locations equipped for expedited fulfillment.

<Steps>
  <Step title="Tag fast locations">
    Add the tag `fast-shipping` to locations with expedited capabilities.
  </Step>

  <Step title="Create Group 1">
    * **Selector:** Location tag
    * **Value:** `fast-shipping`
  </Step>

  <Step title="Create Group 2">
    * **Selector:** Location type
    * **Value:** Warehouse
  </Step>

  <Step title="Create Group 3">
    * **Selector:** Location type
    * **Value:** Store
  </Step>
</Steps>

**Result:** Fast-shipping locations get priority regardless of whether they're warehouses or stores.

***

### Preserve specialty equipment

Keep locations with special capabilities (like engraving) available for orders that actually need them.

<Steps>
  <Step title="Tag locations">
    * Tag standard locations with `standard`
    * Tag specialty locations with `engravable`
  </Step>

  <Step title="Create groups in this order">
    1. **Group 1:** Tag = `standard`
    2. **Group 2:** Type = Warehouse
    3. **Group 3:** Type = Store
    4. **Group 4:** Tag = `engravable`
  </Step>
</Steps>

**Result:** Engravable locations are tried last for regular orders, keeping them available for orders that need engraving.

<Tip>
  Combine this with a [Product Constraint Rule](/constraints/product-rules) to ensure engravable products can ONLY be fulfilled from engravable locations.
</Tip>

## What happens when...

<AccordionGroup>
  <Accordion title="A location doesn't match any group">
    It remains available for fulfillment but gets the lowest priority. It will only be used after all grouped locations are tried.
  </Accordion>

  <Accordion title="A group matches no locations">
    The system simply skips to the next group. No errors occur.
  </Accordion>

  <Accordion title="An order has multiple products">
    Each product is evaluated separately. A customer ordering three items might have:

    * Item 1 → Fulfilled from a warehouse
    * Item 2 → Fulfilled from a store (if warehouse is out of stock)
    * Item 3 → Fulfilled from a different location

    Your ranking preferences guide each decision based on where each product is available.
  </Accordion>

  <Accordion title="Constraints block some locations">
    Fulfillment constraints are applied **before** routing rules. Rankings only apply to locations that remain eligible after constraints are applied.

    If a constraint excludes all stores for fragile items, your ranking rule won't override that—stores simply won't be considered.
  </Accordion>
</AccordionGroup>

## Best practices

<CardGroup cols={2}>
  <Card title="Start simple" icon="play">
    Begin with basic type-based ranking (warehouses vs stores) and add complexity only when needed.
  </Card>

  <Card title="Use meaningful tags" icon="tags">
    Create descriptive tags like `next-day-capable`, `heavy-items`, `fragile-handling` instead of `loc1` or `groupA`.
  </Card>

  <Card title="Plan for growth" icon="chart-line">
    Design your tag structure to accommodate future locations without major reconfiguration.
  </Card>

  <Card title="Test thoroughly" icon="flask">
    Place test orders to verify locations are selected in the expected priority order.
  </Card>
</CardGroup>

## Limitations

| Category                | Limits                              |
| ----------------------- | ----------------------------------- |
| **Groups**              | Maximum 10 per configuration        |
| **Selectors per group** | Maximum 5                           |
| **Manual locations**    | Maximum 100 total across all groups |
| **Tags per selector**   | Maximum 10                          |

<AccordionGroup>
  <Accordion title="What you can't do">
    * Combine type AND tag in a single selector (e.g., "warehouses with express tag")
    * Use negative conditions (e.g., "locations WITHOUT a specific tag")
    * Create different rankings for different products within this rule
    * Override hard constraints from Fulfillment Constraint rules
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Orders not routing to expected locations">
    **Check:**

    1. Is the rule **enabled**?
    2. Do the expected locations have stock for the ordered products?
    3. Are there constraint rules blocking those locations?
    4. Is the rule placed correctly in the routing order? (Earlier rules have higher priority)
  </Accordion>

  <Accordion title="Locations not matching groups">
    **Check:**

    1. For type-based selectors: Is the [location type](/locations/types) set correctly?
    2. For tag-based selectors: Are the [tags](/locations/tags) spelled exactly right (case-sensitive)?
    3. For AND logic (multiple tags): Does the location have ALL the required tags?
  </Accordion>

  <Accordion title="Wrong priority assigned">
    Remember: locations match the **first** group they qualify for. If a warehouse is tagged `vip` and you have:

    * Group 1: `vip` tag
    * Group 2: Warehouses

    The warehouse gets Group 1 priority, not Group 2. Reorder your groups if needed.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Customer Rules" icon="user" href="/order-routing/customer-rules">
    Prioritize locations based on who is buying
  </Card>

  <Card title="Inventory Rules" icon="warehouse" href="/order-routing/inventory-rules">
    Prioritize locations with more stock
  </Card>

  <Card title="Location Types" icon="building" href="/locations/types">
    Set up Warehouse vs Store types
  </Card>

  <Card title="Location Tags" icon="tags" href="/locations/tags">
    Create tags for flexible grouping
  </Card>
</CardGroup>
