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

# Download Cancellation Receipt

Returns the SAT cancellation receipt (*acuse de cancelación*) XML, decoded, for an invoice whose cancellation was accepted, as a downloadable attachment. Like [Download Invoice XML](https://docs.timbrix.mx/api-reference/invoices/download-xml.md), this is a **flat** route — it does not carry `/organizations/{organizationId}/` in the URL. The invoice's `uuid` (its folio fiscal) is enough to resolve the owning organization server-side, combined with the caller's own auth context (session or API key).

The response is XML only.

## Authentication

Accepts **either**:

* A Supabase Bearer session (`Authorization: Bearer <token>`) — the authenticated user must be a member of the invoice's organization.
* An API key (`X-API-Key: sk_test_...`) with the `read:invoices` scope — the key's own organization must match the invoice's organization, and the key's environment (sandbox or production) must match the invoice's, or the request is rejected with `403 Forbidden`.

## Path Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `uuid` | string (UUID) | Yes | Folio fiscal UUID (`uuidFiscal`) of the cancelled invoice |

## Example Request

```bash cURL theme={null}
curl -X GET https://api.timbrix.mx/invoices/d3bfbc57-44af-4390-a064-f0afab85e5df/cancellation-receipt \
  -H "Authorization: Bearer <your_token>" \
  -o acuse-cancelacion.xml
```

```typescript TypeScript SDK theme={null}
// Returns a Blob — write it to disk or hand it to the browser as a download.
const receipt = await timbrix.invoices.downloadCancellationReceipt(
  "d3bfbc57-44af-4390-a064-f0afab85e5df"
)
```

```bash CLI theme={null}
timbrix invoices cancellation-receipt d3bfbc57-44af-4390-a064-f0afab85e5df \
  --output acuse-cancelacion.xml
```

## Example Response

This endpoint does not return a JSON body — it streams the raw XML file with:

| Header | Value |
| - | - |
| `Content-Type` | `application/xml` |
| `Content-Disposition` | `attachment; filename="acuse-cancelacion-<uuidFiscal>.xml"` |

The body is the decoded acuse XML (Timbrix stores it as the PAC returned it and decodes it for download). Abbreviated example (*abreviado*):

```xml theme={null}
<Acuse Fecha="2026-11-20T10:15:32" RfcEmisor="EKU9003173C9">
  <Folios>
    <UUID>D3BFBC57-44AF-4390-A064-F0AFAB85E5DF</UUID>
    <EstatusUUID>201</EstatusUUID>
  </Folios>
  <Signature>...</Signature>
</Acuse>
```

> [!NOTE]
>
> Timbrix stores the receipt the SAT returned when it received the cancellation
> request and does not replace it when the request is later marked accepted: the
> receiver's response produces no new receipt in Timbrix. If the SAT answered
> 202 (the CFDI was previously cancelled), the receipt may correspond to the
> earlier cancellation. To follow the status of a request, use [List Invoice
> Cancellations](https://docs.timbrix.mx/api-reference/invoices/list-cancellations.md).

## Common Errors

### 401 Unauthorized

Missing or invalid Bearer token / API key.

### 403 Forbidden

The authenticated user is not a member of the invoice's organization, or the API key does not have the `read:invoices` scope / belongs to a different organization than the one that owns the invoice. An API key whose environment differs from the invoice's is rejected with the code `ENVIRONMENT_MISMATCH`.

### 404 Not Found

`uuid` does not match any invoice.

### 409 Conflict

| Code | Message | Meaning |
| - | - | - |
| `CANCELLATION_NOT_ACCEPTED` | Esta factura no tiene una cancelación aceptada, así que todavía no hay acuse. | The invoice has no accepted cancellation yet (it is still active, pending the receiver, or was rejected). |
| `CANCELLATION_RECEIPT_UNAVAILABLE` | La cancelación está aceptada, pero no hay un acuse del SAT disponible para esta solicitud (por ejemplo, cuando el CFDI ya estaba cancelado). | The cancellation is accepted but no SAT receipt is available for that request, so there is nothing to download. |

## Audit Log

Each successful download is recorded in the [audit log](https://docs.timbrix.mx/audit-log.md) as `cfdi.cancellation_receipt_downloaded`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.