What is it?
Filter rules control which delivery options are shown or hidden in checkout based on conditions like cart weight, item dimensions, order value, product attributes, or postal code. They are applied before contacting carriers, which means ineligible options are removed early — resulting in a faster, cleaner checkout.
Each rule is a conditional expression that evaluates to true (show the option) or false (hide it).
Filter rules can be applied at two levels:
Delivery category — show or hide an entire category (e.g. "Pick-up points")
Carrier product — show or hide a specific carrier within a category
Tip: Filter rules run before carrier API calls. For rules that depend on which carriers actually responded, use Post Filter Rules instead.
Key benefits
Faster checkout — fewer carrier API calls means quicker page loads
Cleaner delivery selection — shoppers only see options that are valid for their order
Flexible logic — combine weight, size, value, attributes, postal codes, and time conditions
Reduce failed deliveries — prevent shoppers from selecting options their order doesn't qualify for
How it works
Shopper reaches checkout
Ingrid evaluates filter rules against the cart contents and delivery address
Delivery options that don't meet the conditions are removed
Only remaining options are sent to carriers for availability checks
Shoppers see a clean, relevant set of delivery choices
Rule Syntax
Filter rules use an expression language entered as free text in the MAD UI. Rules combine functions, operators, and values to create conditions.
Unit Conventions
All values in filter rules follow Ingrid's standard units:
Measurement | Unit | Example |
Weight | Grams (g) | 7000 = 7 kg |
Dimensions | Millimetres (mm) | 600 = 60 cm |
Price / Value | Minor currency units (cents/öre) | 22500 = 225.00 SEK |
Volume | Cubic millimetres (mm³) | 4500 mm³ |
Operators
&& — AND (all conditions must be met)
total_weight <= 30000 && all_cartitems_dims_sum_below(2500) && max_item_length < 1500
|| — OR (at least one condition must be met)
in_range(postal_code(), 55302, 56636) || in_range(postal_code(), 58128, 59077)
Operators can be mixed:
not(contains(cart_items_attributes(), 'Example')) && in_range(postal_code(), 13025, 13025) || in_range(postal_code(), 13033, 13034)
Negation
Two ways to negate a condition:
not() — wraps the condition:
not(in_range(postal_code(), 11120, 12010))
! — prefix before the condition:
!all_cartitems_below_weight(68000)
Negation can create range logic:
all_cartitems_below_weight(68000) && !all_cartitems_below_weight(18000)
This means: show the option if items are between 18 kg and 68 kg.
Pattern Matching
matches_any_pattern(base, pattern1, pattern2, ..., patternN)
Uses Glob syntax:
*— matches any sequence of characters?— matches any single character[123aB]— matches one character in brackets[0-6]— matches a character from range in brackets
Example:
matches_any_pattern(postal_code(), '1[0,1]*', '1[2-5]*', '1[6-9]*')
How to set it up
In the Ingrid Merchant Platform, navigate to
Delivery Checkout → Regions → [Select Region]Select a Delivery Category or Carrier Product
Enter the rule expression in the Filter rules text field
Save your configuration
Test in staging first — use the Checkout Playground to verify rules with different addresses and cart configurations before deploying to production
Important: Filter rule syntax is sensitive to typos. Always test before going live. If you need help, ask Iris, Ingrid's AI assistant, in the chat on the Ingrid Help Center. If you can't reach Iris, email [email protected].
Available Functions Reference
Value, Weight & Quantity
Function | Description | Example |
| Total cart value in minor units |
|
| Total weight of all cart items in grams |
|
| Every item weighs below X grams |
|
| Total number of items in cart |
|
Dimensions
Dimension order: all_cartitems_below_dims and all_cartitems_above_dims take their arguments in the order height, length, width (H, L, W) — e.g. all_cartitems_above_dims(1, 3, 5) means height 1, length 3, width 5. (The other dimension functions below use the order shown in their signature.)
Function | Description | Example |
| All items fit within dimensions (mm) |
|
| All items fit separately; two highest dimensions compared with max, third dimension sum below max |
|
| 3D packed size check — all items packed together fit |
|
| Sum of two largest dimensions below X (mm) |
|
| Sum of each item's volume (mm³) |
|
| Each item has dimensions below values. Argument order is height, length, width |
|
| Each item has dimensions above values. Argument order is height, length, width |
|
| Sum of each item's dimensions below X (mm) |
|
| Checks if all items have dimensions present |
|
| True when items are missing dimensions |
|
| Sum of all items' heights, considering quantity |
|
| Sum of shortest dimension of each item below X |
|
| Longest length for any single item |
|
| Longest side of any cart item |
|
| Max circumference: length + (2 × (width + height)) |
|
| Largest item surface area below X (mm²) |
|
Cart & Item Attributes
Function | Description | Example |
| All items have the specified attribute |
|
| Not all items have the attribute |
|
| At least one item has the attribute |
|
| No items have any of the listed attributes |
|
| Cart-level attribute is present |
|
| Returns both cart and item attributes | Used in combination with |
| Any item name contains substring |
|
| Any item matches SKU |
|
| Any item name matches one of the tokens |
|
| At least N items have the attribute |
|
Postal Codes
Function | Description | Example |
| Postal code within numeric range |
|
| Postal code NOT in range |
|
| Postal code matches glob patterns |
|
| Postal code does NOT match pattern |
|
| Postal code is one of the listed values |
|
Date & Time
Function | Description | Example |
| Current time is on specified weekday |
|
| Current time is within hours and weekday range |
|
| Days between now and shipping date start |
|
| Days between shipping date start and end |
|
Vouchers, Discounts & Stock
Function | Description | Example |
| Cart has specified voucher code |
|
| Total discount value in minor units |
|
| Item stock status flag |
|
| Pre-order flag |
|
Group Attributes (Checkout V2 only)
Group attributes are treated as cart attributes. For example:
contains(cart_attributes(), 'free')
This evaluates whether the group attributes are present in the cart attributes for that specific group.
Use Cases & Real Examples
Use case 1: Size and weight limits for a home delivery carrier
Scenario: A home delivery carrier (e.g. Budbee) only accepts parcels within specific size and weight limits. Items that are too heavy, too long, or flagged as bulky/frozen should not be offered this delivery method.
Rule:
max_item_circumference <= 2900 && max_item_long_edge < 1200 && total_weight < 59000 && all_cartitems_below_weight(19600) && not(contains_any(cart_items_attributes(), ('shipping_bulky_weight', 'frozen_items'))) && not(all_cartitems_have_attr('presentkort'))How it reads: Show this carrier product only if:
No item's circumference exceeds 2900 mm
No item's longest edge exceeds 1200 mm
Total weight is under 59 kg
Every individual item is under 19.6 kg
No items are flagged as bulky or frozen
Not all items are gift cards
Use case 2: Pickup point carrier with weight, size and product exclusions
Scenario: A pickup point service has strict size limits (fits in a box 340×290×120 mm) and weight limits. Certain product categories (frozen items) must be excluded.
Rule:
not(all_cartitems_has_dims()) && total_weight <= 1600 && not(contains_any(cart_items_attributes(), ('shipping_bulky_weight', 'frozen_items')))
||
all_cartitems_has_dims() && all_cartitems_3d_packed_fits_size(340, 290, 120) && total_weight <= 19000 && not(contains_any(cart_items_attributes(), ('shipping_bulky_weight', 'shipping_frozen_items')))How it reads: Two branches (OR):
If items DON'T have dimensions: allow if total weight ≤ 1.6 kg and no bulky/frozen items
If items DO have dimensions: allow if they fit packed in the box, total weight ≤ 19 kg, and no bulky/frozen items
Use case 3: Mailbox delivery with value and weight cap
Scenario: Mailbox delivery (e.g. PostNord Varubrev) is only suitable for small, lightweight, low-value orders that don't contain gift cards.
Rule:
all_cartitems_below_weight(20001) && total_weight < 120000 && not(contains_any(cart_items_attributes(), ('shipping_bulky_weight', 'frozen_items'))) && not(all_cartitems_have_attr('presentkort'))
Use case 4: Exclude specific postal codes
Scenario: A carrier doesn't serve certain remote areas. The retailer wants to hide this delivery option for those postal codes.
Rule:
contains_any(cart_items_attributes(), ('frozen_items')) && not(in_range(postal_code(), 63000, 63998)) && not(in_range(postal_code(), 85229, 99999))How it reads: Show this option only for frozen items AND only if the postal code is NOT in the excluded ranges.
Use case 5: Gift card — only digital delivery
Scenario: When all items in the cart are gift cards, only a digital delivery option (CSO) should appear — no physical shipping.
Rule:
all_cartitems_have_attr('presentkort')How it reads: Show this delivery method only if every item in the cart has the "presentkort" (gift card) attribute.
Use case 6: Freight service for oversized items
Scenario: A freight carrier (e.g. DHL Freight) is only needed for very heavy or oversized items that standard carriers can't handle.
Rule:
all_cartitems_below_weight(19001) && total_weight < 120000 && not(contains_any(cart_items_attributes(), ('shipping_bulky_weight', 'frozen_items'))) && not(all_cartitems_have_attr('presentkort'))Combined with post filter rules on the standard carriers, this creates a fallback pattern: freight only appears when standard options are filtered out.
Frequently Asked Questions
Q: Can I apply filter rules to both delivery categories and carrier products?
A: Yes. Category-level rules control whether the entire category is shown. Carrier product-level rules control individual options within a category. If both are set, both must evaluate to true.
Q: What happens if I make a syntax error?
A: The rule may not work as expected — the delivery option might always show or always be hidden. Always test in staging first, and if you're unsure, ask Iris, Ingrid's AI assistant, in the chat on the Ingrid Help Center. If you can't reach Iris, email [email protected].
Q: Can I combine multiple conditions?
A: Yes. Use && (AND) to require all conditions, || (OR) to require at least one, and not() to negate. You can mix operators in a single rule.
Q: What if my items don't have dimensions set?
A: Dimension-based functions may behave unexpectedly. Use all_cartitems_has_dims() to check first, and create separate rule branches for items with and without dimensions.
Q: Can filter rules change delivery prices?
A: No. Filter rules only show or hide options. For pricing logic, use Price Rules.
Q: Do filter rules work in both Checkout V1 and V2?
A: Yes, filter rules work in both versions. However, group attributes (treated as cart attributes) are only supported in Checkout V2.
Related documentation
Checkout Rules Overview — how all rule types work together
Post Filter Rules — post-carrier refinement based on method availability
Price Rules — dynamic delivery pricing
Checkout Playground — testing rule configurations before going live
