Skip to Content
v1.5Official documentation for the LX CloudPos API · stable in production
v1.5 (current)Endpoint referenceDownload the Hacienda message for purchase invoices

Download the Hacienda message for purchase invoices

GET /api/v1/facturas-compra/{clave}/respuesta

Returns the Hacienda response XML for the purchase invoice: the acknowledgment signed by the Ministry stating whether the document was accepted or rejected, and for what reason. Same behavior as GET /facturas/{clave}/respuesta, applied to the 08-type key space.

It is a different document from the one obtained in Download purchase invoice XML — that one corresponds to the document itself, signed by whoever issued it — and this is the one that serves as proof in an audit that Hacienda received it and what it resolved.

Authentication and permissions

AttributeValue
SchemeAPI key (X-Api-Key)
Required scopefacturas-compra:read

Responses

200 OK

HTTP/1.1 200 OK Content-Type: application/xml Content-Disposition: attachment; filename="50615012600310112345600100001080000000123456789012_Respuesta.xml"

202 Accepted — no response yet

{ "mensaje": "El comprobante existe pero Hacienda todavía no ha respondido." }

Hacienda’s acknowledgment arrives asynchronously, minutes after issuance. This status means “no response yet; retry later,” not “doesn’t exist” — that’s why it isn’t a 404.

404 Not Found

{ "error": "Comprobante no encontrado." }

The key doesn’t correspond to any purchase invoice for the tenant, or it corresponds to a document that isn’t of type 08.

Operational notes

  • A rechazada (rejected) purchase invoice does have a response: the XML is exactly where Hacienda explains the reason for the rejection. 202 doesn’t mean rejection, it means Hacienda hasn’t answered yet.
  • The acknowledgment arrives automatically, with no need to request it. See also Download the Hacienda message for the same behavior on the sales side.