Calculate demurrage and detention (D&D) costs for one carrier in one country.
Use this when the user needs a detailed cost breakdown for a specific carrier. Returns free days, per-diem rates for each tariff slab, and total cost. This is the core tool for logistics cost analysis — it answers "how much will I pay if my container is detained X days?"
To compare D&D costs across all carriers at once, use shippingrates_dd_compare instead.
By default this returns carrier detention/demurrage. Pass charge_type="storage" to instead get TERMINAL port storage — a distinct charge billed by the terminal, not the carrier, and never mixed into the default D&D answer. Storage coverage is thin — only a handful of carrier/country lanes have it. Any uncovered combo returns an explicit 'no data' error (never a false $0), and that error names the lanes that ARE covered, derived live from the database rather than from a hardcoded list that would go stale.
PAID: $0.10/call via x402 (USDC on Base or Solana). Without payment, returns 402 with payment instructions.
Returns: { line, country, container_type, days, free_days, breakdown, total_cost, currency, charge_type_served, charge_family: 'carrier_dd'|'terminal_storage' }
Connector