---
schema_version: "1"
id: 5cf367e144f66441b4bf0b7564c2695f552d3be431b116c1119512144d3b6779
title: Routing via Rules
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/commerce/264-0-0/om_routing_rules_overview.md
canonical_url: https://help.salesforce.com/s/articleView?id=commerce.om_routing_rules_overview.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a1cfaf47df5b91bf5aa80dd280434b73b2b61e83924451015195b13c93f93314
description: Use rule groups to modify routing logic directly in the Order Management UI instead of using code or Salesforce Flow.
products:
  - Commerce
  - Salesforce Order Management
release: "264"
---
# Routing via Rules

Use rule groups to modify routing logic directly in the Order Management UI instead of using code or Salesforce Flow.

Routing rules require a fully implemented Omnichannel Inventory product.

Rule groups are composed of custom rules and templated rules. Custom rules can filter out locations or select an ideal location by calculating condition-based scores. You can create a custom rule only after you’ve created a rule group.

Templated rules can exclude locations or impact location priority, depending on the rule. There are five templated rules:

- Inventory Availability: Determines whether a location has product inventory. This rule is mandatory for all rule groups.
- Location Proximity: Scores locations based on distances from the customer’s address.
- Markdown Avoidance: Selects locations that risk future price markdowns. To use a markdown avoidance rule, create a markdown avoidance rule in the Markdown Avoidance tab and sync it before adding it to a group.
- Overstock: Prioritizes locations with product quantities that exceed the target inventory level. The higher the overstock amount at a location, the more that location is prioritized. To use the overstock rule, go to Omnichannel Inventory and set a target inventory level for each SKU in your locations.
- Split Optimization: Controls how many locations an order can split to. When enabled, the maximum split number is five.

After adding rules to a group, use start dates, end dates, and weights to refine the routing behavior. Weighted rules score qualifying locations from 0 through 100. The score is compared against the rule's weight, and the routing logic selects the location with the highest adjusted weight.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-om_order_management-264-0-0-production-enus/4c4844e3-a194-4a65-95b7-17291a6dbefa/images/icon_example.png)

Example

For example, a small company recently produced a large number of items for a bulk order that was canceled at the last minute. Because the company already created backflow for the order, this cancellation increases the inventory above its targeted level. The company adds an Overstock rule so that the routing logic prioritizes the overstocked warehouse.

In another example, a mid-sized company created a temporary free shipping sale for the holiday season. They want to prioritize the closest warehouses, to cut down on shipping costs, so they add a Location Proximity rule with a high rule weight.

As a more complex example, a customer places an order that ships to Alaska. The company has two weighted rules, a Location Proximity rule with a weight of 1,000 and a custom rule with a weight of 900 that prioritizes cheaper shipping. Because of the remote location, the closest location scores 10 out of 100. However, due to a direct flight from a further location, the cheapest shipping scores 50. The algorithm compares these weights and scores and selects the cheaper shipping location.

- **[Customize Routing Logic with Rule Groups](https://help.salesforce.com/s/articleView?id=commerce.om_new_rule_group.htm&release=264.0.0&type=5)**  
    Control Order Management routing by creating and publishing groups of templated or custom rules.
- **[Create a Custom Routing Rule](https://help.salesforce.com/s/articleView?id=commerce.om_new_custom_rule.htm&release=264.0.0&type=5)**  
    Custom rules modify routing by selecting locations based on any standard or custom attribute available on Order Management objects. Custom rules can filter out locations or select an ideal location by calculating condition-based scores.
- **[Create a Markdown Avoidance Rule](https://help.salesforce.com/s/articleView?id=commerce.om_create_markdown_avoidance.htm&release=264.0.0&type=5)**  
    A markdown avoidance reduces the risk of products selling at a discounted price by shipping products from locations at risk of future discounts. To implement a markdown avoidance, create a markdown avoidance rule in the Markdown Avoidance tab, sync it, and then add it to a rule group.

#### See Also

- [Commerce Delivery Service and Order Fulfillment](https://help.salesforce.com/s/articleView?id=commerce.om_cds_overview.htm&release=264.0.0&type=5 "Configure fulfillment from start to finish by using Commerce Delivery Service (CDS).")