Download PDF
GET /api/v1/facturas/{clave}/pdf
Regenerates the document’s PDF on the fly and returns it with Content-Type: application/pdf. Useful for sending to the customer, accounting archives, or backup.
Authentication
| Attribute | Value |
|---|---|
| Required scope | facturas:read |
Response
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="50615012600310112345600100001010000000123456789012.pdf"
Content-Length: 124567(PDF bytes)
Notes
The PDF is regenerated every time (it isn’t cached), so it always reflects the most recent state:
- Changes to the tenant’s logo.
- Changes to the customer’s data (if updated after issuance).
- The document’s current status with Hacienda (if it has already been accepted, the corresponding stamp is shown).
Errors
| Code | Meaning |
|---|---|
404 Not Found | The key doesn’t exist for the API key’s tenant. |
500 Internal Server Error | Failed to generate the PDF (corrupted logo, missing data in the document, etc.). |