Shipit DocumentationShipit Documentation
Home
API
Webhooks
Shipit Delivery Checkout
Shipit Return and Exchange
Shopify Delivery Checkout
  • English
  • Suomi
  • Svenska
  • Eesti
  • Dansk
  • Norsk
Home
API
Webhooks
Shipit Delivery Checkout
Shipit Return and Exchange
Shopify Delivery Checkout
  • English
  • Suomi
  • Svenska
  • Eesti
  • Dansk
  • Norsk
  • Shopify Delivery Checkout

    • Shopify Delivery Checkout
    • Advanced Sorting
    • Understanding Rules
    • Condition Types Reference
    • Priority System: Why Order Matters
    • Common Scenarios
    • Troubleshooting
  • Configuration

    • Settings Overview
    • Automation Workflows
    • How Information Flows
  • Integration & APIs

    • Shipping Method Query
    • Pickup Point Query

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 tags
  • one_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 collections
  • one_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 list
  • one_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 pattern
  • one_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 zones
  • one_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_equal returns false, one_of_not_equal returns true

How to Find Zone IDs:

  1. Navigate to Settings → Shipping in Shopify admin
  2. Inspect shipping zones
  3. 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 identifiers
  • one_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_shipping is 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_name field populated
  • Individual: Destination has no company_name or 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_name field 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

OperatorSymbolDescriptionExample
Equal=Exactly equal toweight = 10
Not Equal!=Not equal toweight != 10
Greater Than>Strictly greater thanweight > 10
Less Than<Strictly less thanweight < 10
Greater or Equal>=Greater than or equal toweight >= 10
Less or Equal<=Less than or equal toweight <= 10

Set Operators

Used by: product_tag, product_collection, shipment_country, shipment_postcode, shipping_zone, sender_location

OperatorValueDescriptionLogic
One Of Equalone_of_equalMatches if value is in the setIN operator
One Of Not Equalone_of_not_equalMatches if value is not in the setNOT IN operator

String Operators

Used by: customer_type

OperatorSymbolDescriptionExample
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:

  1. Boundary values: Test at exact thresholds (e.g., exactly 10kg)
  2. Just above/below: Test 9.9kg and 10.1kg
  3. Multiple conditions: Ensure AND/OR logic works correctly
  4. Edge cases: Empty values, missing data, null fields
  5. Case sensitivity: Test with different letter cases

Example Test Matrix:

TestWeightValueCountExpected
Below all5kg€502Base rate
At threshold10kg€1005Rule matches
Above threshold15kg€1508Rule matches
Multiple rules35kg€60020Highest priority rule

Next Steps

  • Priority System - Understand rule execution order
  • Common Scenarios - See real-world examples
  • Troubleshooting - Debug condition issues
Last Updated: 6/13/26, 7:25 AM
Contributors: Brian Faust
Prev
Understanding Rules
Next
Priority System: Why Order Matters