Shipping Analysis and Optimization
Geographic Cost Analysis
- Confirm origin address, destination list (or use representative cities), and parcel details.
- Call
ListCarrierAccounts to see configured carriers.
- Call
CreateShipment per destination to collect rates. Creating shipments is free; only CreateTransaction costs money.
- Write results to
analysis/ directory (markdown report + CSV). Columns: Route, Destination, Carrier, Service, Cost, Currency, EstimatedDays, Zone.
Package Optimization
- Confirm the route.
- Define dimension profiles to test (or use user-provided ones).
- Check
ListCarrierParcelTemplates and ListUserParcelTemplates for flat-rate and saved templates. See shippo/references/rate-shopping-guide.md for dimensional weight and flat-rate guidance.
- Call
CreateShipment per profile on the same route.
- Compare: cheapest rate, carrier options, fastest option per profile. Note where flat-rate templates beat custom dimensions and where dimensional weight causes price jumps. See
shippo/references/carrier-guide.md for carrier-specific weight limits and surcharges.
Carrier Comparison
- Call
CreateShipment for the route.
- Group the
rates array by provider.
- Per carrier: cheapest service, fastest service, number of service levels, price range.
Historical Cost Optimization
- Call
ListShipments and ListTransactions to get past activity.
- Cross-reference: what the user paid vs. what alternatives were available.
- Identify patterns: carrier concentration, service-level mismatch, consistent overpayment.
- For a sample of shipments with tracking numbers, call
GetTrack to check actual vs. estimated delivery times.
- If fewer than 5 successful transactions exist (not just shipments -- shipments are rate quotes, transactions represent actual spend), redirect to forward-looking analysis.
Output Conventions
Write reports to the analysis/ directory. Create it if it does not exist. Include both markdown and CSV. CSV must have a header row. Markdown must include a timestamp and input parameters.
Quick Reference
Cost analysis:
ListCarrierAccounts -> CreateShipment (per destination) -> read rates arrays -> write report
Carrier comparison:
CreateShipment -> group rates by provider -> summarize
Historical review:
ListShipments + ListTransactions -> cross-reference -> GetTrack (sample) -> write report