User Manual
Help Center/User Manual/Routing engine: let the order pick its own warehouse

Routing engine: let the order pick its own warehouse

Last updated 2026-10-15

When you allocate or submit an order, the engine resolves the warehouse automatically: custom rules, zip zones, inventory awareness, split fulfillment, cost and SLA. Preview it before you commit.

When you allocate or submit an order (draft → allocated), you no longer have to pick a warehouse by hand. The routing engine decides for you: which warehouse should fulfill this order, and why. The reason is written to the order’s audit note, so you can always look up what the engine chose and why.

The decision order: four layers#

  1. Custom rules first: rules are tried from the lowest priority number up. The first active rule whose conditions ALL match wins. Conditions can use channel, item quantity, carrier, shipping service, and customer tier.
  2. If no rule matches, one of three exclusive strategies applies (only one can be on at a time): Assign warehouse by Zip Code (按邮编分配仓库) — the ship-to postal code falls in a configured zone; Stay within the Destination Market (不出目的市场) — pick a warehouse in the same country as the delivery address; Ship from the Closest Location (就近发货) — pick the warehouse nearest to the delivery address.
  3. Inventory awareness: the engine checks available stock at each candidate warehouse (standalone mode reads OMS inventory; wms_sync mode reads the WMS balance). The first warehouse that can cover every line wins; if none can, the warehouse with the least total shortage is picked.
  4. Fallback: the highest-priority warehouse (lowest priority number).

Where to configure: the Sales Order Routing page#

  • Open the Sales Order Routing page (销售订单路由). Everything lives here: General Rules (通用规则), Zip Code Zones (邮编区间), Customized Routing Rules (自定义路由规则), Insufficient inventory handling (库存不足处理), Backorder strategy (缺货订单策略), and Cost & SLA Routing (成本与时效路由).
  • Customized Routing Rules: Add New Rule (新增规则) — name the rule, set priority (smaller number = tried earlier), and pick conditions: channel, item qty (=, >, <), carrier, shipping service, customer tier. You can deactivate a rule without deleting it.
  • Zip Code Zones: Add New Zone (新增区间) — set Zip From / Zip To and the warehouse. If a postal code matches multiple zones, the zone with the smallest priority wins.
  • Warehouse priority (仓库优先级) is maintained on the warehouse form in master data: the smaller the number, the earlier it is chosen. The default is 100.

When stock is short: exception vs backorder#

  • Insufficient inventory handling (库存不足处理), option "Exception": the order is parked with status Exception (异常) and not allocated. The shortage detail (SKU / ordered / available / gap) is written to the audit note. Fix it — wait for stock or switch warehouse — then move the order back to draft or confirmed.
  • Option "highest-priority warehouse": the engine switches to the highest-priority candidate that has everything in stock. If no candidate is fully stocked, your backorder strategy below takes over.
  • Backorder strategy (缺货订单策略) "Ship available lines first; short lines are marked as backordered." (有货的行先发货,缺货的行标记为缺货待发。) — the default: in-stock lines are allocated now, short lines are recorded as backorder.
  • Or "Hold the whole order until all lines are in stock, then allocate." (整单等货齐后再分配,不先发部分。) — the order stays draft / confirmed with the reason in the audit log, and nothing ships early.
Before you allocate, draft and confirmed orders without a warehouse show a Routing preview (路由试算) button. It runs the full engine — including the inventory check — and writes nothing. The modal shows the winning warehouse, the rule that matched, the strategy, the customer tier, any shortages, the estimated shipping cost, and whether the SLA is met. Allocate to apply it.
Routing decision flow: rule order → warehouse resolution → inventory check → shortage branches → split/merge → confirmed route.

Split fulfillment: one order, several warehouses#

  • Allow Split Fulfillment (允许拆单履约) is on by default. When the engine-picked main warehouse cannot cover all lines, the order is split by line: each line goes to the first stocked warehouse in candidate order. (If you chose the "Exception" or "wait full" strategies above, no split happens.)
  • Assign warehouse by product (按产品分配仓库): on the product page, set a Preferred Warehouse (首选仓库) for the product. Those lines always go to that warehouse, whether or not stock is sufficient.
  • Sample products cannot be split (样品不可拆出单独发货): mark a product as a sample (样品) and its lines always stay with the main warehouse; only normal product lines can be split off.
  • The order header keeps the warehouse that covers the most lines; the audit note lists every line’s warehouse (SKU × qty → warehouse) so you can see exactly who ships what.

Merge orders and split by item#

  • Merge Rule Settings (合单规则): turn the switch on, and the orders list gains a batch action Merge orders (合并订单). Select at least 2 orders → Merge preview (合单预览) shows which groups can merge and why the rest cannot (same merchant, same channel, same ship-to address, all in draft or confirmed). Confirm merge (确认合并) moves all lines into the earliest order; the source orders are cancelled as merged.
  • One item per Order (一单只含一件商品): turn it on, and a draft order with 2+ lines shows a Split by item (按商品拆单) button. Each line becomes its own new order (discount, shipping fee and tax are split by line amount); the original order is cancelled.

Customer tier routing: your best merchants first#

  • The merchant page has a Customer Tier (客户等级) column and dropdown: Standard (标准) / Silver (银卡) / Gold (金卡) / Platinum (白金卡). Anything blank or invalid counts as Standard.
  • Custom rule conditions can include Customer Tier (客户等级): a rule only matches orders from that tier. For example, route every Platinum merchant to your priority warehouse regardless of zip code.

Cost and SLA routing#

  • Route by Lowest Cost (按成本路由): among fully-stocked candidates, pick the cheapest "warehouse + carrier" combo by estimated shipping cost. Rates are currently estimated — marked as "estimated" everywhere — and switch automatically once the real rate API is connected.
  • Route by Delivery SLA (按时效路由): uses the order’s required ship date. It estimates transit days per warehouse by distance and picks the cheapest warehouse that can still deliver on time. If none can make it, the fastest warehouse is picked and the audit note says so.
  • Both switches on: SLA first, then cost — warehouses that can deliver on time are filtered first, then the cheapest of those wins.
A warehouse you pick by hand always wins: if you set the warehouse on the order yourself, the engine stays out of the way. (If your tenant has only one warehouse, the picker hides itself and that warehouse is used automatically.) Every routing decision — which warehouse, which rule, and why — is saved to the audit log, so nothing is a black box.