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

# Capacity Rules

> Automatically prioritize locations with the most available fulfillment capacity

Capacity rules automatically prioritize locations based on **how much fulfillment capacity they have left**. Locations with more remaining capacity are ranked higher, helping balance workload and prevent overloading busy locations.

<Info>
  This is a "set it and forget it" rule. Once enabled, it automatically ranks locations by remaining capacity—no configuration needed in the routing settings.
</Info>

## How capacity rules work

Capacity is based on **daily order limits** you set for each location. Charlie tracks orders in real-time and calculates remaining capacity:

```
Remaining capacity = Daily order limit - Orders allocated today
```

Locations with more remaining capacity get higher priority.

```mermaid theme={"system"}
flowchart TD
    A[Order placed] --> B[Check remaining capacity<br/>at each location]
    B --> C[Rank locations by<br/>remaining capacity]
    C --> D[Store A: 45/50 remaining → Rank 1]
    C --> E[Warehouse: 20/100 remaining → Rank 2]
    C --> F[Store B: 5/30 remaining → Rank 3]
    D --> G[Try Store A first]
```

<Note>
  Daily order counts reset automatically at midnight. Each day starts fresh with full capacity at all locations.
</Note>

## Setup overview

Capacity rules require two steps:

1. **Configure daily order limits** for each location (in Charlie)
2. **Enable the Capacity Rules** routing rule (in Shopify Order Routing)

## Step 1: Configure daily order limits

Daily order limits are configured per location in the Charlie app.

<Steps>
  <Step title="Open a location">
    Go to **Charlie → Locations** and select the location you want to configure.
  </Step>

  <Step title="Navigate to Shipping settings">
    Click on the **Shipping** tab for the location.
  </Step>

  <Step title="Enable daily order limit">
    Toggle **Daily order limit** to enable capacity management for this location.

    <Frame>
      <img src="https://mintcdn.com/charlie-6278c0d1/zIZXpEfAUH7cQkz5/images/order-routing-daily-order-limit.png?fit=max&auto=format&n=zIZXpEfAUH7cQkz5&q=85&s=a774e30a57469a22f37d82e9a33be12b" alt="Daily order limit configuration with order count and capacity mode" width="1480" height="770" data-path="images/order-routing-daily-order-limit.png" />
    </Frame>
  </Step>

  <Step title="Set the limit and mode">
    Configure the capacity settings:

    | Field             | Description                                     |
    | ----------------- | ----------------------------------------------- |
    | **Order limit**   | Maximum orders this location can handle per day |
    | **Capacity mode** | What happens when the limit is reached          |
  </Step>

  <Step title="Repeat for other locations">
    Configure daily order limits for all locations you want to include in capacity-based routing.
  </Step>
</Steps>

### Capacity modes

When a location reaches its daily order limit, you can choose what happens:

| Mode                       | Effect                                                                                                   |
| -------------------------- | -------------------------------------------------------------------------------------------------------- |
| **Prefer other locations** | Orders are routed to other locations with more capacity. This location is deprioritized but not blocked. |
| **Block location**         | This location is completely blocked from receiving new orders until the next day.                        |

<Tip>
  Use **Prefer other locations** for soft capacity management (routing rule behavior). Use **Block location** for hard limits (constraint behavior).
</Tip>

## Step 2: Enable the routing rule

<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 Capacity Rules rule">
    Find Charlie's **Capacity Rules** and add it to your routing strategy.
  </Step>

  <Step title="Enable the rule">
    Toggle the rule to **Enabled**. The rule will use the daily order limits you configured in Charlie.
  </Step>
</Steps>

<Warning>
  The banner in Charlie reminds you: "Add a capacity order routing rule to complete setup." Make sure you enable the routing rule in Shopify after configuring daily limits in Charlie.
</Warning>

## How ranking works

### Real-time capacity tracking

Charlie tracks orders allocated to each location throughout the day:

| Location    | Daily limit | Orders today | Remaining | Rank        |
| ----------- | ----------- | ------------ | --------- | ----------- |
| Warehouse A | 200         | 50           | 150       | 1 (highest) |
| Store Paris | 50          | 10           | 40        | 2           |
| Store Lyon  | 30          | 20           | 10        | 3           |
| Store Nice  | 20          | 18           | 2         | 4 (lowest)  |

### Locations without limits

Locations without a daily order limit configured are treated as having unlimited capacity. They won't be deprioritized by this rule.

### Tie-breaking

When multiple locations have the same remaining capacity, they receive the same rank. Shopify then uses its default logic to choose between them.

## Example scenarios

### Balance load across stores

**Problem:** Your busiest store gets overwhelmed while other stores have spare capacity.

**Setup:**

* Store A (high traffic): Daily limit = 100 orders
* Store B (medium traffic): Daily limit = 50 orders
* Store C (low traffic): Daily limit = 30 orders

**Result:** As Store A fills up, orders automatically shift to Stores B and C, balancing the workload.

***

### Protect warehouse during peak season

**Problem:** During Black Friday, your warehouse reaches capacity early and can't process more orders efficiently.

**Setup:**

* Warehouse: Daily limit = 500 orders, Mode = Prefer other locations
* Stores: Daily limit = 50 orders each

**Result:** Once the warehouse handles 500 orders, new orders prefer stores. The warehouse isn't blocked but is deprioritized.

***

### Strict capacity limits for small stores

**Problem:** Small stores can only process a fixed number of orders per day due to staff constraints.

**Setup:**

* Small stores: Daily limit = 20 orders, Mode = Block location

**Result:** Once a small store reaches 20 orders, it's completely blocked until the next day. Orders are routed to other locations.

## Combining with other rules

Capacity rules work best when combined with other routing rules:

### With Inventory Rules

Balance capacity and inventory together:

1. **Inventory Rules:** Prefer locations with more stock
2. **Capacity Rules:** Among high-stock locations, prefer those with more capacity

**Result:** Orders go to locations that have both the stock and the capacity to fulfill efficiently.

### With Ranked Location Groups

Use capacity as a secondary factor:

1. **Ranked Location Groups:** Warehouses (Group 1) → Stores (Group 2)
2. **Capacity Rules:** Among warehouses, prefer those with more remaining capacity

**Result:** Orders prefer warehouses, and among warehouses, the one with most remaining capacity is chosen.

### With Customer Rules

Protect capacity for specific customer segments:

1. **Customer Rules:** B2B orders → Prefer Warehouse A
2. **Capacity Rules:** Deprioritize locations nearing capacity

**Result:** B2B orders prefer Warehouse A, but if it's near capacity, they shift to other B2B-capable locations.

## Best practices

<CardGroup cols={2}>
  <Card title="Start with realistic limits" icon="calculator">
    Base daily limits on actual fulfillment capacity—staff, equipment, and shipping cutoff times.
  </Card>

  <Card title="Use 'Prefer' for flexibility" icon="shuffle">
    Use "Prefer other locations" mode for most cases. Reserve "Block location" for hard operational constraints.
  </Card>

  <Card title="Monitor and adjust" icon="chart-line">
    Review capacity utilization regularly and adjust limits based on actual performance.
  </Card>

  <Card title="Plan for peak seasons" icon="calendar">
    Increase limits before high-volume periods, or tighten them to protect fulfillment quality.
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Orders not shifting away from busy locations">
    **Check:**

    1. Is the Capacity Rules routing rule **enabled** in Shopify Order Routing?
    2. Is the daily order limit configured for the location in Charlie?
    3. Has the location actually reached its limit? Check current order count.
    4. Is the capacity mode set to "Prefer other locations"?
    5. Are there other routing rules with higher priority overriding capacity rankings?
  </Accordion>

  <Accordion title="Location blocked unexpectedly">
    **Check:**

    1. Is the capacity mode set to "Block location" instead of "Prefer other locations"?
    2. Has the location reached its daily limit?
    3. Remember: counts reset at midnight. Check when the last reset occurred.
  </Accordion>

  <Accordion title="Capacity counts seem wrong">
    **Check:**

    1. Capacity is based on orders **allocated** to the location, not orders placed
    2. Orders may be allocated before payment is confirmed
    3. Cancelled orders may still count toward the daily total (depending on timing)
  </Accordion>

  <Accordion title="Daily limits not resetting">
    Daily limits reset automatically at midnight (based on your store's timezone). If limits aren't resetting:

    1. Check your store's timezone settings in Shopify
    2. Verify Charlie's sync is running correctly
    3. Contact support if the issue persists
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Location Capacity" icon="gauge-high" href="/locations/capacity">
    Configure daily order limits per location
  </Card>

  <Card title="Inventory Rules" icon="warehouse" href="/order-routing/inventory-rules">
    Prioritize by stock availability
  </Card>

  <Card title="Ranked Location Groups" icon="layer-group" href="/order-routing/ranked-location-groups">
    Define primary location preferences
  </Card>
</CardGroup>
