> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaantonio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retry strategies

> Resume an exact stamp attempt, or remap the original capture once under current Lambda code.

Every allowed stamp retry resolves to one of two strategies. Operators do not pick the strategy. Lambda derives it from durable provider evidence and what is still safe to do.

## Resume attempt

**Resume** continues the exact stamp attempt Lambda already prepared.

Use this when Facturapi may already have seen the request, or when the create outcome is uncertain. The same private body and the same idempotency key continue. That is how Lambda avoids creating a second CFDI for the same work.

<AccordionGroup>
  <Accordion title="When resume is chosen">
    Typical cases: the provider invoice is known to exist and still needs finalization, or the
    create outcome is unknown and the exact request snapshot is still available.
  </Accordion>

  <Accordion title="What resume never does">
    It never remaps a newer CargoWise capture into a different body. Uncertainty is not “fixed” by
    inventing a new attempt.
  </Accordion>

  <Accordion title="What success looks like">
    The existing attempt finishes. Terminal stamp or webhook events remain the fiscal truth — retry
    itself is not a second stamp event.
  </Accordion>
</AccordionGroup>

## Reprocess source

**Reprocess** remaps the **original** immutable CargoWise capture with the Lambda code that is deployed now, then creates **one** new attempt.

Use this when Lambda can prove the prior create never produced a provider invoice (`not started` or `known not created`). The fiscal projection may change because the mapping or reconcile path changed — that is intentional only when evidence allows it.

<AccordionGroup>
  <Accordion title="When reprocess is chosen">
    The prior create is proven unused, and the original capture still exists. Corrective categories
    such as a Lambda version fix or source correction often land here.
  </Accordion>

  <Accordion title="What reprocess never does">
    It does not edit the original capture. It does not batch-rewrite many invoices under one hash.
    It does not open a new attempt when the provider may already have created the invoice.
  </Accordion>

  <Accordion title="What success looks like">
    Exactly one new attempt and key. Timeline evidence points back at the original CargoWise event,
    not at a synthetic replacement capture.
  </Accordion>
</AccordionGroup>

## Side by side

|                 | Resume attempt                           | Reprocess source                     |
| --------------- | ---------------------------------------- | ------------------------------------ |
| Body            | Exact stored request                     | Remapped from original capture       |
| Idempotency     | Same key                                 | New key for the new attempt          |
| Provider risk   | Continues known or uncertain work safely | Only when create never happened      |
| Typical trigger | Stuck finalization, uncertain create     | Mapper/reconcile fix, unused attempt |

## Known created vs unknown

If Facturapi already created the invoice, Lambda **retrieves and finalizes** that invoice. It does not create again.

If the create outcome is **unknown**, Lambda must resume the exact request. Remapping uncertainty into a new attempt is blocked — that is a core safety rule, not a soft preference.

## After either strategy

1. Inspect the invoice timeline and active notes.
2. Confirm stamp completion or a clear failure classification — not another open retry.
3. Treat CargoWise delivery as a separate follow-up if XML/PDF still need to arrive.

Next: [Safety rules](/stamping/retry/safety) for hard blocks, and [Recovery paths](/stamping/retry/paths) for how people interact with each lane.
