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

# Steal-For Rules

Steal-For Rules define which still-short Call-Off Orders are eligible to attempt a supply steal and their priority order when competing for the same supply. When the [Reservation Rebalancer](/pages/reservation-rebalancer) determines that free supply cannot fully re-secure a short Call-Off Order, it enters the steal phase. Call-Off Orders matched by a Steal-For Rule become **Seekers** — they are permitted to take reserved supply from eligible Givers, subject to the Ship Date Buffer and the rules configured in [Steal-From Rules](/pages/steal-from-rules).

Seekers are processed in priority order: a Seeker matched by a higher-ranked rule (lower rank number) attempts to recover supply before lower-ranked Seekers. Within a priority tier, the sort configured on the rule determines the order — for example, earliest ship date first.

Steal-For Rules follow the same composable rule structure used across Kibo for other rule types, using expression-based conditions across Account/Customer, Product, and Call-Off Order criteria dimensions.

In addition to the UI detailed here, you can create and manage Steal-For Rules using the Steal-For Rules API endpoints. The [Product Rules](https://docs.kibocommerce.com/api-reference/productrules/create-product-rule) , [Customer Rules](https://docs.kibocommerce.com/api-reference/accountrankingrule/create-customer-rule)  and [**Call Off Order Rule**](https://docs.kibocommerce.com/api-reference/calloffreleaserules/create-call-off-release-rule) APIs can also be used to manage supporting product and customer rules.

## Prerequisites

Before configuring Steal-For Rules, ensure the following:

* The **B2B Wholesale OMS** feature is enabled for your tenant. Contact [Kibo Support](https://help.kibocommerce.com/) to enable this capability.
* The **Reservation Rebalancer** is enabled within the **Inventory Balancing & Reservations** B2B settings under general settings.
* You have **Admin** or **Super Admin** role permissions, or a role with the following behaviors assigned:
  * Product Rule: Read, Create, Update, Delete
  * Customer Rule: Read, Create, Update, Delete
  * Steal-For Rule: Read, Create, Update, Delete

## How Steal-For Rules Work

### Rule Evaluation

All enabled Steal-For Rules run together when the Reservation Rebalancer enters the steal phase. Short Call-Off Orders are evaluated against each rule in ascending rank order — Rank 1 is evaluated first. When a Call-Off Order matches a rule's criteria, that rule assigns it a Seeker priority. **A Call-Off Order is only matched once** — once it qualifies under a rule, it is not re-evaluated against subsequent rules.

Call-Off Orders that do not match any enabled Steal-For Rule are not eligible to steal supply and fall through to the regular Reservations Job.

### Seeker vs. Giver Partition

At the start of the steal phase, the engine determines a fixed partition of all short Call-Off Orders into potential Seekers and potential Givers. A Call-Off Order is either a Seeker or a Giver in a given run — never both. If a Call-Off Order matches both a Steal-For Rule and a Steal-From Rule, it is treated as a Seeker only and removed from the Giver pool.

### Sort and Tiebreaking

Each Steal-For Rule includes a primary and optional secondary sort. For Call-Off Orders that match the same rule, the sort determines their relative processing order within that priority tier. For example, sort by earliest `requestedShipDate` to protect Call-Off Orders with the most imminent delivery commitments first.

### Criteria Matching

A Call-Off Order must satisfy **all** defined criteria types on a rule (AND logic across types) to match. Within a single criteria type, conditions can be combined using AND or OR logic in the expression editor. If a rule defines a simple criteria for a particular type which will match all the call off orders (e.g Total Amount ≥ 1\$), all orders automatically pass that criterion. This makes it straightforward to configure a **catch-all rule** at the lowest rank to ensure every Call-Off Order receives an allocation pass.

<Note>
  **Note:** Steal-For Rules do not include a **Time Fence Days** parameter. The time fence already calculated on the affected Call-Off reservation is used when searching for replacement inventory — no separate time fence configuration is required on the Steal-For Rule itself
</Note>

## Rule Criteria

A Steal-For Rule supports up to three criteria types:

| Criteria Type                   | What It Filters                                                                                                  | Notes                                                                                                                                                                                                                                                                           |
| :------------------------------ | :--------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Account / Customer Criteria** | Which B2B buyer accounts qualify                                                                                 | Uses the existing Customer Rule infrastructure. Supports Customer & Customer Segment.                                                                                                                                                                                           |
| **Product Criteria**            | Which products the rule applies to                                                                               | Uses the existing Product Rule infrastructure  . Supports first-class fields(like-Product Code, Variant Product Code, UPC, Mfg Part Number ,Product Type, Category Code, Category List Price, Fulfilment Types Supported, Height, Length, Weight, Width), attributes properties |
| **Call-Off Order Criteria**     | Call-Off Order header and line-level attributes such as channel, order type, total amount, and custom attributes | Expression-based criteria type specific to B2B Wholesale OMS.  Like Call-Off Order Total Amount, Account ID, Channel Code, Item Product Code, and Item Requested Ship Date, as well as custom Order Attributes (header level) and Item Attributes (line level).                 |

<Note>
  **Note:** Product Rules , Customer Rules and Call off order Rules created for Steal-For Rules are exclusive to Steal-For Rules and cannot be shared with other rule types.
</Note>

## Rule Attributes

| Attribute                   | Type              | Required | Description                                                                                                                                                    |
| :-------------------------- | :---------------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Code**                    | String            | Yes      | Unique identifier for the rule, scoped to the tenant. Auto-generated if left blank.                                                                            |
| **Name**                    | String            | Yes      | Display name shown in the Admin UI.                                                                                                                            |
| **Description**             | String            | No       | Optional free-text description of the rule's intent.                                                                                                           |
| **Rank**                    | Integer           | Yes      | Priority order. Lower value = higher priority. Rank 1 is evaluated before Rank 2. Values must be unique.                                                       |
| **Enabled**                 | Boolean           | Yes      | When disabled, the rule is skipped during rebalancing but remains saved for future use.                                                                        |
| **Primary Sort**            | Field + Direction | Yes      | The field and direction (ascending/descending) used to order matched Seekers within a priority tier. Supports any numeric or date field on the Call-Off Order. |
| **Account Criteria**        | List              | No       | References to Customer Rule codes defining which accounts qualify as Seekers.                                                                                  |
| **Product Criteria**        | List              | No       | References to Product Rule codes defining which products this rule covers.                                                                                     |
| **Call-Off Order Criteria** | List              | No       | References to Call-Off Order Rule codes defining order-level filters.                                                                                          |

## Configure Steal-For Rules

To create a new Steal-For Rule:

1. Go to **Main** > **Supply > Rules** > **Steal-For Rules**.
2. Select a **Site** from the site selector. <img src="https://mintcdn.com/kibocommerce-59e68a4a/RG4NtTb_m8dRsIDp/images/Steal-for-rules-Site-Selector.png?fit=max&auto=format&n=RG4NtTb_m8dRsIDp&q=85&s=8e22d6b1f6384315ff6a3b9ec2a51e02" alt="Steal For Rules Site Selector" title="Steal For Rules Site Selector" width="1907" height="438" data-path="images/Steal-for-rules-Site-Selector.png" />
3. Click **Create Steal-For Rule**.
4. Enter a **Code**. If left blank, the system generates one automatically.
5. Enter a **Name** and an optional **Description**.
6. Toggle the rule **Enabled** to activate it.
7. Configure **Sort Criteria**:
   * Under **Primary Sort**, select a numeric or date field (for example, `requestedShipDate`) and choose **Ascending** or **Descending**.
8. Optionally, add **Account / Customer Criteria**:
   * Click **Add Customer Rule** and use the expression editor to define account-level conditions.
9. Optionally, add **Product Criteria**:
   * Click **Add Product Rule** and use the expression editor to define product-level conditions.
10. Optionally, add **Call-Off Order Criteria**:
    * Click **Add Call-Off Order Rule** and use the expression editor to define order-level conditions.
11. Click **Save**.

<Note>
  **Note:** At least one Rule Criteria is needed for the rule to be saved
</Note>

<img src="https://mintcdn.com/kibocommerce-59e68a4a/RG4NtTb_m8dRsIDp/images/Create-Steal-for-Rule-Form.png?fit=max&auto=format&n=RG4NtTb_m8dRsIDp&q=85&s=3c2a5365073b73d2e68f26a27fd88eca" alt="Create Steal For Rule Form" width="1880" height="895" data-path="images/Create-Steal-for-Rule-Form.png" />

## Manage Steal-For Rules

Access the Steal-For Rules dashboard at **Main** > **Supply> Rules>**  **Steal-For Rules** to manage your configured rules:

* Toggle the **Status** icon on a rule to activate or deactivate it without deleting it. Disabled rules are skipped during batch processing.
* Click on the Kebab icon on a rule to **Edit** or **Delete** it.
* Check multiple rules and then use the **Actions** menu in the top right to enable, disable, or delete them in bulk.
* Edit the **Rank** of a rule directly in the table, or click and drag to reorder. Rules are always evaluated from highest to lowest rank, with Rank 1 running first.

<img src="https://mintcdn.com/kibocommerce-59e68a4a/RG4NtTb_m8dRsIDp/images/Steal-for-rule-list-page.png?fit=max&auto=format&n=RG4NtTb_m8dRsIDp&q=85&s=c572868d26a390e86e70803a7f42cefd" alt="Steal For Rule List Page" width="1917" height="336" data-path="images/Steal-for-rule-list-page.png" />

## Example Rule Configurations

### Prioritize Strategic Accounts for Supply Recovery

Ensure strategic-account Call-Off Orders are the first to attempt stealing supply when they go short:

| Rule   | Rank | Customer Criteria                    | Sort                          | Expected Behavior                                                                 |
| :----- | :--- | :----------------------------------- | :---------------------------- | :-------------------------------------------------------------------------------- |
| Rule 1 | 1    | `account.segment equals "strategic"` | `requestedShipDate` Ascending | Strategic account Seekers with earliest ship dates attempt to steal supply first. |
| Rule 2 | 2    | *(no criteria — catch-all)*          | `requestedShipDate` Ascending | All other short Call-Off Orders attempt to recover in ship-date order.            |

### Prioritize by  Call off Order Value

Allow high-value Call-Off Orders to attempt supply recovery before standard orders:

| Rule   | Rank | Call-Off Order Criteria | Sort                          | Expected Behavior                                       |
| :----- | :--- | :---------------------- | :---------------------------- | :------------------------------------------------------ |
| Rule 1 | 1    | `totalAmount gt 100000` | `requestedShipDate` Ascending | High-value orders attempt recovery first, by ship date. |

### Combined Account and Product Priority

Target strategic accounts placing orders for premium products with the highest Seeker priority:

| Rule   | Rank | Account Criteria                     | Product Criteria                    | Sort                          | Expected Behavior                                                     |
| :----- | :--- | :----------------------------------- | :---------------------------------- | :---------------------------- | :-------------------------------------------------------------------- |
| Rule 1 | 1    | `account.segment equals "strategic"` | `product.category equals "Premium"` | `requestedShipDate` Ascending | Strategic accounts seeking premium product supply are resolved first. |
| Rule 2 | 2    | `account.segment equals "strategic"` | *(none)*                            | `requestedShipDate` Ascending | All other strategic account Seekers next.                             |
