How to Set Up Distance-Based Shipping Rates in Shopify

How to Set Up Distance-Based Shipping Rates in Shopify
Updated:
2026-07-03
Reading time:
8 minutes read
Category:
Shopify, Blog

Charging for shipping based on the actual physical distance to your customer is the most effective way for merchants to manage last-mile logistics. In this article, we explain how to easily deploy Shopify Distance-Based Shipping Rates to bypass the platform’s native flat-rate limitations. Master your local delivery setup and start pricing your delivery routes fairly for both you and your buyers.

Key Takeaways

What you need to know Detail
Shopify’s limitation Native shipping zones can’t calculate rates based on actual distance to the customer
The solution Octolize Distance Based Rates app uses Google Maps API to calculate real driving or straight-line distance at checkout
Shipping cost Flat rate per distance range (e.g. $5 for 0–20 mi) or rate per distance unit (e.g. $2/mi)
Multiple locations supported Each Shopify Location gets its own independent distance-based rate configuration
Plan requirement Carrier-Calculated Shipping (CCS) needed: included on Shopify Advanced, Plus, and Grow (annual / monthly billing with an additional fee of $20/month)

Does Shopify Support Distance-Based Shipping Natively?

No. Shopify’s built-in shipping has no mechanism for calculating delivery cost based on the actual distance between your store and the customer’s address. Shopify shipping zones define who you ship to (countries or regions), but they have no concept of a driving route, kilometres, or miles.

The closest Shopify can get natively is a flat rate per zone. But that’s an approximation, not a calculation. A customer 2 miles from your warehouse pays the same as one 40 miles away if they’re both in the same shipping zone. For most large-carrier shipments that’s acceptable. For businesses running their own delivery, it means either undercharging distant customers or overcharging nearby ones.

Distance-based rates require an app that connects to a mapping service, calculates the actual distance at checkout, and returns a dynamically-priced shipping option. That’s exactly what the Octolize Distance Based Rates app does.

Who Should Use Distance-Based Shipping Rates in Shopify?

Distance-based shipping is most valuable for stores that run their own delivery rather than hand shipments to standard carriers. If you ship via FedEx, UPS, or Royal Mail, their rates are already distance-adjusted, so you don’t need to calculate it yourself. But if your team does the delivering, you’re covering real fuel, time, and labour costs that scale directly with distance.

The five business types that benefit most:

Business type Why distance pricing works
Local delivery stores (groceries, florists, bakeries) Charges reflect actual driving cost per trip
Furniture & large-item retailers Heavy items + long routes = costs that vary dramatically
Same-day / on-demand delivery Speed premiums depend on how far drivers need to travel
Meal kits and perishables Short delivery windows require geographic precision
Local service businesses (plumbers, caterers, cleaning) Service cost naturally scales with travel distance

According to Capgemini Research, last-mile delivery costs account for more than 41% of total logistics expenses. It makes distance-accurate pricing one of the highest-impact levers available to local delivery businesses.

💡 Octolize data point: Among Shopify merchants using the Octolize Distance Based Rates app, the most common use case is local delivery for food, beverage, and grocery businesses – representing over 35% of all active configurations. The second most common is furniture and large-item delivery, where driving-route accuracy is critical to avoid margin erosion on long-distance drops.

What Is the Octolize Distance Based Rates App?

The Octolize Distance Based Rates app adds real-time, Google Maps-powered distance calculation to your Shopify checkout and support for multiple store locations.

When a customer enters their delivery address at checkout, the app:

  1. Reads the address.
  2. Connects to Google Maps API to calculate the distance from your configured shipping origin.
  3. Matches that distance to your configured price range.
  4. Returns a dynamically-priced shipping rate in real time.

The customer sees the correctly-priced shipping option.

Shopify Distance Based Shipping Rates
Offer your customers the precise real-time calculated delivery cost and shipping rates based on distance to their destinations.
4.6 on Trustpilot

What does the app offer?

Feature Detail
Flat rate per distance range e.g. $5 for 0–20 mi, $10 for 20–50 mi, $20 for 50–100 mi
Rate per distance unit e.g. $2/mi, with optional base delivery cost added
Base delivery cost Fixed starting fee always added to rate-per-distance calculation
Driving route calculation Uses actual road network via Google Maps (Driving, Cycling, or Walking)
Straight line calculation Direct point-to-point distance (“as the crow flies”)
{{distance}} shortcode Shows the calculated distance value in the checkout method description
Multiple locations Each Shopify Location gets its own independent distance-rate configuration
Enable/disable per location Temporarily turn off a location’s rates without deleting the configuration

This app is a most have to add to your Shopify web site to add on accurate locall delivery rates, My problem was we needed t charge fixed rates basd on distance feom our shop, 20 mins later after installing and I had it working, Our site look professional with this add on !!!! And support is great and follow up

— Store owner from USA, via Shopify App Store review

Which Shopify Plan Do You Need to Set Up Distance-Based Shipping Rates?

You need Carrier-Calculated Shipping (CCS) enabled on your Shopify store. The Octolize Distance Based Rates app displays its rates at checkout via Shopify’s CCS API – the same mechanism used by all third-party rate apps.

Shopify Plan CCS availability
Shopify Plus Included and enabled by default
Shopify Advanced Included and enabled by default
Shopify Grow (annual billing) Included
Shopify Grow (monthly billing) Available for an additional monthly fee ($20/month)
Shopify Basic Not available

How to Set Up Distance-Based Shipping in Shopify: Step-by-Step

The full setup has four stages: install the app, configure General settings (Google Maps API key), define distance-based rates per location, and verify the checkout output. Expect around 20–30 minutes for a single-location setup.

Prefer to watch first? Here’s a video walkthrough of the setup process:

Step 1: Install the Octolize Distance Based Rates App

Search for “Octolize Distance Based Rates” in the Shopify App Store, click Install, and follow the standard authorization flow. During installation, the app automatically adds its rates to any existing Shopify shipping zones under Carrier and app rates.

octolize shopify distance based rates app rates added to shipping zone

If you add new shipping zones after installation, add the app manually: go to Settings → Shipping and delivery → [zone] → Add shipping option → Use carrier or app to calculate rates → Octolize Distance Based Rates → Done.

adding octolize distance based rates manually

Step 2: Configure the General Settings

After installation, you’ll land on the General settings screen. Tick “Enable distance-based shipping cost calculation” and paste your Google Maps API key.

shopify distance based rates app general settings

The API connection status will update to Connected once the key is validated and changes are saved. If it doesn’t connect, double-check that Distance Matrix API and Geocoding API are both enabled in your Google Cloud project.

google maps api connection status connected

If you do not have your own Google Maps API Key yet, find out how to obtain it →

Step 3: Add a Distance-Based Rate for a Location

Go to Rates & Locations in the app’s navigation menu. The Rates & Locations table shows all locations synced from Shopify Settings → Locations, their current status (Active / Inactive), and any distance-based rates already configured. You cannot add or edit locations here. Do that in Shopify’s native location settings.

octolize distance based rates shopify locations

To add a new Distance-based rate for shipping from a specific Location, click the plus icon button + in the Action column next to that Location.

shopify adding distance based rates for shipping

Step 4: Configure the Rate Settings

On the rate configuration screen, work through four sections in order: Status, Shipping method, Distance, and Cost calculation.

Status

Tick “Enable distance-based rates for shipping from [location name]” to activate this rate. If unchecked, the rate won’t appear at checkout and will show as Inactive in the Rates & Locations table. It’s useful for temporarily suspending a location without losing your configuration.

octolize distance based rates configuration settings status

Shipping method name and description

Enter the Shipping method name that customers will see at checkout (e.g., “Local Delivery”, “Same-Day Delivery”). If you ship from multiple locations, use the same name for all of them. This will ensure that Shopify correctly sums up the distance-based costs when a cart contains items from multiple locations.

octolize distance based rates configuration settings shipping method

In the optional Shipping method description field, you can use the {{distance}} shortcode to display the calculated distance to the customer:

Local delivery: {{distance}} from our store

This shows at checkout as: “Local delivery: 4.3 mi from our store”

Distance settings

Choose your Distance units (kilometers or miles) and Distance calculation method (Driving route or Straight line).

configuration settings distance

Two Distance Calculation Methods

The Octolize Distance Based Rates app offers two ways to calculate the distance between your location and the customer: Driving route and Straight line. The right choice depends on your geography and delivery type.

Method How it works Best for
Driving route Uses Google Maps to calculate actual road distance, accounting for roads, turns, and obstacles Stores on the same landmass as customers; road-based delivery
Straight line Calculates direct point-to-point distance (“as the crow flies”), ignoring roads and terrain Cross-water delivery (e.g. island stores); cycling or walking delivery

Important limitation of Driving route: if there is no drivable road connection between your location and the customer’s address, for example, your warehouse is on an island, the Google Maps API cannot calculate a driving route and the app will not display a shipping rate at checkout. In this case, switch to Straight line.

When Driving route is selected, you also choose a Travel mode:

  • Driving: standard road network
  • Cycling: cycling paths and preferred streets
  • Walking: pedestrian paths and sidewalks

Cost calculation method

In the Delivery cost calculation method field, you select the way how the distance-based delivery cost should be calculated when shipping from this location by choosing one of the available options:

distance based rates configuration settings cost calculation

Option A: Flat rate for distance range

Set fixed prices for defined distance:

octolize distance based rates adding deleting distance ranges

If the distance falls within a range, that range’s flat cost applies. If no range matches (customer is too far), the shipping method is hidden at checkout, effectively setting a maximum delivery radius.

Option B: Rate per distance unit ($/mi or $/km)

Set a price per mile or kilometre:

distance based rates shopify app rate per distance ranges

Add can also add an optional Base delivery cost (e.g. $5.00) that is always added on top of the distance calculation.

Click Save when done. The rate will appear in the Rates & Locations table with Active status.

Ff you also need rate zones defined by ZIP / postal codes, read our guide on How to Set Up Shopify Shipping Based on Postcode

Best Distance Shipping Configurations (Real-World Examples)

Local grocery delivery

Use flat rate per distance range with a maximum radius to limit delivery reach and keep costs predictable.

Location: Main Store
Method name: "Local Delivery"
Distance units: Miles | Driving route | Driving

Distance ranges:
  0–3 mi   → $2.99
  3–7 mi   → $4.99
  7–12 mi  → $7.99
  (No range above 12 mi — method hidden beyond 12 miles)

A customer 5.2 miles away sees: “Local Delivery – $4.99”
A customer 15 miles away sees: “Shipping not available”

Furniture retailer

Use rate per distance with a base delivery cost to cover loading and handling regardless of distance, plus a variable fuel component.

Location: Warehouse
Method name: "Home Delivery"
Distance units: Kilometres | Driving route | Driving

Base delivery cost: €25.00
Rate per km:
  0–30 km  → €1.50/km
  30–80 km → €2.00/km
  (No range above 80 km — method hidden)

Calculation for 45 km: €25 + (45 × €2.00) = €115.00

Distance-Based Shipping Rates in Shopify: Frequently Asked Questions

Does Shopify support distance-based shipping natively?

No. Shopify’s built-in shipping zones work at the country, or region. There is no native feature to calculate rates based on actual driving distance or straight-line distance to the customer’s address. A third-party app like Octolize Distance Based Rates is required.

Do I need a Google Maps API key to use the app?

Yes. The app uses Google Maps to calculate distances, which requires your own API key with Distance Matrix API and Geocoding API enabled. Google provides a monthly credit at no charge, which covers distance calculations for most Shopify stores.

What’s the difference between Driving route and Straight line?

Driving route uses Google Maps to calculate the actual road distance between your location and the customer. Straight line calculates the direct geographical distance ignoring roads and terrain. Use Driving route for most land-based deliveries; use Straight line when there’s no drivable route (e.g. cross-water deliveries, island stores).

Can I set a maximum delivery radius?

Yes. Simply don’t add a distance range beyond your maximum. If no configured range matches the customer’s distance, the shipping method is hidden at checkout, effectively blocking orders from outside your delivery area.

What happens if I have multiple Shopify Locations?

Each location gets its own independent distance-rate configuration. Shopify calculates the distance cost from each active location and sums them at checkout, provided all locations use the same Shipping method name.

Can I show the delivery distance to customers at checkout?

Yes. Use the {{distance}} shortcode in the Shipping method description field. It will display the calculated distance value dynamically at checkout. For example: “Local delivery · 6.2 mi from our store”.

Can I temporarily disable a distance rate without deleting it?

Yes. Untick the “Enable distance-based rates for shipping from [location]” checkbox on the rate configuration screen. The rate turns Inactive and disappears from checkout, but all configuration is preserved.

Summary: How Octolize Solves Distance-Based Shipping in Shopify

Shopify’s native shipping is built for geographic zones, not geographic distances. For businesses running their own delivery, flat-rate zones mean you’re either subsidising distant deliveries or overcharging nearby ones. The Octolize Distance Based Rates app closes that gap with real-time Google Maps distance calculation, two charging models (flat range or per-mile rate), a base delivery cost option, and full support for multiple store locations. Once it’s set up, every customer at checkout sees a price that reflects the actual cost of getting their order to them. That’s fairer for them, and more profitable for you.

Pre-sale support

Have a question before buying?

Our team usually replies within a few hours. Ask away — we'll help you find the right solution for your store.

Consent(Required)

Content Writer at Octolize

Bartosz Gajewski is a content and marketing specialist with a solid background in SEO, WordPress content strategy, and technical documentation for digital products. With years of hands-on experience in both in-house and freelance roles, he supports tech companies – especially in the SaaS and e-commerce space – by creating content that informs, engages, and drives results.

His approach blends storytelling with data-driven SEO, and he’s been involved in projects ranging from rebranding and product marketing to growth experiments and copywriting for complex software tools. On the blog, he shares actionable insights from his work across marketing teams, product documentation, and online store optimization.

Comments
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Check out our case studies

Castle Sefton Press featured image
Castle Sefton Press

Learn how Octolize solutions helped WooCommerce store based in the United Kingdom set up shipping scenarios.

Case study Metuchen
Metuchen Mower

Learn how Octolize helped Shopify store based in the USA set up distance based rates with a usage of Octolize Distance Based Rates.

Neuro-divergence case study
The Neurodivergence Project

Learn how Octolize helped NGO set up their WooCommerce rates with a usage of Flexible Shipping PRO.