Artifacts, delivery, and corrections
An available artifact has a stable reference, type, revision, digest, and generation date. Fetch the official PDF from the authenticated endpoint; never rebuild bytes or publish storage identity:
import { createTimbroPayments } from "@timbro/payments";
const secretKey = process.env.TIMBRO_PAYMENTS_SECRET_KEY;if (!secretKey) throw new Error("Missing TIMBRO_PAYMENTS_SECRET_KEY");const timbro = createTimbroPayments({ secretKey });const artifact = await timbro.fiscalDocuments.retrievePrintedRepresentation("fiscal_document_123");const pdf = artifact.bytes;Deliver links with appropriate scope and expiry; never expose another purchase’s files or log PDF contents.
Fiscal corrections create an auditable relationship to the original document. Do not silently edit an issued e-CF or present a corrected view as the original document.
Only a rejected revision can be corrected. Send a new revision with POST /v1/fiscal_documents/{fiscalDocumentId}/corrections and an idempotency key; an issued revision is terminal. Preserve the relationship between the original and new revision in your system.