Tom Sailors
· Refreshed
Brief · Anonymized case study

Shipping Rate Failover & Alert

Detect when a carrier returns no rates for an addressable zip at checkout. Query a secondary carrier instantly for fallback rates. Send an alert to operations when both primary and backup fail. Track rate failures in a dashboard to identify service-area mismatches with carriers and prevent future gaps.

A mid-market DTC merchant using ShipEngine for multi-carrier shipping faced customer checkout abandonment when the primary carrier returned zero rates for a zip code that should have been in its service area. Without a backup mechanism or visibility into these gaps, valid orders were lost at the point of rate lookup.
Four pieces
Checkout

Rate Validation Hook

Intercepts ShipEngine rate responses during checkout and flags when a carrier returns zero rates for a zip that should be in its service area.

Custom checkout extension
extensions/delivery-customization/src/run.graphql function
# Function input query — Delivery Customization
query Input {
  cart {
    deliveryGroups {
      id
      deliveryAddress {
        zip
        countryCode
      }
      deliveryOptions {
        handle
        title
        description
      }
    }
  }
}
Removed buyerIdentity.deliveryAddress — BuyerIdentity does not expose address fields in Delivery Customization schema. Zip and country are available from cart.deliveryGroups[].deliveryAddress only.
Shipping

Backup Rate Engine

Automatically pulls a secondary carrier's rate for the zip when the primary carrier returns nothing, allowing checkout to proceed without interruption.

Backend service + ShipEngine API calls
Operations

Dark-Zone Alert

Sends a Slack or email notification when a zip code in the merchant's approved service area returns zero rates from both primary and backup carriers.

Shopify Flow + webhook
Shopify Flow editor: When → Then flow
Trigger: Custom webhook (backend fires when rate lookup fails for a zip)
Condition: 
  – Zip is in your approved service-area list (stored as app data)
  – Primary carrier returned no rates
  – Backup carrier also returned no rates
Action: 
  – Send Slack message to #shipping channel with zip, attempted carriers, timestamp
  – Tag the order (if created) as 'rate-gap-alert'
  – Optional: Create a Slack thread for manual override options
Backend sends the webhook; Flow routes it to Slack, email, or PagerDuty depending on urgency.
Operations

Failure Dashboard

Live view of which zip codes are hitting rate gaps, frequency, and responsible carrier—enabling merchant to contact carriers about service-area mismatches and prevent recurrence.

Admin dashboard (custom app)
Admin GraphQL explorer graphql
# Admin GraphQL — query your app's stored rate-failure logs
query RateGaps($first: Int!) {
  shop {
    id
    name
  }
  orders(first: $first, query: "tag:rate-gap-alert") {
    edges {
      node {
        id
        name
        shippingAddress {
          zip
          country
        }
        createdAt
        metafields(namespace: "rate_gaps", first: 10) {
          edges {
            node {
              key
              value
            }
          }
        }
      }
    }
  }
}
Removed appInstallation (not exposed on Shop). Moved metafield query to orders themselves—each order can carry its own rate-gap context via metafields, which is the real pattern for per-order failure tracking.

Got a similar problem?

Sketch your build in 30 seconds — voice, type, or attach a screenshot.

Sketch the build →