Skip to content

Rate Calculation Order

Understanding the calculation order helps you predict exactly what rates a customer will see. Here’s what happens when Shopify sends a rate request to ShipRules AI.

  1. Receive the rate request from Shopify

    Shopify sends the customer’s destination address, all cart items (with weights, prices, quantities, SKUs, tags), and the store’s currency.

  2. Match the destination to a zone

    The destination country is matched against your zones. If a matching zone has subzones, the destination postal code is checked against subzone patterns.

  3. Sort cart items into product groups

    Each item is matched to the product groups it belongs to. Items not assigned to any specific group fall into the Default group.

  4. Find applicable shipping methods

    For each zone + product group combination that has items in the cart, find all enabled shipping methods.

  5. Calculate base rates

    For each method, calculate the base rate using its rate type (flat, weight-based, price-based, etc.). Check the free shipping threshold — if the cart total exceeds it, the base rate is $0.00.

  6. Evaluate rules (in position order)

    For each method, evaluate its rules from lowest position to highest:

    • Hide rules: If all conditions match, mark the method as hidden.
    • Show rules: If the method has any Show rules, it starts hidden and only becomes visible if a Show rule matches.
    • Free rules: If all conditions match, set the rate to $0.00.
    • Adjustment rules: If all conditions match, apply the surcharge or discount.

    Multiple adjustments stack (they’re added/subtracted in order).

  7. Calculate blended rates

    If the cart spans multiple product groups and you have blended rates configured:

    • For each blended rate, look up the preferred method for each group.
    • Sum the rates from each group’s preferred method.
    • Apply any rules on the blended rate itself.
    • Check the blended rate’s free shipping threshold.
  8. Return rates to Shopify

    All visible methods (those not hidden by rules) are returned as shipping options. Shopify displays them to the customer at checkout.

The entire calculation — zone matching, rule evaluation, blended rates, everything — typically completes in under 50ms. Shopify adds its own network overhead, but ShipRules AI response times are well within Shopify’s 10-second timeout for carrier services.