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

# Shipping automation and carrier selection rules

> Set feasibility and automation rules that pick a carrier for each order by cost, delivery performance, your own ranking or a volume split, and test them first.

> [!NOTE]
>
> **Where to find it:** Settings → Advanced → Shipping Automation — [Open in OTO ↗](https://app.tryoto.com/shipping-automation)

Shipping automation is the rules engine that picks the carrier. [Order routing](https://docs.tryoto.com/modules/omnichannel-oms/order-routing.md) decides *where* an order is fulfilled from; this decides *who carries it* — and on a few hundred shipments a day it is the difference between a shipping bill that reflects deliberate choices and one that reflects whoever happened to be selected.

## How it works

The engine runs in two passes, and the page has a tab for each.

| Pass | Tab | Question it answers |
| - | - | - |
| **1. Eligibility** | **Delivery Company Feasibilities** | *Which carriers are allowed to take this order at all?* |
| **2. Selection** | **Automation Rules** | *Of the carriers still standing, which one gets it?* |

Keeping these separate is what makes the system tractable. Eligibility is a statement about capability and policy — this carrier does not handle temperature-controlled goods, that one is not to be used for orders over a certain value. Selection is a statement about preference — among those that can, use the cheapest, or the one that meets its SLA most reliably. Mixing the two into a single list of rules is how automation setups become unmaintainable.

## Pass 2 — automation rules

Taking selection first, because it is where most people start. Each rule matches a set of orders and says how to choose among the carriers that survived pass 1.

![The Automation Rules tab](https://mintcdn.com/oto/YkJay8Y-1RDv8ciw/images/auto-1-rules-list.png?fit=max\&auto=format\&n=YkJay8Y-1RDv8ciw\&q=85\&s=9c9de05c2a722927726257f2aa154299)

Fig. 1 — A real rule set, organized by market and carrier. The Orders column counts what each rule has actually handled — the fastest way to spot a rule that never fires, or one swallowing more than it should.

| Column | What it tells you |
| - | - |
| **ID** | The rule's identifier. |
| **Orders** | How many orders this rule has taken. A rule sitting at zero is either redundant or shadowed by one above it. |
| **Rule Name** | Worth writing as a statement of intent. *Morocco ORders* and *ShipStation USA orders* say what they are for; *Rule 4* does not. |
| **Partner Type** | **OTO Rates** or **Own Rates**. |
| **Method** | How the rule chooses. See below. |
| **Data Period** | The KPI history window, for performance-based methods only. |
| **Status** | **Active**, **Test Mode** or **Inactive**. |

### Building a rule

**Add OTOmation Rule** takes a **Rule Name**, a **Status**, a **Partner Type**, the **Conditions** that decide which orders it applies to, a **Method**, and a **Switch to next carrier on failure** toggle.

**Partner Type** is **OTO Rates** or **Own Rates** — which commercial model this rule selects within. A rule works inside one of the two, not across both.

### Rule conditions

Nearly fifty condition types are available, which is what lets a rule be specific enough to be safe. They fall into groups:

| Group | Condition types |
| - | - |
| **Geography** | Origin and Destination **Country · State · Governorate · City · City Group** · **If destination is in these Areas** · **If origin city and destination city is same** · **If origin and destination country are the same** · **Driving Distance** |
| **The parcel** | Package Size · Items Quantity · Shipment Weight · Boxes Count · Temperature Control · Shipment Type |
| **The money** | Order value · COD Value (in the order's currency) · Payment Types · Shipping Fee |
| **The goods** | Brands · Category · Category ID · SKU · Order Tags |
| **Origin location** | If Order is fulfilled from Branch / from Warehouse, and the plural forms for a set of them · Store Name |
| **Timing** | Day of Week · Shipment Creation From Time / To Time · **Time Since Creation** · Has Delivery Time Slot · Has Delivery Date Slot · Within Delivery Time Slot |
| **Fleet** | Driver Task · Driver Available |
| **Reference fields** | Order ID · Shipping Description · Ref 1 · Ref 2 · Ref 3 · Salla Shipping Route ID |

> [!TIP]
>
> **Order Tags as a condition**
>
> Tags applied during [pre-fulfillment](https://docs.tryoto.com/modules/omnichannel-oms/prefulfillment.md) are available here as a condition. That is the clean way to get a business rule that has nothing to do with geography or weight — a fragile-goods policy, a VIP customer policy — into carrier selection: tag it upstream, select on the tag here.

> [!NOTE]
>
> **City Group**
>
> **Origin City Group** and **Destination City Group** refer to named sets of cities defined at **Settings → Advanced → Areas → City Group**. Define the group once and a dozen rules can reference it, instead of each carrying its own list of cities to be kept in step.

### Selection methods

Eight methods, in three families.

![The eight selection methods](https://mintcdn.com/oto/ft-bRlLvOnJkbVoC/images/auto-2-method-list.png?fit=max\&auto=format\&n=ft-bRlLvOnJkbVoC\&q=85\&s=876b4a12ec9f352bb7af46a4960866a4)

Fig. 2 — The Method list open on a rule. Switch to next carrier on failure sits alongside it.

| Method | How it chooses |
| - | - |
| **You decide** | |
| **Manual Selection** | You give an explicit order of preference. The rule opens an **Actions** table of **Rank** and **Delivery Company** — rank 1 is tried first, then rank 2, and so on. |
| **Least Cost Selection** | The cheapest feasible carrier, using the contract prices configured in [Carrier integration](https://docs.tryoto.com/modules/shipping-management/carrier-integration.md). Only as good as the prices you entered. |
| **Performance decides** — each scores carriers on measured history | |
| **Delivery Rate** | Who actually completes deliveries most often. |
| **SLA Met** | Who most often delivers within the SLA they promised. |
| **Delivery Time** | Who is fastest in practice, rather than fastest on paper. |
| **Customer Rating** | Who your customers rate highest, from the feedback collected by [Customer Notification](https://docs.tryoto.com/modules/customer-notification/overview.md). The same score shown on the carrier options list at [shipment creation](https://docs.tryoto.com/modules/shipping-management/shipping-and-tracking.md). |
| **Share the volume** | |
| **Distribute Equally** | Spreads orders evenly across the feasible carriers. |
| **Distribute by Percentage** | An explicit split you set per carrier. |

Choosing **Manual Selection** or **Distribute by Percentage** reveals an **Actions** table where the carriers and their ranks or shares are set.

![Distribute by Percentage](https://mintcdn.com/oto/ft-bRlLvOnJkbVoC/images/auto-3-distribute-percentage.png?fit=max\&auto=format\&n=ft-bRlLvOnJkbVoC\&q=85\&s=4d5a0eb1fc6e13bddc270055f0652054)

Fig. 3 — A 60/40 split between two carriers. This is where a volume commitment negotiated in a contract becomes something the system actually honours, order by order.

> [!TIP]
>
> **Why a percentage split matters commercially**
>
> Carrier contracts frequently come with volume tiers. A split that drifts is a discount lost at the next renegotiation — and drift is exactly what happens when the choice is made by hand, shipment by shipment.

#### Data Period

Choose any of the four performance methods and a **Data Period** field appears, measured in **months**. It is the window of history the score is computed over, and it is a real decision rather than a formality: a short window reacts quickly to a carrier that has started failing, a long one is harder to skew with a bad fortnight. It shows as a column on the rule list, so you can see at a glance which rules are judging on what.

### Different methods for different orders

One method per rule — which is exactly why you write several rules. Least cost for standard domestic orders, best SLA for anything with a delivery slot, a fixed percentage split for the carrier you have a volume commitment with. **Sort Rules** sets the order they are evaluated in, and the first rule whose conditions match is the one that decides.

> [!WARNING]
>
> **Order matters**
>
> Because the first match wins, a broad rule sitting above a narrow one will swallow the narrow one's orders and it will never fire. Put the specific rules first and the catch-all last — and use the **Orders** column to check: a rule stuck at zero is usually one that has been shadowed.

### Failure handling

**Switch to next carrier on failure**, on each rule, keeps an order moving when a booking fails: instead of stopping, the engine moves to the next candidate. Without it a carrier's API outage becomes a queue of unshipped orders that someone has to notice.

## Pass 1 — feasibility rules

On the **Delivery Company Feasibilities** tab, each rule names one connected carrier and says what to do with it under given conditions. The list is typically longer than the rule list, because it has one or more entries per carrier.

![The Delivery Company Feasibilities tab](https://mintcdn.com/oto/ft-bRlLvOnJkbVoC/images/auto-4-feasibility-list.png?fit=max\&auto=format\&n=ft-bRlLvOnJkbVoC\&q=85\&s=5450ee9a087ee11c9a38d883d3aa70b3)

Fig. 4 — One rule per carrier connection, each with its Action and Status. Note there is no Sort Rules here — ordering applies to selection, not eligibility.

| Field | What it does |
| - | - |
| **Delivery Company** | The connection this rule applies to. Your own fleet appears here too, so an OTO FLEX connection competes with carriers under the same rules. |
| **Status** | **Active**, **Test Mode** or **Inactive**. |
| **Action Type** | **Assign Only** — use this carrier *only* when the conditions match. **Do not Assign** — exclude this carrier when they match. |
| **Daily Capacity** | A cap on how many orders this rule will hand the carrier in a day. This is the rule-level limit; the per-city limit lives on [City Coverage](https://docs.tryoto.com/modules/shipping-management/carrier-integration.md). |
| **Conditions** | `IF` rows of **Condition Type / Operator / Value**, added with **Add New Row**. **Add Condition Group** nests a set of them, so a rule can express *this and that, or the other thing* rather than one flat list. |

![Add Feasibility Rule](https://mintcdn.com/oto/YkJay8Y-1RDv8ciw/images/auto-5-add-feasibility.png?fit=max\&auto=format\&n=YkJay8Y-1RDv8ciw\&q=85\&s=8d6c6a031eafc518a3246a234ad0761c)

Fig. 5 — Add Condition Group is the capability worth noticing — it is available here and not on automation rules, so genuinely nested eligibility logic belongs on this tab.

> [!TIP]
>
> **Two ways to say the same thing**
>
> **Assign Only** and **Do not Assign** can often express the same policy from opposite directions. Prefer whichever produces fewer rules: a carrier that should handle one narrow case is an *Assign Only*; a carrier that should handle everything except one case is a *Do not Assign*.

## Testing before you trust it

Two mechanisms, and they answer different questions.

**Test Mode** is a rule status. The rule is evaluated and its result recorded, but it does not act — so a new rule can run alongside the live ones for a week and be judged on what it *would* have done.

**Automation Test** takes a real **Order Number** and shows every rule's verdict on it, numbered in evaluation order. Each result gives the **Rule Name**, the **Assignment Priority Method**, the rule's **Status** and a **Test Result**, and expands for the detail. A **Reverse Shipment** toggle runs the same test for the return leg, since returns are routed by these rules too.

![Automation Test](https://mintcdn.com/oto/YkJay8Y-1RDv8ciw/images/auto-6-automation-test.png?fit=max\&auto=format\&n=YkJay8Y-1RDv8ciw\&q=85\&s=7788f7758d813c2a76e4306ca3c4734a)

Fig. 6 — Two rules rejected the order, the third took it. Both rejections read “No eligible carriers matched the rule conditions”.

> [!TIP]
>
> **Read that error carefully — it is the two passes talking**
>
> *“No eligible carriers matched the rule conditions”* does not mean the rule ignored the order. It means the rule **claimed** it and then found nothing left to give it to — every candidate had been ruled out in pass 1, by a feasibility rule, by coverage, or by a daily capacity already spent.
>
> So when a rule mysteriously does nothing, the fix is usually on the **Feasibilities** tab or in [City Coverage](https://docs.tryoto.com/modules/shipping-management/carrier-integration.md), not in the rule you are looking at.

> [!TIP]
>
> **Test the order you are arguing about**
>
> When a shipment went to the wrong carrier, Automation Test on that order number is the fastest answer — it shows which rule claimed it, which is usually a broad rule sitting too high in the list.

## Related

* [Carrier integration](https://docs.tryoto.com/modules/shipping-management/carrier-integration.md) — contract prices, SLAs, coverage and capacity. Everything this engine weighs is configured there.
* [Order routing](https://docs.tryoto.com/modules/omnichannel-oms/order-routing.md) — the sibling engine that chooses the fulfilling location. Same shape, earlier in the order's life.
* [OTO FLEX](https://docs.tryoto.com/modules/oto-flex/overview.md) — your own drivers, competing with carriers in these same rules.
* [Return automation](https://docs.tryoto.com/modules/return-management/return-automation.md) — reverse shipments are selected by this engine too.
* [Invoice reconciliation](https://docs.tryoto.com/modules/shipping-management/shipping-invoices-reconciliation.md) — checks afterwards whether the cheapest carrier actually billed as the cheapest.


## Related topics

- [Core concepts: orders, shipments, stock and hubs](https://docs.tryoto.com/get-started/core-concepts.md)
- [Return automation rules](https://docs.tryoto.com/modules/return-management/return-automation.md)
- [Shipping Management](https://docs.tryoto.com/modules/shipping-management/overview.md)


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