Demurrage/Detention Free-Time Countdown
shippingrates_dd_countdownGiven a container's carrier, country, container type and ARRIVAL DATE, report how many free days remain, the first chargeable day, the per-diem once charging starts, cost accrued so far, and a forward cost projection.
Use this to answer "how long until this container starts costing demurrage, and how much per day?" — the proactive companion to shippingrates_dd_calculate (which answers a fixed number of days). Same underlying tariff engine, so the numbers agree.
The free-time clock starts at the carrier-defined event (port discharge or ICD rail arrival) — the arrival_date is taken as supplied, not carrier-confirmed (data_basis = user_supplied_arrival).
Pass charge_type="storage" for a TERMINAL storage countdown instead of carrier D&D (thin coverage — see charge_type param). The response's charge_family field ('carrier_dd' | 'terminal_storage') always discloses which one answered the request.
PAID: $0.10/call via x402 (USDC on Base or Solana). Without payment, returns 402 with payment instructions.
Returns: { free_days_total, days_elapsed, free_days_remaining, free_time_ends_on, status, accrued_cost, current_daily_rate, currency, forecast[] }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Shipping line slug — maersk, msc, cmacgm (or cma-cgm), hapag-lloyd, one, cosco, zim, evergreen, yangming, hmm, arkas, oocl, pil | |
| port | No | Optional UN/LOCODE to pin a port-specific tariff (some lanes price ports differently, e.g. north vs south China) | |
| country | Yes | ISO 2-letter country code (e.g. IN, AE, SG) | |
| direction | No | import or export (default import) | |
| x_payment | No | x402 payment proof header (optional — required for paid access) | |
| charge_type | No | Override the charge type; default is the engine's detention→demurrage→combined priority. 'storage' is a distinct TERMINAL charge (not carrier D&D) and is ONLY ever returned when explicitly requested here. Coverage is thin; an uncovered lane returns an explicit 'no data' error listing the currently-covered lanes. | |
| arrival_date | Yes | Container arrival date, YYYY-MM-DD — starts the free-time clock | |
| container_type | Yes | ISO 6346 container type — 20GP, 40GP, 40HC, 20RF, … |