GoRules Version 2 is here - redesigned, now with managed cloud.GoRules Version 2 is here!
Watch the launch videoWatchDynamic Shipping Cost Calculator
Advanced shipping rate system that automatically calculates costs based on shipment attributes, seasonal variables, and customer loyalty tiers.
Solution
This shipping cost calculator delivers accurate and fair pricing by evaluating multiple shipment variables simultaneously. Starting with the base rate determined by shipping type (standard, express, or priority) and weight brackets, the system applies dimensional weight calculations to account for bulky but lightweight items. Distance is factored in proportionally to capture fuel and operational costs that increase with delivery range.
The calculator recognizes customer loyalty with built-in tier discounts for platinum, gold, and silver members, providing transparent benefits for repeat business. Seasonal adjustments are automatically applied for summer peak periods and winter weather challenges, ensuring prices reflect actual operational costs throughout the year. This multi-factor approach creates balanced shipping quotes that benefit both the carrier and customer with fair, predictable pricing.
How it works
The decision graph processes shipping information through four connected components:
- Base Rate Calculation: Determines initial pricing using shipping type (standard, express, priority) and weight brackets.
- Season Detection: Identifies the current time of year (winter, summer, regular) based on day number to apply appropriate seasonal factors.
- Shipping Factors: Calculates dimensional weight by comparing actual weight against volume-based weight (length × width × height ÷ 5000), and determines distance factors for mileage pricing.
- Final Price Calculation: Combines all previous factors with customer tier discounts (platinum, gold, silver) to produce the final shipping cost with adjustments for both seasonal challenges and customer loyalty.
Where teams use it
- E-commerce shipping rate calculators
- Logistics company pricing systems
- Warehouse management software
- Supply chain management platforms
- Customer service shipping quote tools
- International shipping operations
Inside the decision model
Dynamic Shipping Cost Calculator ships as a JDM decision graph with 5 nodes, 3 decision tables and 25 rules. Download it, load it into GoRules, and run it as-is on Zen Engine.
Request
inputQuotes start from seven flat fields: shippingType, weight, the length, width, and height dimensions, distance, and customerTier. The graph fans this out to the base-rate and season tables in parallel before merging everything into the final price.
Sample requestJSON
{
"shippingType": "express",
"weight": 25,
"length": 40,
"width": 30,
"height": 20,
"distance": 250,
"customerTier": "gold"
}Base Rate Calculation
tableA nine-row matrix crosses shippingType against weight brackets under a first hit policy, writing the result to baseRate. Each service has three bands, under 20kg, [20..50], and above 50kg: 'standard' runs 10, 15, 25, 'express' runs 20, 30, 45, and 'priority' runs 35, 50, 75.
Bracketed base rates like this mirror how published carrier rate cards work, where a handful of weight breaks keep quoting predictable instead of pricing every kilogram continuously. The roughly 2x step from standard to express and again to priority within each band is a business choice that keeps the speed premium consistent across weights.
| Shipping TypeshippingType | Weight (kg)weight | Base RatebaseRate |
|---|---|---|
| 'standard' | < 20 | 10 |
| 'standard' | [20..50] | 15 |
| 'standard' | > 50 | 25 |
| 'express' | < 20 | 20 |
| 'express' | [20..50] | 30 |
| 'express' | > 50 | 45 |
+3 more rows in the downloadable template
Determine Season
tableSeason detection reads dayOfYear('now') rather than any request field: days below 80 or above 355 map to 'winter', days between 172 and 265 map to 'summer', and the blank catch-all returns 'regular'. First hit ordering means the two winter rows cover both ends of the calendar before the summer band is checked.
Those cutoffs approximate the northern-hemisphere solstice-to-equinox calendar, so the surcharge windows track the periods when winter weather disruption and summer peak demand genuinely raise operating cost. Because the clock is evaluated at run time, the same request prices differently across the year with no caller input, which is exactly how seasonal tariffs behave in practice.
| Day of YeardayOfYear('now') | Current SeasoncurrentSeason |
|---|---|
| < 80 | 'winter' |
| > 355 | 'winter' |
| > 172 and < 265 | 'summer' |
| - | 'regular' |
Calculate Factors
expressionThree pricing factors are derived before the rate table runs: dimensionalWeight as (length * width * height) / 5000, effectiveWeight as max([weight, $.dimensionalWeight]), and distanceFactor as distance / 100. The 5000 divisor is the dimensional-weight convention parcel carriers use so light but bulky boxes are billed for the space they consume, and normalizing distance per 100km keeps the downstream multiplier small and legible.
(length * width * height) / 5000max([weight, $.dimensionalWeight])distance / 100Calculate Final Price
tablePricing crosses customerTier with currentSeason across twelve first-hit rows, all sharing the same backbone formula, baseRate * (effectiveWeight / weight) * (1 + distanceFactor * 0.1), then layering tier and season multipliers. 'platinum' pays 0.8 in every season, 'gold' pays 0.9 with a 1.1 winter or 1.05 summer factor, 'silver' pays 0.95 with the same seasonal factors, and the tierless rows at the bottom apply only the seasonal 1.1 or 1.05, or nothing. The tierDiscount output records which multiplier applied.
Two realistic pricing ideas are encoded here: seasonal surcharges cover the genuinely higher cost of winter weather handling and summer peak volume, and loyalty tiers buy those surcharges down, with platinum insulated from them entirely since its rows carry no seasonal factor. The specific 5, 10, and 20 percent steps are calibration choices, but the structure, a stable formula with stacked multipliers, is how carriers keep dynamic pricing explainable on an invoice.
| Customer TiercustomerTier | SeasoncurrentSeason | Final PricefinalPrice | Tier DiscounttierDiscount |
|---|---|---|---|
| 'platinum' | 'winter' | baseRate * (effectiveWeight / weight) * (1 + distanceFactor * 0.1) * 0.8 | 0.8 |
| 'platinum' | 'summer' | baseRate * (effectiveWeight / weight) * (1 + distanceFactor * 0.1) * 0.8 | 0.8 |
| 'platinum' | 'regular' | baseRate * (effectiveWeight / weight) * (1 + distanceFactor * 0.1) * 0.8 | 0.8 |
| 'gold' | 'winter' | baseRate * (effectiveWeight / weight) * (1 + distanceFactor * 0.1) * 0.9 * 1.1 | 0.9 |
| 'gold' | 'summer' | baseRate * (effectiveWeight / weight) * (1 + distanceFactor * 0.1) * 0.9 * 1.05 | 0.9 |
| 'gold' | 'regular' | baseRate * (effectiveWeight / weight) * (1 + distanceFactor * 0.1) * 0.9 | 0.9 |
+6 more rows in the downloadable template
Other Logistics templates
View all templatesShipping Carrier Selector
Rule-based system that selects optimal carriers by analyzing package details, service level needs, and cost factors to streamline shipping decisions.
LogisticsDelivery Route Optimizer
Smart logistics system that evaluates capacity, traffic, time windows, and distance to determine the most efficient delivery routes for maximum efficiency.
LogisticsWarehouse Storage Location
Maximizes warehouse efficiency by strategically placing products based on turnover rates, picking frequency, and product characteristics.
Make this template
your own.
Load Dynamic Shipping Cost Calculator into GoRules, adjust the rules to your policy, and ship it behind your own API.