Skip to main content

Journeys

Package journeys (aggregate PackageJourney).

📄️Record one scan on a package journey (RecordScan)

RecordScan over REST. Scans apply in time order; an older scan is stored but does not move the state (409 scan-out-of-order, the scan is kept with applied=false). A scan whose scanType has no edge from the current state is stored with applied=false and answers 409 illegal-transition. A known scanId answers 409 duplicate-scan and stores nothing. A closed journey answers 409 journey-closed. The two refusals that keep the scan (scan-out-of-order, illegal-transition) are stored under the Idempotency-Key together with the scan, so a retry under the same key replays the refusal and never answers duplicate-scan.

📄️Report one external carrier event (ReportCarrierEvent, ADR 0015)

The carrier webhook of CARRIER_HANDOFF service areas. Unauthenticated by the standing fleet decision, exactly like POST /journeys/{trackingNumber}/scans (the per-carrier token scheme is a recorded follow-up). Each report becomes one scan with scanId '<carrierId>:<carrierEventId>', so a re-sent report answers 409 duplicate-scan. PICKED_UP is the handoff at the journey's handoff node (a journey already WITH_CARRIER is a no-op that answers 200); OUT_FOR_DELIVERY, DELIVERED and DELIVERY_FAILED become their scans; IN_TRANSIT is accepted and counted without a scan. A refusal that keeps the scan (scan-out-of-order, illegal-transition) is stored under the Idempotency-Key together with the scan and replayed on a retry.