Skip to content

OnTrac Shipping

The ext_ontrac extension adds OnTrac as a shipping carrier: it registers a rate-quote strategy under the carrier code ontrac for OnTrac's single service, Ground. It ships with a client for the OnTrac ServicesAndCharges v3 JSON API plus a built-in weight-based fallback rate, and auto-seeds the Ground method when you create an OnTrac shipping provider. Use it when you ship with OnTrac and want OnTrac Ground offered as a checkout shipping option.

At a glance

Extension id ontrac
Category shipping
Version 0.0.1
Provides Shipping carrier strategy (ontrac), carrier method auto-seeding
External account None currently usable — an OnTrac ServicesAndCharges API client exists, but no configuration surface supplies credentials (see Operational notes)

What It Provides

  • A ShippingCalculatorStrategy registered as ontrac (see Building Extensions for the strategy surface). OnTrac only offers Ground service, so a single method is quoted:

    Method code Service OnTrac code Est. days
    ground OnTrac Ground GRND 2–5
  • Carrier method auto-seeding — creating a shipping provider with carrier code ontrac seeds the OnTrac Ground method as a live-rate method (no flat rate set), so it is dispatched to the strategy at quote time.

  • Quotes surface through the storefront shippingRatesForCheckout GraphQL query, which routes every zone-assigned method without a flat rate to the carrier strategy matching the provider's carrier code.

Setup

  1. Once installed (or dev-linked in development), the extension is discovered at startup via its ontrac entry point. Per-channel enablement is managed under Settings > Extensions.
  2. Create a provider under Settings > Shipping > Providers with carrier code ontrac (the admin form maps the extension to this carrier code and pre-fills the Ground method). Creating the provider auto-seeds the method; this requires the settings.edit permission.
  3. Assign the seeded method to shipping zones under Settings > Shipping > Zones — only enabled methods assigned to an enabled zone are quoted.
  4. Optionally scope the provider to specific channels and set a per-method rate adjustment (fixed amount and/or percent). See Shipping & Fulfillment for the provider / zone / method model.

Configuration Reference

The manifest declares no config_schema; there are no extension-level settings. Carrier setup lives on the shipping provider and its method under Settings > Shipping > Providers. The strategy class accepts OnTrac Web Services credentials (wsid, wskey) as constructor parameters, but no configuration path currently populates them — see the warning below.

Operational Notes

Live rates are not currently wired to credentials

The strategy is instantiated at boot with empty wsid/wskey, and no admin or provider configuration feeds credentials into it. The live OnTrac API path is therefore unreachable in practice: all quotes come from the built-in fallback rate. The live client only runs when both credentials are present, and any API failure logs a warning and falls back.

  • Live API shapePOST https://ws.ontrac.com/Method/ServicesAndCharges/v3/json/{wsid}/{wskey} with a 10-second timeout; note the credentials are embedded in the URL path. The request always sends Residential: true, and the quoted rate is the sum of all charge amounts returned for the GRND service.
  • Fallback rate7.99 + 0.45 × total package weight, quoted as a single OnTrac Ground rate (2–5 days).
  • Seeding is create-time onlyseed_carrier_methods short-circuits when the provider already has any methods; deleted methods are not re-created on save.
  • Rate adjustments apply per method to live quotes too: final = base + amount + base × percent / 100, floored at 0.
  • No prepaid-label purchase — the strategy does not implement purchase_label, so return-label flows (RMA) cannot use it.

Source: ext_ontrac/extension.py — in the enterprise-extensions repo.