Download an invoice as PDF
const url = 'https://api.emite.cr/v1/invoices/example/pdf?disposition=attachment&locale=es';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.emite.cr/v1/invoices/example/pdf?disposition=attachment&locale=es' \ --header 'Authorization: Bearer <token>'Renders the invoice as a PDF with tenant logo, QR (from clave), and CR-style layout. A signed document prints what its signed XML declares — parties, lines, taxes, totals, references and notes as they were when it was signed; a draft, which has no XML yet, prints as a preview with the current data. Logo, colors and format follow the current settings. Locale resolution: ?locale= (es|en) takes precedence; otherwise falls back to the authenticated user's preferredLocale, then to es. Hacienda-specific terminology (condicionVenta, medioPago, IVA tariffs, the MH-DGT-RES-0027-2024 legal footer) stays in Spanish regardless of locale. Each download is recorded in the audit log as invoice.downloaded.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Invoice UUID
Query Parameters
Section titled “Query Parameters”Content-Disposition: attachment (default) downloads, inline previews in-browser.
Override the PDF rendering locale
Responses
Section titled “Responses”The PDF, named after the document's consecutivo (<consecutivo>.pdf); a draft without a number is named after its id.
Headers
Section titled “Headers”attachment (default) or inline, as disposition asks, with the file name.
Invoice not found.