Routing rule kinds
Rules narrow the candidate sites for a line. They run in priority order, lowest first, and the engine stops as soon as one candidate remains — see how routing works.
The gate that always runs first
Stock availability is applied before any rule you add. Sites without enough stock for the line are removed.
It is not in the rule list and cannot be added, reordered or disabled. Every rule below operates on what survives it.
Rules you can add
| Rule | Filters candidates to | Needs configuring |
|---|---|---|
| Closest to destination | Sites in, or nearest by country to, the destination | Nothing |
| Stay in destination country | Sites in the customer's ship-to country | Nothing |
| Ranked sites | The highest-ranked surviving site in an order you set | The site order |
Closest to destination
This does not measure distance. Routing by true distance needs coordinates for each of your sites, which is not yet available, so this rule works at country level.
That makes it close in behaviour to stay in destination country, and the two are easy to confuse. Using both is usually redundant.
Stay in destination country
Filters to sites in the country the order ships to. Useful where shipping across a border carries cost, delay or customs consequences you would rather avoid.
If no site is in the destination country, this rule removes every candidate.
Ranked sites
You put your sites in order; the engine takes the highest-ranked one still standing.
Because it can almost always name a survivor, it is the natural last rule — it settles what the rules above leave open. Placed first it will usually decide everything on its own, and the rules below it will never run.
Disabled rules
A disabled rule is skipped but keeps its configuration, so you can turn one off to see the effect without losing how it was set up.
Ordering
Priority is lowest number first. Put the rules expressing hard commercial requirements — a border you will not ship across — above the ones expressing preferences, because the first rule to narrow to one site ends the evaluation.