Determining Which Algorithm to Apply to an Order

Connect orders to algorithms based on ship city using Matching rules, understand rule order and the default algorithm, try with an order, and publish the draft; step-by-step guide and video.

Matching rules determine which algorithm runs on which order. On the OMS – Order Management › Matching rules screen, you read the order of rules, try which rule matches an order, and add new rules. This page explains the screen step by step; the same explanation is available as a video below.

<video controls preload="metadata" playsinline width="1920" height="1080" poster="https://files.docs.hebiar.com/videos/console/oms/matching-rules/eslestirme-kurallari.en.jpg" src="https://files.docs.hebiar.com/videos/console/oms/matching-rules/eslestirme-kurallari.en.mp4"><a href="https://files.docs.hebiar.com/videos/console/oms/matching-rules/eslestirme-kurallari.en.mp4">Open the video</a></video>

For all areas of the screen, see Matching rules. Algorithms linked to rules are explained on the Algorithms: weights, multipliers, and draft page, and testing rules on real orders is described on the Testing with Simulator page.

Before you start

  • On the Algorithms screen, you prepare algorithms with different priorities; matching rules link them to orders. Example: for orders with ship city Istanbul, run the Istanbul-specific algorithm.
  • Rules are tested from top to bottom; the first matching rule is applied.
  • If no rule matches, the bottom All other orders row, i.e. the Default algorithm, runs. This row is not a rule and cannot be removed.
  • Currently, the rule type running on orders is the ship city rule. Conditions for sales channel, customer segment (e.g., VIP customers), and date range are saved but currently marked with the Soon label and do not run on orders.
  • Adding, editing, and publishing rules require write permission.

Reading the rules

  1. Open the Matching rules screen. Each row is in the format "if … then → algorithm"; city algorithms have the City label next to them.
  2. The publication status is shown at the top: City rules are published and the last publication (version, date, person) of the default algorithm.
  3. If you have multiple rules, change their order with the up/down arrows on the row and click Save order. Unsaved order applies only on that screen.
  4. The How does it work? button lists how rules are applied and their limits: ship city rules are written as conditions in the default algorithm’s row and package formula; no OMS change is needed.

Testing with an order

  1. In the Try with an order panel on the right, select Ship city, Sales channel, and Order date.
  2. The Result box shows which algorithm will run. For example, if you select a city without a defined rule, it says "No rule matched; default algorithm runs." If you select a city with a defined rule, it shows "1st rule matched" and the algorithm to run.
  3. Below, it lists how rules were tested in order (Matched, No match, Not needed).

Adding a new rule

  1. Click Add rule; the New rule section opens at the bottom of the list.
  2. In the if field, select the condition: Ship city, Sales channel, or Customer segment (coming soon).
  3. Type in the Search city box and select cities. You can add multiple cities to the same rule.
  4. For a second condition, click Add AND condition; the rule runs only if all conditions match.
  5. Select the algorithm from the Algorithm to run list. If there is no city-specific algorithm, create it in the Settings wizard.
  6. Choose Validity as Always or Date range (e.g., a campaign period). Date range rules are saved but currently do not run.
  7. Click Save rule or close with Cancel.

Clicking Save rule adds the rule to the list but it does not run on orders immediately; it must be published to take effect.

Draft and publishing

  1. If the saved rule list differs from the published formula, a warning and Prepare to publish button appear at the top.
  2. In the window opened by Prepare to publish, compare the draft with sample orders. Select open orders going to cities in the rules; results for other cities do not change.
  3. Publishing writes the city rules into the default algorithm’s formula and creates a new version. The version number is system-wide; see Algorithms.
  4. The publication takes effect on every server within 60 minutes at the latest.

You can also test saved but unpublished rules on real orders by selecting them on the B side of the Simulator screen.

Checking the result

  • If City rules are published is shown at the top, the list matches the published formula.
  • In the Try with an order panel, select the relevant city and check that the correct algorithm appears in the Result box.

Common situations

  • Symptom: I saved the rule but it does not run on orders. The rule list has not been published. Compare and publish with Prepare to publish.
  • Symptom: The rule shows "Soon." Rules containing sales channel, customer segment, or date range are saved but do not run yet.
  • Symptom: The bottom rule does not apply to any order. The same cities exist in an upper rule; the first matching rule is applied. Change the order or combine cities in one rule.
  • Symptom: I cannot delete the "All other orders" row. This row is not a rule; the default algorithm runs for orders that do not match any rule.