Download XML
GET /api/v1/facturas/{clave}/xml
Returns the original signed XML (XAdES), bit-for-bit identical to what was sent to Hacienda. It is the official evidence of the document for tax audits and for accounting systems that parse XML.
Authentication
| Attribute | Value |
|---|---|
| Required scope | facturas:read |
Response
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Disposition: attachment; filename="50615012600310112345600100001010000000123456789012_Firmado.xml"(XAdES XML)
When to use it
- Tax audits — the signed XML is the official evidence before Hacienda (Costa Rica’s tax authority).
- Syncing with accounting systems that consume XML.
- Signature verification by third parties (experts, oversight bodies, etc.).
Notes
- Right after issuance, this endpoint can return
404for a few seconds. Signing and uploading the XML happen in the background: there is a short window between the201of the issuance and the moment the file becomes available. If you download it immediately, retry; it’s best to wait for the webhook, which arrives once the document has been resolved. - If the document ended up in
errorstatus and was never signed, the404is permanent. - The XML is never modified: it is bit-for-bit identical to what was sent to Hacienda.
- The acknowledgment signed by Hacienda is a different document, downloaded separately: see Download the Hacienda message.
- The same endpoint exists for purchase invoices, with the same behavior: see Download purchase invoice XML.
Errors
| Code | Meaning |
|---|---|
404 Not Found | The key doesn’t exist or the XML hasn’t been generated yet. |