Use the Rules Engine feature to set maximum purchase limits on B2B accounts. Limits can be made based on specific products, product types, static categories, or attributes in addition to a specific B2B account or customer segment.
Purchase Limit Behavior
This feature requires holding B2B orders in a Pending Shipment state for a period of time before being "released" for fulfillment. Orders are validated against your configured purchase limits at the time of release. If an order is placed that surpasses the allowed limit, then the excess item quantity will be cancelled when orders are released for fulfillment.
Examples:
- If B2B Account = Walmart and Product = Shirt, then there is a maximum quantity of 150 per order.
- If B2B Segment = VIP and Product Category = Apparel, then there is a maximum quantity of 250 per order.
OMS-Only implementations require a catalog in order to use this feature. An Item Cancelled notification will be sent to the customer if enabled in your order email settings.
Enable Order Rules
To enable B2B order release based on your rules:
- Go to System > Settings > General > Site.
- Scroll down to Fulfillment Settings and toggle on Enable configurable shipment release. This is what allows orders to be held in the Pending Shipment state before being released for fulfillment.
- Enter an integer between 1-7200 in Release orders _ mins after order submit. This is required whenever configurable shipment release is enabled.
- Ensure that Reserve inventory when order status is PendingShipment is disabled, otherwise B2B order rules will not be available.
- Enable B2B Order Rules.
- Select whether you want to Manually release orders (the default behavior that requires Admin users to initiate release of orders for fulfillment) or Automatically release orders every _ mins and enter a value (in which orders will be released for fulfillment at the configured interval). This will be the method in which orders are released based on rules. Any orders that are not released as part of B2B Order Rules will be released according to the Release orders _ mins after order submit setting instead.
- Click Save.
Enabling B2B Order Rules also allows you to determine the order in which B2B orders are released based on account priority. This is not required, but may be configured if you want to further fine-tune your B2B fulfillment process.
Configure Purchase Limit Rules
To configure a purchase limit rule:
- Go to Main > Orders > Purchase Limit Rules.
- Select a Site to view its existing rules.
- If you choose to create a new rule, clicking the button directly will create a rule for the current site. Expand the drop-down menu on the Create button to select a different site instead.
- When creating return rules via this UI, a rule can only be applied to one site. If you want to assign a rule to multiple sites, create or update it via the Rule APIs instead. The API documentation will be updated with these endpoints soon.
- Click Create Purchase Limit Rule or click an existing rule in the table.
- If you choose to create a new rule, clicking the button directly will create a rule for the current site. Expand the drop-down menu on the Create button to select a different site instead.
- Enter a Code. If not provided, the system will generate one automatically.
- Enter a Name.
- Enter an optional Description.
- Select or create at least one product rule or customer rule.
- Product rules can be based on product type, code, variant, static category, attribute, and some other first class fields.
- Customer rules can be based on either a customer account or customer segment. If neither is provided, the rule will apply to all customers and customer segments.
- Product and customer rules cannot be shared across rule types. This means that only those that were created as part of purchase limit rules will be available here.
- Enter the Max Quantity that can be purchased.
- Click Save.
- Once a purchase limit rule is created, it is assigned the lowest rank. You can change this on the dashboard shown below.
Manage Purchase Limit Rules
The dashboard at Main > Orders > Purchase Limit Rules displays all existing rules and allows you to manage them with the below actions:
- Toggle the Status icon on a specific rule to activate or deactivate it.
- Expand the actions menu on a specific rule to Edit or Delete it.
- Check multiple rules and then use the Actions menu in the top right to delete, enable, or disable them.
- Edit the Rank of a rule or click and drag it to reorder them. When the rules are run, they will always be applied in order of the highest to lowest rank (with 1 being the highest rank).
- Ranks are unique per rule across all sites in the master catalog. This means that if a rule is ranked #1 and only assigned to one site, then all other sites will not display a rule in the #1 rank position. If that rule is assigned to multiple sites, it will be ranked #1 on each assigned site and the sites it is not assigned to will not display a rule in the #1 position. If a rule needs to have a different rank on two different sites, then it should be created twice and a different unique rank should be assigned to each.
- Click Test Rule to open a sidebar and enter a product with a customer or customer segment. The system will evaluate which rule affects that case and display it with its rank and maximum quantity, as well as a link to view or update the rule configurations.
Internal-Only Note: Ranking Example
As rule ranking may be confusing in how it works across sites, here is a more detailed example. Recall that rules can only be assigned to multiple sites if they are created or updated via the API (instead of the UI, which is limited to assigning one site to a rule).
- Rule One is assigned to Rank #1 and Sites A and B
- Rule Two is assigned to Rank #2 and Site A
- Rule Three is assigned to Rank #3 and Sites B and C
- Rule Four is assigned to Rank #4 and Sites A and B
- Rule Five is assigned to Rank #5 on Site C
The rules will then be displayed on each site as follows.
- Site A:
- Rank #1: Rule One
- Rank #2: Rule Two
- Rank #4: Rule Four
- This site will not have any rule in Rank #3 or #5 position.
- Site B:
- Rank #1: Rule One.
- Rank #3: Rule Three.
- Rank #4: Rule Four.
- This site will not have any rule in Rank #2 or #5 position.
- Site C:
- Rank #3: Rule Three
- Rank #5: Rule Five
- This site will not have any rule in Rank #1, #2, or #4 position.
If a rule is moved to a higher rank (such as if Rule Four was moved to Rank #1 on Site A ) or a new rule is added for a rank, then existing rules across all sites will be resequenced. This means that affected rules will be moved down a rank to make room. For instance, the results of the given move would be:
- Site A:
- Rank #1: Rule Four
- Rank #2: Rule One
- Rank #3: Rule Two
- This site will not have any rule in Rank #4 or #5 position.
- Site B:
- Rank #1: Rule Four
- Rank #2: Rule One
- Rank #4: Rule Three
- This site will not have any rule in Rank #3 or #5 position.
- Site C:
- Rank #4: Rule Three
- Rank #5: Rule Five
- This site will not have any rule in #1, #2, or #3 position. Rule Five did not have to be change position because only the rules between the new rank and the old rank are affected by a move.