> ## 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.

# Files and delivery

> How Lambda obtains, stores, and sends fiscal XML and PDF files.

Lambda stores fiscal files before it treats CargoWise delivery as complete. Each file belongs to the
exact fiscal attempt and carries integrity evidence.

## File sources

| File                     | Source                                                                  |
| ------------------------ | ----------------------------------------------------------------------- |
| Stamped CFDI XML         | Facturapi                                                               |
| Detailed invoice PDF     | Facturapi, when logo synchronization is proven                          |
| Minimal invoice PDF      | Lambda, rendered from the stamped XML                                   |
| Cancellation XML         | Facturapi cancellation result, stored separately from the original CFDI |
| Cancellation receipt PDF | Facturapi, when available for the accepted cancellation                 |

Lambda does not generate a replacement XML. The stored stamped XML is the provider result.

## Design snapshot

When Lambda reserves a stamp attempt, it freezes:

* the requested **Detailed** or **Minimal** design
* the logo identity and version
* whether the logo is synchronized to the current Facturapi organization

An in-flight attempt does not change design because settings or logos change later.

Detailed uses Facturapi only when the synchronization proof is valid. If the proof is absent, stale,
or tied to another Facturapi organization, Lambda renders Minimal instead. This fallback does not
block issuance.

## Immutable storage

Stored files include size, hash, source, and design provenance. Recovery can backfill a missing file
from the exact issued evidence, but it does not replace an already stored historical file.

The cancellation XML remains separate from the original stamped XML. Cancelling a CFDI does not
overwrite the issuance file.

## CargoWise delivery

Lambda outbound sends files to CargoWise inbound using the configured target, DocManager module,
document type, and source key.

Live stamps start normal delivery after verification. Test stamps stay in the test lane and are not
sent through normal live delivery.

Each file purpose has its own delivery identity. If CargoWise inbound times out or rejects a request,
Lambda can retry the same handoff without issuing another CFDI or duplicating a completed file
allocation.

## Read each outcome separately

| Workspace evidence              | Meaning                                           |
| ------------------------------- | ------------------------------------------------- |
| SAT UUID and stamped XML stored | The CFDI exists                                   |
| PDF pending or recovered later  | Issuance succeeded; file completion is separate   |
| Delivery pending or failed      | The stored file has not reached CargoWise inbound |

If the CFDI exists and delivery fails, use [Recovery](/stamping/recovery). Do not stamp the
accounting document again.
