How to Route Orders to Different Carriers Based on Destination

Automatically select the best shipping carrier based on order destination, weight, or value.

What This Integration Does

Most merchants run a small set of carriers for different scenarios: a domestic parcel network for bulk consumer orders, a premium courier for express, and an international integrator like DHL for cross-border. Picking the right one per order shaves real money and avoids missed delivery promises. This workflow encodes those rules as Condition nodes that branch on country, weight, and total, then hands the parcel off to the correct carrier's MCP connector.

The workflow runs on the order-created webhook from your store. Each branch ends in a carrier-specific shipment booking and persists the resulting tracking number back to the order. Branches run independently, so a failure on one carrier never blocks routing decisions for other orders.

Prerequisites

  • A Shopify or WooCommerce connection with read access to orders and write access to update them with tracking info.
  • A DHL Express connection for international shipments.
  • A Shippit connection for domestic express deliveries.
  • A ShipStation connection (or similar) for domestic bulk where you want carrier rate-shopping.
  • A documented carrier policy: which countries, what weight thresholds, what value tiers route where.

Step 1: Webhook Trigger

Add a Trigger node and set its type to Webhook. Wire its URL into the orders/create webhook in your store. The trigger emits the full order payload, including the shipping address and line items.

Step 2: Normalise the Inputs

Add a Transform node that pulls the routing signals out of the order into top-level variables:

  • destCountry: {{ trigger.body.shipping_address.country_code }}
  • totalWeightKg: sum of line_items[].grams divided by 1000
  • orderValue: {{ trigger.body.total_price }}
  • orderCurrency: {{ trigger.body.currency }}

Doing the math once here keeps the conditions in later steps clean and readable.

Step 3: Condition - Domestic or International?

Add a Condition node on destCountry == "AU" (or your home country). True branches to the domestic logic in Step 4; false branches to the international logic in Step 5.

Step 4: Domestic - Choose Express vs Bulk

On the domestic branch, add another Condition node to split express from bulk. A simple rule:

  • orderValue > 200 OR shipping_method == "express" - route to Shippit for next-day delivery.
  • Otherwise - route to ShipStation for standard rate-shopped delivery.

For Shippit, add a Connector node on shippit and pick get-quotes to confirm price/ETA, then create-order to book the parcel. For ShipStation, add a Connector node on shipstation and pick create-order followed by create-shipment-label.

Step 5: International - DHL Express

On the international branch, add a Connector node on dhl-express and pick get-rates first - this gives you the live quote to display or log. Then call create-shipment with the order's address, weight, declared value, and currency. DHL returns a tracking number and shipping label URL on success.

Step 6: Write Tracking Back and Notify

Every branch converges on a final step that updates the order with the chosen carrier and tracking. Add a Connector node on shopify with the update-order tool (or woocommerce update-order) to attach the tracking number, carrier code, and label URL. Follow with a slack send-message call to your fulfillment channel so the warehouse knows which printer to send the label to. Wire a Condition node on the carrier call's result so failures branch to a Slack alert instead of silently dropping.

Tips

  • Quote before booking - calling get-quotes (Shippit) or get-rates (DHL Express) before create-order/create-shipment lets you sanity-check the cost and refuse outliers.
  • Use a Parallel node for rate-shopping - if you want to compare ShipStation and Shippit on the same order, fan out both quote calls in parallel and pick the cheaper one before booking.
  • Externalise the rules - storing thresholds (weight, value, express keyword) as workflow variables makes them easy to tune without re-wiring the canvas.

Common Pitfalls

  • Missing country code - some legacy orders ship to "United Kingdom" instead of GB. Normalise to ISO-2 country codes in Step 2 or the conditions silently fall through.
  • Weight in grams vs kilograms - Shopify exposes grams; DHL expects kilograms. Divide once in Step 2 and you won't accidentally quote a 30kg parcel as a 30,000kg one.
  • P.O. boxes - express carriers refuse them. Add a Condition that downgrades to standard if address1 matches a P.O. box pattern (use the regex connector's test tool).
  • Currency mismatches on declared value - DHL international shipments fail if the declared value currency doesn't match the order currency. Pass orderCurrency explicitly.

Testing

Place three test orders covering each branch: one domestic standard, one domestic express (over the value threshold), and one international. Run the workflow manually against each and check that the right carrier was called, that tracking landed back on the order, and that Slack got a notice. Once all three work, point the webhook at the live trigger.

Learn More

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.