Lookup a taxpayer by Hacienda identification number
const url = 'https://api.emite.cr/v1/hacienda/lookup?identification=3101123456';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/lookup?identification=3101123456' \ --header 'Authorization: Bearer <token>'Looks the number up in Hacienda's public taxpayer registry (https://api.hacienda.go.cr/fe/ae?identificacion=X), to prefill a contact or a company with its name, identification type and economic activities. Each answer is cached server-side for one hour. The registry is often slow or unavailable: on a 424 or a 429, fall back to manual entry. An alphanumeric cédula jurídica (decreto 44648-MJ) is forwarded as well; on 2026-11-28 the registry still refused one (HTTP 403), which reaches you as the 424.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Example
31011234569-12 digit identification number, or an alphanumeric cédula jurídica (4 digits and 6 letters or digits).
Responses
Section titled “Responses”object
The identification number that was looked up, as sent.
Identification type as the registry reports it (01 física, 02 jurídica, 03 DIMEX, 04 NITE) — the identificationType to register the contact or company with.
Name in the registry (the razón social of a company) — prefill name with it rather than asking for it.
Tax regime in the registry.
object
Code of the taxpayer's tax regime in the registry; null when it gives none.
Name of that regime as the registry writes it (Spanish); null when it gives none.
Standing in the registry.
object
The registry lists the taxpayer as registered (inscrito) with Hacienda.
The registry flags the taxpayer as in arrears with Hacienda (moroso).
The registry flags the taxpayer as having missed tax filings (omiso).
The economic activities the registry lists for the taxpayer (an entry without code or name is left out); let the user pick the default among them.
object
Activity code as the registry gives it, in its dotted form — the value for economicActivityCode.
Name of the activity as the registry writes it (Spanish).
The registry marks it as the taxpayer's primary activity (tipo P).
The registry lists the activity as active (estado A).
Example
{ "identification": "3101123456", "identificationType": "02", "regimen": { "code": 1, "description": "Régimen General" }, "economicActivities": [ { "code": "6201.0" } ]}Missing identification, or neither 9–12 digits nor an alphanumeric cédula jurídica.
Identification unknown in Hacienda's registry.
HACIENDA_LOOKUP_UNAVAILABLE: the registry could not be reached, answered an error or returned something that is not JSON.
Hacienda is throttling registry lookups.