Brief · Anonymized case study
Shipping Rate Failover & Alert
I'd build a checkout hook that catches zero-rate responses from the primary carrier, triggers an instant backup carrier lookup, and fires an alert if both fail. Then I'd surface those gaps in a dashboard so the merchant can fix service-area configs or carrier coverage before the next order hits the same zip.
A DTC merchant using ShipEngine for rate lookups was losing orders to checkout abandonment when carriers returned no rates for valid zip codes within their service area. The merchant needed a way to detect these rate gaps in real time, fall back to a secondary carrier, and alert operations before customers left checkout.
Four pieces
Checkout
Rate Validation Hook
Catches ShipEngine rate responses at 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, so checkout doesn't break.
Backend service + ShipEngine API calls
Operations
Dark-Zone Alert
Sends a Slack or email notification when a zip code in your service area returns zero rates from both your primary and backup carrier.
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
Your backend sends the webhook; Flow route it to Slack, email, or PagerDuty depending on urgency.
Operations
Failure Dashboard
Live view of which zips are hitting rate gaps, how often, and which carrier is responsible—so you can contact ShipEngine or update service areas.
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 →