Poll Hacienda for the current document status
const url = 'https://api.emite.cr/v1/hacienda/status/50601012600310112345600100001010000000001110000000';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/hacienda/status/50601012600310112345600100001010000000001110000000 \ --header 'Authorization: Bearer <token>'Queries ATV /recepcion/:clave for the latest status. Use this when waiting for Hacienda to finalize processing of a previously submitted invoice. ATV states: recibido (received), procesando (in flight), aceptado (final accepted), rechazado (final rejected). Recommended polling: exponential backoff starting at 5s, max 60s, ceiling 24h (the job queue does this server-side already; this endpoint is for clients that prefer pull).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
5060101260031011234560010000101000000000111000000050-digit Hacienda key (clave). Stable across invoice retries.
Responses
Section titled “Responses”Current ATV status snapshot
object
50-digit Hacienda key of the document.
The emission instant the document declares (<FechaEmision>).
Hacienda's state. A submit answers recibido (received, not yet judged); the verdict (aceptado / rechazado) arrives later — read it from the invoice, the status endpoint or the webhooks.
Hacienda's response XML (MensajeHacienda), base64-encoded. Present once Hacienda has judged the document.
On a submit, the HTTP status of Hacienda's acknowledgement (HTTP 202). Once Hacienda has judged the document, its DetalleMensaje — the reason of a rejection.
Example
{ "indEstado": "recibido"}Missing or invalid JWT / API key
Clave unknown in this tenant.
ATV unreachable. Retry later.