Tom Sailors
Brief · Anonymized case study

Live Shipping Rates with Graceful Failover

I'd build this as a Shopify Function that fires the rate engines in parallel and returns whichever responds first—or falls back to Shopify's native rates if ShipEngine times out at 800ms. That way the merchant gets live carrier options when they're available, but checkout never stalls waiting for a third party.

A mid-market Plus merchant with complex shipping needs wanted to surface live carrier rates from ShipEngine at checkout without risking cart abandonment due to slow third-party API calls. They needed the checkout to remain responsive even if the external rate engine exceeded acceptable latency.
Four pieces
Shipping

Delivery Rates Function

Captures the cart and delivery address at checkout, then decides which rate engine to use based on speed.

Shopify Function + Backend service
extensions/delivery-function/src/run.graphql function
query Input {
  cart {
    lines {
      id
      quantity
      merchandise {
        __typename
        ... on ProductVariant {
          id
          product {
            id
            handle
            metafield(namespace: "shipengine", key: "carrier_code") { value }
          }
        }
      }
      cost {
        totalAmount { amount }
      }
    }
    deliveryGroups {
      deliveryAddress {
        address1
        city
        provinceCode
        zip
        countryCode
      }
    }
    buyerIdentity {
      customer { id }
    }
  }
}
Changed postalCode to zip on MailingAddress type.
Shipping

Rate Engine Resolver

A backend service that receives cart and address data, fires ShipEngine and native rates in parallel, and returns whichever answers within 800ms.

Heroku-hosted Node backend
Shipping

ShipEngine Connector

Pulls live carrier rates directly from ShipEngine, formatted as Shopify delivery options for checkout.

Node.js + ShipEngine API client
Shipping

Failover & Monitoring

Logs timeouts and successes so you can track ShipEngine reliability and adjust the timeout if needed.

Monitoring dashboard + logs

Got a similar problem?

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

Sketch the build →