Condition Types Reference
This guide provides a complete reference for all supported condition types in Shopify Delivery Checkout rules.
Condition Categories
Conditions are organized into three categories:
- Cart Conditions: Evaluate the shopping cart contents
- Product Conditions: Evaluate products in the cart
- Location Conditions: Evaluate shipping origin and destination
- Customer Conditions: Evaluate customer information
Cart Conditions
cart_weight
Evaluates the total weight of all items in the cart.
Supported Operators: >, <, >=, <=, =, !=
Value Format: Numeric (weight in kg)
Example:
{
"type": "cart_weight",
"value": ["25.5"],
"operator": ">"
}
Common Use Cases:
- Surcharges for heavy orders
- Free shipping thresholds
- Weight-based tiered pricing
Notes:
- Weight is measured in kilograms
- Value is the sum of all line items (quantity × weight)
cart_value
Evaluates the total monetary value (subtotal) of the cart.
Supported Operators: >, <, >=, <=, =, !=
Value Format: Numeric (amount in store currency)
Example:
{
"type": "cart_value",
"value": ["100.00"],
"operator": ">="
}
Common Use Cases:
- Free shipping over a threshold
- Minimum order value requirements
- Value-based tiered pricing
Notes:
- Value is in the store's default currency
- Includes product prices × quantities
- Does not include shipping costs or taxes
cart_item_count
Evaluates the total number of items in the cart.
Supported Operators: >, <, >=, <=, =, !=
Value Format: Numeric (integer)
Example:
{
"type": "cart_item_count",
"value": ["5"],
"operator": ">="
}
Common Use Cases:
- Bulk order discounts
- Minimum quantity requirements
- Multi-item shipping rates
Notes:
- Counts the sum of all line item quantities
- A cart with 3× Product A and 2× Product B has count = 5
Product Conditions
product_tag
Checks if at least one product in the cart has specific tags.
Supported Operators: one_of_equal, one_of_not_equal
Value Format: Array of tag strings
Example:
{
"type": "product_tag",
"value": ["fragile", "hazmat", "oversized"],
"operator": "one_of_equal"
}
Operators Explained:
one_of_equal: Matches if any product has any of the specified tagsone_of_not_equal: Matches if any product has none of the specified tags
Common Use Cases:
- Special handling fees for fragile items
- Disable express shipping for hazardous materials
- Surcharges for oversized products
Notes:
- Tag matching is case-insensitive
- Only one matching product is needed
- Product data is fetched from Shopify API
Logic Examples:
Scenario 1: operator: "one_of_equal"
Cart: [Product A (tags: ["fragile", "glass"]), Product B (tags: ["metal"])]
Condition: value: ["fragile", "hazmat"]
Result: ✅ MATCH (Product A has "fragile")
Scenario 2: operator: "one_of_not_equal"
Cart: [Product A (tags: ["electronics"]), Product B (tags: ["clothing"])]
Condition: value: ["fragile", "hazmat"]
Result: ✅ MATCH (Product A has no fragile/hazmat tags)
product_collection
Checks if at least one product in the cart belongs to specific collections.
Supported Operators: one_of_equal, one_of_not_equal
Value Format: Array of collection title strings
Example:
{
"type": "product_collection",
"value": ["Summer Sale", "Clearance"],
"operator": "one_of_equal"
}
Operators Explained:
one_of_equal: Matches if any product belongs to any of the specified collectionsone_of_not_equal: Matches if any product belongs to none of the specified collections
Common Use Cases:
- Free shipping for sale items
- Exclude express shipping for clearance products
- Collection-specific shipping rates
Notes:
- Collection matching is case-insensitive
- Uses collection titles (not handles or IDs)
- Product data is fetched from Shopify GraphQL API
Location Conditions
shipment_country
Checks the destination country code.
Supported Operators: one_of_equal, one_of_not_equal
Value Format: Array of ISO 3166-1 alpha-2 country codes (uppercase)
Example:
{
"type": "shipment_country",
"value": ["GB", "DE", "FR"],
"operator": "one_of_equal"
}
Operators Explained:
one_of_equal: Matches if destination country is in the listone_of_not_equal: Matches if destination country is not in the list
Common Use Cases:
- Country-specific shipping rates
- EU vs non-EU pricing
- Domestic vs international shipping
Notes:
- Use standard 2-letter country codes (e.g., US, CA, GB)
- Matching is case-insensitive
- Country code comes from Shopify checkout destination
Country Code Examples:
GB - United Kingdom
US - United States
CA - Canada
DE - Germany
FR - France
IT - Italy
ES - Spain
AU - Australia
shipment_postcode
Checks the destination postal/zip code with pattern matching support.
Supported Operators: one_of_equal, one_of_not_equal
Value Format: Array of postcode strings or patterns
Example:
{
"type": "shipment_postcode",
"value": ["AB*", "IV*", "PA20-PA78"],
"operator": "one_of_equal"
}
Operators Explained:
one_of_equal: Matches if postcode matches any patternone_of_not_equal: Matches if postcode matches no patterns
Pattern Matching:
*- Wildcard for any characters (e.g.,AB*matches AB10, AB11, AB99)?- Single character wildcard (e.g.,AB1?matches AB10, AB19)[abc]- Character class (e.g.,AB[123]matches AB1, AB2, AB3)- Exact match (e.g.,
AB10 1XG)
Common Use Cases:
- Rural area surcharges
- Remote location fees
- Zone-based pricing
Pattern Examples:
// UK Scottish Highlands
{"value": ["AB*", "IV*", "KW*", "PA20-PA99", "PH*"]}
// UK London postcodes
{"value": ["E*", "EC*", "N*", "NW*", "SE*", "SW*", "W*", "WC*"]}
// US specific zip codes
{"value": ["90210", "10001", "60601"]}
// US zip code ranges
{"value": ["902*", "100*", "606*"]}
Notes:
- Matching is case-insensitive
- Patterns use shell-style wildcards (fnmatch)
- Postcode comes from Shopify checkout destination
shipping_zone
Checks if the destination country belongs to a specific Shopify shipping zone.
Supported Operators: one_of_equal, one_of_not_equal
Value Format: Array of Shopify shipping zone IDs
Example:
{
"type": "shipping_zone",
"value": ["gid://shopify/DeliveryZone/123456"],
"operator": "one_of_equal"
}
Operators Explained:
one_of_equal: Matches if destination country is in any of the specified zonesone_of_not_equal: Matches if destination country is not in any of the specified zones
Common Use Cases:
- Zone-based pricing (e.g., EU zone, Rest of World zone)
- Shipping method availability per zone
- Zone-specific surcharges
Notes:
- Zone IDs are Shopify global IDs (GIDs)
- The system looks up which zone contains the destination country
- If no zone contains the country,
one_of_equalreturns false,one_of_not_equalreturns true
How to Find Zone IDs:
- Navigate to Settings → Shipping in Shopify admin
- Inspect shipping zones
- Zone IDs follow format:
gid://shopify/DeliveryZone/{ID}
sender_location
Checks the shipping origin location (where items ship from).
Supported Operators: one_of_equal, one_of_not_equal
Value Format: Array of location name strings
Example:
{
"type": "sender_location",
"value": ["SE warehouse Malmö", "US warehouse"],
"operator": "one_of_equal"
}
Operators Explained:
one_of_equal: Matches if origin contains any of the location identifiersone_of_not_equal: Matches if origin contains none of the location identifiers
Common Use Cases:
- Multi-warehouse shipping rates
- Origin-specific handling fees
- International vs domestic origin pricing
Notes:
- Matching checks if location name contains the origin city or country
- Case-insensitive substring matching
- If
consolidate_multi_location_shippingis enabled on the shipping method, this condition always returns true (passes)
Matching Logic: The condition checks if the location name contains:
- The origin city (e.g., "Malmö" matches "SE warehouse Malmö")
- The origin country code (e.g., "SE" matches "SE warehouse Malmö")
Examples:
// Single warehouse check
{"value": ["Stockholm"]}
// Multiple warehouse options
{"value": ["Stockholm warehouse", "Malmö warehouse", "Göteborg warehouse"]}
// Country-based matching
{"value": ["SE", "NO", "FI"]}
Customer Conditions
customer_type
Checks whether the customer is an individual or a company.
Supported Operators: =, !=
Value Format: String ("individual" or "company")
Example:
{
"type": "customer_type",
"value": ["company"],
"operator": "="
}
Operators Explained:
=: Matches if customer type equals the specified type!=: Matches if customer type does not equal the specified type
Customer Type Logic:
- Company: Destination has a
company_namefield populated - Individual: Destination has no
company_nameor it's empty
Common Use Cases:
- B2B vs B2C shipping rates
- Business customer discounts
- Individual customer surcharges
Examples:
// B2B customers only
{
"type": "customer_type",
"value": ["company"],
"operator": "="
}
// Individual customers only
{
"type": "customer_type",
"value": ["individual"],
"operator": "="
}
// Exclude companies
{
"type": "customer_type",
"value": ["company"],
"operator": "!="
}
Notes:
- Detection is based on the
company_namefield in Shopify checkout - Value matching is case-insensitive
- Only two values are supported:
"individual"and"company"
Operator Reference
Numeric Operators
Used by: cart_weight, cart_value, cart_item_count
| Operator | Symbol | Description | Example |
|---|---|---|---|
| Equal | = | Exactly equal to | weight = 10 |
| Not Equal | != | Not equal to | weight != 10 |
| Greater Than | > | Strictly greater than | weight > 10 |
| Less Than | < | Strictly less than | weight < 10 |
| Greater or Equal | >= | Greater than or equal to | weight >= 10 |
| Less or Equal | <= | Less than or equal to | weight <= 10 |
Set Operators
Used by: product_tag, product_collection, shipment_country, shipment_postcode, shipping_zone, sender_location
| Operator | Value | Description | Logic |
|---|---|---|---|
| One Of Equal | one_of_equal | Matches if value is in the set | IN operator |
| One Of Not Equal | one_of_not_equal | Matches if value is not in the set | NOT IN operator |
String Operators
Used by: customer_type
| Operator | Symbol | Description | Example |
|---|---|---|---|
| Equal | = | String equals (case-insensitive) | type = "company" |
| Not Equal | != | String not equals (case-insensitive) | type != "individual" |
Common Patterns
Pattern 1: Complex Cart Conditions
Combine multiple cart conditions for sophisticated logic:
{
"conditions_match": "all",
"conditions": [
{"type": "cart_weight", "value": ["20"], "operator": ">"},
{"type": "cart_value", "value": ["500"], "operator": ">="},
{"type": "cart_item_count", "value": ["10"], "operator": "<"}
]
}
This matches: Heavy (>20kg) AND expensive (≥€500) BUT not bulk orders (≥10 items).
Pattern 2: Product Exclusions
Disable shipping method for certain product types:
{
"type": "disable_method",
"conditions_match": "any",
"conditions": [
{"type": "product_tag", "value": ["hazmat", "dangerous"], "operator": "one_of_equal"},
{"type": "product_tag", "value": ["oversized"], "operator": "one_of_equal"}
]
}
This disables the method if cart contains hazmat OR oversized products.
Pattern 3: Geographic Pricing
Different rates for different regions:
[
{
"priority": 0,
"conditions": [
{"type": "shipment_postcode", "value": ["AB*", "IV*"], "operator": "one_of_equal"}
]
},
{
"priority": 1,
"conditions": [
{"type": "shipment_country", "value": ["GB"], "operator": "one_of_equal"}
]
}
]
Priority 0 checks remote UK postcodes first, then Priority 1 applies to all UK.
Pattern 4: B2B Discount
Free shipping for business customers over threshold:
{
"price": 0.00,
"conditions_match": "all",
"conditions": [
{"type": "customer_type", "value": ["company"], "operator": "="},
{"type": "cart_value", "value": ["200"], "operator": ">="}
]
}
Pattern 5: Multi-Warehouse Logic
Different rates based on origin:
[
{
"priority": 0,
"name": "International Origin Surcharge",
"price": 75.00,
"conditions": [
{"type": "sender_location", "value": ["US warehouse"], "operator": "one_of_equal"}
]
},
{
"priority": 1,
"name": "Domestic Rate",
"price": 25.00,
"conditions": [
{"type": "sender_location", "value": ["SE", "NO", "FI"], "operator": "one_of_equal"}
]
}
]
Value Format Guidelines
Numeric Values
Always provide as string in an array:
{"value": ["25.5"]} // ✅ Correct
{"value": [25.5]} // ❌ Wrong
{"value": "25.5"} // ❌ Wrong
String Values
Provide as array of strings:
{"value": ["GB", "DE", "FR"]} // ✅ Correct
{"value": "GB"} // ❌ Wrong
Single vs Multiple Values
Numeric conditions only use the first value:
{"type": "cart_weight", "value": ["10", "20"], "operator": ">"}
// Uses only "10", ignores "20"
Set conditions can use multiple values:
{"type": "shipment_country", "value": ["GB", "DE", "FR"], "operator": "one_of_equal"}
// Checks against all three countries
Testing Your Conditions
Create test cases covering:
- Boundary values: Test at exact thresholds (e.g., exactly 10kg)
- Just above/below: Test 9.9kg and 10.1kg
- Multiple conditions: Ensure AND/OR logic works correctly
- Edge cases: Empty values, missing data, null fields
- Case sensitivity: Test with different letter cases
Example Test Matrix:
| Test | Weight | Value | Count | Expected |
|---|---|---|---|---|
| Below all | 5kg | €50 | 2 | Base rate |
| At threshold | 10kg | €100 | 5 | Rule matches |
| Above threshold | 15kg | €150 | 8 | Rule matches |
| Multiple rules | 35kg | €600 | 20 | Highest priority rule |
Next Steps
- Priority System - Understand rule execution order
- Common Scenarios - See real-world examples
- Troubleshooting - Debug condition issues
