Download the raw CFDI XML for an invoice
Invoices
Download Invoice XML
Authenticate with either a Supabase session (member of the invoice’s organization) or an API key with the read:invoices scope belonging to that same organization. Returns the raw CFDI XML file as a download (Content-Type: application/xml), not a JSON envelope.
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 theread:invoicesscope — the key’s own organization must match the invoice’s organization, or the request is rejected with403 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 theread:invoices scope / belongs to a different organization than the one that owns the invoice.
404 Not Found
uuid does not match any invoice.