Smart Rate Shopping
The Promise Engine and Shopify widget
Show shoppers a real "order in next 4h 12m for delivery by Wed" countdown driven by SmartRate — not a hardcoded promise.
What the Promise Engine does
The Promise Engine takes a destination address and the items in the cart and returns a real, personalized delivery promise based on:
- Your warehouse cutoff times
- The order's weight, dimensions, and origin
- Live SmartRate percentile data for the lane
- The active rate shopping profile
Installing the Shopify snippet
In your Shopify theme editor, open the section where you want the widget (typically the product page near the "Add to cart" button, and the cart drawer). Add a Custom Liquid block and paste:
The widget reads the current product variant, weight, and the visitor's ZIP (when available) and renders the countdown.
<div data-shipwave-promise data-warehouse="{{ shop.metafields.shipwave.warehouse_id }}"></div>
<script async src="https://shipwave.app/widget/promise.js"></script>The widget reads the current product variant, weight, and the visitor's ZIP (when available) and renders the countdown.
CORS allowlist setup
The widget calls
https://shipwave.app/api/public/promise from your storefront domain. Add your domain(s) to the allowlist at Admin → Settings → SmartRate → Promise Engine → Allowed origins. Include any custom domains and the *.myshopify.com staging origin. Without this, the browser will block the call and the widget will fall back to your default shipping promise.Customizing the copy and look
In Settings → SmartRate → Promise Engine, edit the template string. Available variables:
{{date}}, {{days}}, {{cutoff_remaining}}, {{carrier_name}}. Set fonts and colors via CSS custom properties on the widget container, e.g. --sw-promise-color: #0f766e;. The widget supports light/dark/auto themes via data-theme.Predicted dates in tracking emails
When you turn on the Promise Engine, ShipWave also stamps the predicted delivery date onto every shipment record. The standard Shopify shipping-confirmation email and the ShipWave tracking-page email both display this date as "Estimated delivery: Wed, May 22". If the package is later than predicted, the tracking page shows a delay banner automatically.
Caching and rate limits
The promise endpoint caches per (warehouse, destination ZIP, weight tier) for 10 minutes. A typical storefront with even moderate traffic will hit cache 90%+ of the time. The endpoint is rate-limited at 60 calls per second per workspace; bots and crawlers are filtered by user-agent and do not count against the cap.
FAQs
Does the widget slow down my product page?
No. The script is async and ~12 KB gzipped. The widget renders a placeholder immediately and swaps in the live promise once the API responds (usually under 100 ms).
What ZIP does it use before the shopper enters one?
It uses Cloudflare's edge geo-IP for an initial estimate, then re-renders accurately once the shopper enters a ZIP at checkout or in a ZIP-detector input.
Can I use this without Shopify?
Yes. The widget is plain JS — paste the snippet into any storefront. There is also a JSON endpoint at /api/public/promise for headless storefronts that want to render their own UI.
What if SmartRate is in fallback mode?
The widget gracefully degrades to a static "ships in N business days" promise based on your warehouse cutoff and the carrier's published transit estimate. See <a href="/help/smart-rate-shopping-overview">Smart Rate Shopping overview</a>.
More in Smart Rate Shopping
- Smart Rate Shopping overview
Use real carrier transit performance — not published transit days — to pick the cheapest rate that will actually arrive on time.
- Rate shopping profiles
Save named rate-shopping strategies (cheapest, fastest, preferred carrier with fallback) and assign them per channel or per warehouse.
- Carrier performance reports
See on-time rates by carrier, service, and lane — and how much Smart Rate Shopping has saved you this month.