Global search across invoices, contacts, items, proformas, received documents and recurring schedules
const url = 'https://api.emite.cr/v1/search?q=Ferreteria%20El%20Roble&limit=5';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/search?q=Ferreteria%20El%20Roble&limit=5' \ --header 'Authorization: Bearer <token>'Backs the command palette. The term is interpreted by SHAPE — a 50-digit string is a clave (exact match), 9-12 digits an identification number, other digit runs a consecutivo / CAByS / barcode, anything else human text — and only the sources that shape can match are queried. Text matching is accent-insensitive and per-word, in any order; when the strict pass finds nothing anywhere, a single approximate retry runs and the response is flagged fuzzy. Each group is capped (default 5, max 10) and reports truncated instead of a total — no counts are computed. Groups the caller lacks the RBAC scope or plan feature for are never queried and never appear. Environment-scoped rows (invoices, received documents, schedules) are restricted to the caller's active environment.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Example
Ferreteria El RobleFree-text term. Interpreted by shape: a 50-digit string is a Hacienda clave (exact match), 9-12 digits an identification number, other digit runs a consecutivo / CAByS / barcode, anything else human text. Terms under 3 characters return no groups (below the trigram index floor).
Max hits per group.
Responses
Section titled “Responses”object
How the term was interpreted. empty means nothing was queried.
True when the strict pass found nothing anywhere AND the approximate (trigram-similarity) retry produced these hits — the client should label them as approximate. Always false when groups is empty: the flag describes the hits, so there is nothing to qualify when there are none.
Non-empty groups only, ordered by the detected intent (a clave puts invoices first; free text puts contacts first). Groups the caller lacks the scope or plan feature for are absent — never empty-but-present.
object
The source of all the group's hits.
Up to limit hits (5 by default), most recently created first. Never empty.
object
Where the hit comes from, and so which screen opens it: invoice (an issued document of any type, or a draft), party (a contact), item (a catalog item), proforma (a quote), recurring (a recurring invoice schedule), received (a document received from a supplier).
Id of that record: the invoice, contact, item, proforma, schedule or received document. A hit found by the NumeroConsecutivoReceptor of an acceptance resolves to its received document.
Primary line — consecutivo, party name, item name.
Secondary line — receiver name, identification number, CAByS code.
Short status token (invoice/proforma/schedule status, acceptance status). Raw domain value — the client translates it.
Present only on env-scoped rows (invoices, received documents, recurring schedules). Always equals the caller's active environment — results are never mixed across environments.
More rows matched than were returned — the client should offer "see all" on the entity page.
Example
{ "queryKind": "empty", "groups": [ { "type": "invoice", "hits": [ { "type": "invoice", "environment": "sandbox" } ] } ]}Missing or invalid JWT / API key
TENANT_REQUIRED — the caller has no tenant scope yet.