Record a delivery attempt (RecordAttempt)
POST/routes/:routeId/attempts
Records DELIVERED, FAILED or COLLECTED for one package on an OUT_FOR_DELIVERY route and publishes DeliveryAttempted. COLLECTED is valid only for a package inducted into the wave as a PICKUP (ADR 0017, activation-gated; every induction is DELIVERY until then). Errors: ErrRouteNotStarted (409 route-not-started), ErrAlreadyDelivered (409 already-delivered). A FAILED attempt counts in the package's attempt history and re-inducts the package onto the next wave (policy RetryNextWave); the third failure publishes PackageReturnInitiated instead. The attempt that records the last outstanding package completes the route, and the last completed route completes the wave.
Request
Responses
- 201
- 400
- 404
- 409
- 422
- 500
Attempt recorded.
Response Headers
Present, with the value true, only when the answer is a replay of the stored first answer.
The request is malformed at the HTTP level. Problem types idempotency-key-required (no Idempotency-Key header), idempotency-key-invalid (not 1 to 128 printable ASCII characters), invalid-limit, invalid-cursor, unknown-query-parameter. invalid-limit is a limit outside 1 to 500, empty or repeated; invalid-cursor a cursor that is not a page token or is repeated.
The wave, route, partner or (for an attempt) the package on the route does not exist, or the path matches no route or holds a NUL character. Problem types not-found, package-not-on-route, resource-not-found.
Response Headers
Present, with the value true, only when the answer is a replay of the stored first answer.
Conflict with the aggregate's state or capacity. Problem types: illegal-transition, concurrent-update, route-over-capacity, route-not-started, already-delivered, attempt-already-recorded, package-not-inducted, package-already-routed, stop-key-mismatch, partner-inactive, partner-station-mismatch, route-incomplete. idempotency-key-reused (the Idempotency-Key was already used with a different method, path or body). ErrWaveFull (wave-full), ErrInductionClosed (induction-closed) and ErrAlreadyInducted (already-inducted) are raised only by policy-driven induction, which has no route.
Response Headers
Present, with the value true, only when the answer is a replay of the stored first answer.
Validation failed. Problem types: validation-failed (body that is not valid JSON for the operation, with an unknown field, empty, with trailing data or over 64 KiB; a NUL character in the query or body; a missing or malformed query filter; a value-object rule), invalid-wave-times (ErrInvalidWaveTimes), invalid-van-capacity (ErrInvalidVanCapacity), unknown-station (ErrUnknownStation).
Response Headers
Present, with the value true, only when the answer is a replay of the stored first answer.
Unexpected failure: problem type internal-error, detail "an unexpected error occurred". Never stored for idempotent replay.