Overview
EmiteCR is a multi-tenant electronic-invoicing platform for Costa Rica, built to Hacienda’s v4.4 specification. The API was designed API-first; the web app is one of many possible clients, and so is your product.
Base URL
Section titled “Base URL”https://api.emite.cr/v1Sandbox and production share it: the API key
decides the environment (ec_test_… or ec_live_…).
Endpoints in these docs are written with their version prefix:
POST /v1/invoices is a POST to https://api.emite.cr/v1/invoices. Requests
and responses are JSON unless noted (PDF/XML downloads return binary;
credential/logo uploads use multipart/form-data).
The emission model
Section titled “The emission model”Issuing a document is three steps, and the API exposes each one:
POST /v1/invoices— persist a draft. It has noclavenorconsecutivoyet: fiscal numbers are never spent on a draft.POST /v1/invoices/:id/sign— allocate theconsecutivoand the 50-digitclave, and XAdES-sign the XML with the company’s.p12. No call to Hacienda, so the number comes back fast.POST /v1/hacienda/submit/:id— send the signed XML to Hacienda’s ATV (signing first if step 2 was skipped).
Hacienda then processes asynchronously: the submit response means “ATV
received it”, not “accepted”. The document later reaches a final state
(accepted / rejected) which you learn about by
polling or webhooks.
The quickstart walks the whole path with
curl; Create an invoice has the full payload.
Response shape
Section titled “Response shape”- Success — the resource directly (
InvoiceResponseDto,PartyDto, …); no envelope. Lists return{ items, total, page, pageSize }. - Error — a structured envelope:
{ "error": { "code": "RECEIVER_REQUIRED_FOR_FE", "messageKey": "errors.RECEIVER_REQUIRED_FOR_FE", "message": "A receiver is required for Factura Electrónica." }, "requestId": "5f8a…", "timestamp": "2026-05-13T12:00:00.000Z", "path": "/v1/invoices"}Branch on error.code — it’s the canonical, stable identifier. Some errors add
params (values for the message, such as the missing scope) or details (the
fields that failed validation). The main codes, by area, are in the
error reference.
Hacienda terminology
Section titled “Hacienda terminology”Many field names are Hacienda’s own terms, in Spanish: clave, consecutivo,
and in a line’s taxes codigo, codigoTarifa, tarifa and monto. They are
domain terms, not UI labels, and they stay Spanish even in this English
documentation. Other fields carry an English name for an XSD concept —
saleCondition (CondicionVenta), paymentMethods (MedioPago),
exchangeRate (TipoCambio) — so take each name from the
API reference, not from the XSD. Payloads never get
“translated”.
Where to go next
Section titled “Where to go next”- Quickstart — from an API key to an accepted document.
- Authentication — API keys, scopes, rotation.
- Environments — sandbox vs production.
- API reference — every endpoint, generated from the live OpenAPI spec.