---
title: "Download and send the invoice | Timbro"
description: "Download the signed XML and the PDF, or ask Timbro to email the invoice"
canonical: "https://timbro.do/en/docs/comprobantes/entregar-comprobante/"
---

Invoice

# Download and send the invoice

After the DGII accepts the invoice, Timbro prepares two files: the XML, which is the signed e-CF, and the PDF, which is its printed representation. Each file has its own status, so an accepted invoice can still have its PDF in preparation.

## Download the files

Retrieve the invoice and download each file when its status is `ready`:

- [TypeScript](https://timbro.do/en/docs/comprobantes/entregar-comprobante/#tab-panel-0-0)
- [Python](https://timbro.do/en/docs/comprobantes/entregar-comprobante/#tab-panel-0-1)

```ts
import { createTimbroInvoices } from "@timbro/invoices";

const timbro = createTimbroInvoices({ apiKey: process.env.TIMBRO_INVOICES_API_KEY! });
const invoiceId = "11111111-1111-4111-8111-111111111111";
const invoice = await timbro.invoices.retrieve(invoiceId);
if (!invoice) throw new Error("Invoice not found");

if (invoice.files.xml.status === "ready") {
  const xml = await timbro.invoices.downloadXml(invoice.id);
}
if (invoice.files.pdf.status === "ready") {
  const pdf = await timbro.invoices.downloadPdf(invoice.id);
}
```

`invoices.retrieve` raises `NotFoundError` when the invoice does not exist. Each download returns the file in `content`:

```python
import os

from timbro_invoices import TimbroInvoices

timbro = TimbroInvoices(api_key=os.environ["TIMBRO_INVOICES_API_KEY"])
invoice_id = "11111111-1111-4111-8111-111111111111"
invoice = timbro.invoices.retrieve(invoice_id)

if invoice["files"]["xml"]["status"] == "ready":
    xml = timbro.invoices.download_xml(invoice["id"])
if invoice["files"]["pdf"]["status"] == "ready":
    pdf = timbro.invoices.download_pdf(invoice["id"])
```

The SDK only returns a file after checking that its bytes match the invoice Timbro names in the response headers. Store the bytes exactly as you receive them. If a file is still pending, retrieve the invoice later or wait for the `invoice.ready` webhook; do not issue it again.

## Email the invoice

Timbro or your system emails the invoice to the customer, never both. If your system already sends it, do not ask Timbro to send it too.

For Timbro to send it, request delivery with the customer’s email. Use an idempotency key derived from a record in your system, and reuse it if you need to repeat the request:

- [TypeScript](https://timbro.do/en/docs/comprobantes/entregar-comprobante/#tab-panel-1-0)
- [Python](https://timbro.do/en/docs/comprobantes/entregar-comprobante/#tab-panel-1-1)

```ts
const delivery = await timbro.invoices.deliver({
  invoiceId,
  recipientEmail: "buyer@example.com",
  idempotencyKey: "sale-842-email-1",
});
const deliveryStatus = await timbro.invoices.retrieveDelivery({
  invoiceId,
  deliveryId: delivery.id,
});
```

```python
delivery = timbro.invoices.deliver(
    invoice_id,
    {"recipientEmail": "buyer@example.com"},
    idempotency_key="sale-842-email-1",
)
delivery_status = timbro.invoices.retrieve_delivery(invoice_id, delivery["id"])
```

With HTTP, use `POST /v1/invoices/{invoiceId}/deliveries` with the `Idempotency-Key` header and the body `{ "recipientEmail": "buyer@example.com" }`, and retrieve the result with `GET /v1/invoices/{invoiceId}/deliveries/{deliveryId}`. To choose which files are attached, send `attachments: { "pdf": true, "xml": true }`.

Timbro sends the email after the DGII accepts the invoice. The `invoice.deliverySent` and `invoice.deliveryFailed` webhooks carry the `deliveryId` you must retrieve. A saved request does not confirm that the email arrived. If sending fails, the invoice is still valid; check the delivery result before asking for another one.

If the customer will pay with Timbro, you can also state the email when you create the payment, with `invoicing.recipientEmail`.

Share the invoice with another Timbro server

If you issue your invoices on a dedicated Timbro server and want to collect them with `https://api.timbro.do`, create a shared invoice on your server: limited access that allows reading the invoice’s data and downloading its PDF, but not its signed XML or its diagnostics.

- [TypeScript](https://timbro.do/en/docs/comprobantes/entregar-comprobante/#tab-panel-2-0)
- [Python](https://timbro.do/en/docs/comprobantes/entregar-comprobante/#tab-panel-2-1)

```ts
const access = await timbro.invoices.shareReceipt(invoiceId);
const receipt = await timbro.invoices.retrieveReceipt(access);
const receiptPdf = await timbro.invoices.downloadReceiptPdf(access);
```

```python
access = timbro.invoices.share_receipt(invoice_id)
receipt = timbro.invoices.retrieve_receipt(access)
receipt_pdf = timbro.invoices.download_receipt_pdf(access)
```

Send `access` to the other system over a protected channel and store its `accessToken` as a secret. [Collect an invoice you already issued](https://timbro.do/en/docs/comprobantes/cobrar-una-factura/) shows how the payment uses that access.

[Previous\
Issue an invoice from your system](https://timbro.do/en/docs/comprobantes/facturar-desde-pos-erp/)[Next\
Correct or void an invoice](https://timbro.do/en/docs/comprobantes/corregir-ecf/)

Sell, serve your customers, and collect payments from your phone

© 2026 Timbro. All rights reserved

[Español](https://timbro.do/docs/comprobantes/entregar-comprobante/)[English](https://timbro.do/en/docs/comprobantes/entregar-comprobante/)

## Products

[Invoicing](https://timbro.do/en/facturacion-electronica/)[Serve](https://timbro.do/en/atiende/)[Collect](https://timbro.do/en/pagos/)[Portal Timbro](https://timbro.do/en/portal-timbro/)[Integrations](https://timbro.do/en/integraciones/)[Cuenta Timbro](https://timbro.do/en/cuenta-timbro/)[Pricing](https://timbro.do/en/precios/)

## Developers

[SDKs and API](https://timbro.do/en/desarrolladores/)[Documentation](https://timbro.do/en/docs/)[API reference](https://timbro.do/en/docs/reference/payments/)

## Company

[INDEXA, the company behind Timbro](https://indexa.do/)[Presentations](https://timbro.do/en/presentaciones/)

## Help

[How to start](https://timbro.do/en/como-empezar/)[Electronic invoicing guide](https://timbro.do/en/guias/facturacion-electronica-republica-dominicana/)[Contact](https://timbro.do/en/contacto/)<hola@timbro.do>

## Legal

[Business Terms](https://timbro.do/en/politicas/negocios/)[Terms of use](https://timbro.do/en/politicas/uso/)[Privacy](https://timbro.do/en/politicas/privacidad/)[Security](https://timbro.do/en/politicas/seguridad/)[All documents](https://timbro.do/en/politicas/)
