Skip to main content
Retry is native to stamping. The normal path owns day-to-day work: CargoWise → Lambda → Facturapi → back to CargoWise. Recovery and correction only engage when that path stalls or must continue with proof.

Mental model

Two ideas stay separate on purpose: Automatic recovery is not a “retry kind.” It does not create a corrective run. When budgets are exhausted, the document becomes a system error and support uses a fresh corrective plan.

Evidence before mutation

Lambda treats the original CargoWise capture as immutable accounting evidence. The invoice row is Lambda’s current claim. Before a corrective retry mutates anything, the system asks:
  1. Is this document already successful, cancelled, in flight, or waiting on a parent?
  2. Does policy allow a stamp retry for the active classification?
  3. Can we resume the exact stored attempt, or must we reprocess from the original capture?
  4. For failed documents: is there proof the fiscal projection changed, or that an approved prerequisite was corrected?
If any answer fails the safety gate, retry blocks. See Safety rules.

Preview, then apply

Corrective retries are plan-bound:
  1. Preview recomputes what would happen and returns a deterministic plan hash.
  2. Apply recomputes under lock and only proceeds if that exact hash still matches.
  3. A private reason is stored on the ops run. It is not copied into customer notifications.
Stale previews fail closed. Duplicate requests for the same active operation return the same run instead of starting another.

Strategies in one line

  • Resume attempt — continue the exact stored Facturapi request and idempotency key.
  • Reprocess source — remap the original capture with current Lambda code and create one new attempt only when the prior create never produced a provider invoice.
Details: Strategies.

Who owns what during recovery

Stamp success and CargoWise delivery stay separate. Delivery retries never re-stamp.

Where this sits in stamping