Shipping Rates
Calculate shipping rates for an order.
Updated
On this page
Overview
Fetch real-time shipping rate quotes from the organization's active shipping provider — a direct UPS or FedEx account, or ShipStation (which brokers rates from whatever carriers are connected in the merchant's ShipStation account).
SDK Usage
import dash from "@/lib/dash"
const { rates } = await dash.shipping.getRates({
to_postal: "78701",
to_state: "TX",
to_country: "US",
weight_oz: 5.0,
})
// rates = [
// { serviceName: "UPS Ground", carrierCode: "ups", shipmentCost: 8.50, transitDays: 5 },
// { serviceName: "FedEx 2Day", carrierCode: "fedex", shipmentCost: 12.99, transitDays: 2 },
// ]
// (carrierCode reflects the org's active provider: "ups", "fedex", or whatever carrier ShipStation used)