Skip to main content

Shipping rates

Store checkout quotes shipping for each completed address. The quote comes from one of three sources, in order of preference.

Codeshipping/ (service.py → quote_rates(address, items), packing.py, carriers/ups.py, carriers/usps.py), store/fulfillment_rates.py
Runbookshipping/README.md
EnvSHIPPING_RATE_SOURCE (fulfillment default, or carriers), STORE_FALLBACK_SHIPPING_CENTS (default 599), STORE_FALLBACK_SHIPPING_LABEL, SHIPPING_RATE_CACHE_SECONDS, SHIPPING_ORIGIN_*, SHIPPING_BOXES_JSON, SHIPPING_HISTORY_RECENT_DAYS, SHIPPING_HISTORY_HALF_LIFE_DAYS, FULFILLMENT_TIME_ZONE, UPS_*, USPS_*
  • Fulfilment history (default): what the warehouse actually charged for similar shipments, weighted toward recent ones (SHIPPING_HISTORY_*), scaled by destination region. Rebuilt with rebuild_shipping_rates after import_fulfillment_shipments or the Deposco history sync.
  • Carriers: a carrier is used only when all its credentials are set. Items are packed into boxes from SHIPPING_BOXES_JSON and shipped from SHIPPING_ORIGIN_*.
  • Fallback: a single flat rate when nothing else is available.

Results carry source (fulfillment, carriers, fallback) and are cached for SHIPPING_RATE_CACHE_SECONDS.

Try a quote from the CLI:

manage.py quote_shipping --help
note

SHIPPING_RATE_SOURCE, SHIPPING_HISTORY_* and FULFILLMENT_TIME_ZONE are not in the compose x-app-env anchor yet; set them there if you change them from the defaults (known gaps).