Skip to main content
GET
Download the raw CFDI XML for an invoice
Returns the raw CFDI XML file for a stamped invoice as a downloadable attachment, rather than embedding it in a JSON response like Get Invoice does. Like Cancel Invoice, this is a flat route — it does not carry /organizations/{organizationId}/ in the URL. The invoice’s uuid (its folio fiscal, globally unique across all organizations) is enough to resolve the owning organization server-side, combined with the caller’s own auth context (session or API key).

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_...) with the read:invoices scope — the key’s own organization must match the invoice’s organization, or the request is rejected with 403 Forbidden.

Path Parameters

Example Request

cURL
TypeScript SDK

Example Response

This endpoint does not return a JSON body — it streams the raw XML file with:
If you need the XML alongside other invoice metadata (type, series, total, etc.) in a single JSON payload, use Get Invoice instead — it returns the same XML content inline as the xml field.

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.

404 Not Found

uuid does not match any invoice.

Authorizations

X-API-Key
string
header
required

API Key for authentication (format: sk_...)

Path Parameters

uuid
string
required

Folio fiscal UUID of the invoice

Response

The raw CFDI XML file

The response is of type string.