Search
Find the id of a customer, supplier, product, serial number, brand or
category from whatever the user says (a partial name, a tax id, an internal
code, a barcode, a phone number, a serial number...), so you can then fetch
the full record with
GET /v1/{cuenta}/documentos/{tipo}/{id}.
This is what the MCP uses (buscar) whenever the
user names something by text instead of by id.
curl -H "X-API-Key: YOUR_KEY" \
"https://api.cianbox.uno/v1/YOUR_ACCOUNT/busquedas/clientes?texto=lopez"
{
"status": "ok",
"account": "YOUR_ACCOUNT",
"module": "busqueda:clientes",
"count": 2,
"units_charged": 1,
"body": {
"busqueda_clientes": {
"texto": "lopez",
"incluir_no_vigentes": false,
"hay_coincidencia_exacta": false,
"resultados": [
{"id": 42, "nombre": "Ferretería López S.R.L.", "cuit": "30-12345678-9",
"condicion_iva": "Responsable Inscripto", "localidad": "Olivos",
"codigo_interno": null, "estado": "vigente", "ultima_operacion": "2026-09-10",
"coincide_por": {"campo": "razon_social", "tipo": "prefijo"},
"contacto_coincidente": null}
],
"cantidad": 1,
"hay_mas": false
}
}
}
Rule of thumb
If there is a single result or an exact match, use it. If there are several results with no exact match, show the options to the user (name, tax id, city, last transaction) before fetching the full record.
For a serial number or IMEI, use the serial number search (
numeros_serie), not the product search.
The search doesn't pick a winner: it returns the candidates ordered, with
enough data to tell them apart. hay_coincidencia_exacta is true when some
result matched by an identifier (tax id, internal code, phone number,
barcode, supplier code or serial number), not just by a partial name.
The six types
GET /v1/{cuenta}/busquedas/{tipo} |
What it finds | Requires resource |
|---|---|---|
clientes |
A customer's id | clientes |
proveedores |
A supplier's id | proveedores |
productos |
A product's id (or its variant's) | productos |
numeros_serie |
The unit (serial id) and its product | stock |
marcas |
A brand's id, to filter productos (id_marca) or fetch its card |
productos |
categorias |
A category's id, to filter productos (id_categoria) or fetch its card |
productos |
Parameters
| Parameter | Default | Notes |
|---|---|---|
texto |
(required) | At least 2 characters. Case, accents and ñ don't matter: lopez matches "López" and pena matches "Peña". Optional in marcas/categorias (with no text, lists all of them) and in productos with id_marca/id_categoria (with no text, lists every product in that brand or category). |
limite |
20 | Up to 50. A higher value is silently capped; below 1 is raised to 1. |
incluir_no_vigentes |
false |
With true, includes discontinued customers, suppliers or products (estado: "no_vigente"). In numeros_serie it refers to the product: a discontinued serial is never shown. |
id_marca, id_categoria |
(no filter) | productos only. Filters by that brand or category (the variant's own or its parent's). Using them with any other type returns 400 parametro_invalido. |
Layers: how results get ranked
Results come from layers, run in order, stopping once limite is reached
without repeating ids (a result keeps the first, strongest match):
- Exact (
tipo: "exacta"): by an identifier — tax id (customers/ suppliers, comparing digits only: "30-12345678-9" matches "30123456789"), internal code (on MercadoLibre-linked accounts this is the buyer's ML username), phone (own or a contact's, comparing the last 8 digits in any format: "11 15 4082-7770" matches "11 40 82 77 70"), barcode or a supplier's code (products), or the exact serial number. - Prefix (
tipo: "prefijo"): the text is the start of the legal name, trade name, email, or the product's name/internal code; or the serial number starts with the text. - Contains (
tipo: "contiene"): every word in the text appears, in any order ("a4 resma" matches "Resma A4"). In products, a word can also be satisfied by the parent product's name (on a variant), a variant attribute (size, color, season, material, design, measure) or the brand: "green shirt m" matches green, size-M shirt variants. There's no "contains" layer innumeros_serie(a serial number is dictated from the start). - Filter (
tipo: "filtro", onlyproductoswith no text plusid_marca/id_categoria, andmarcas/categoriaswith no text): everything matching the filter, without a name search.
Within each layer: matches on the record's own name come before a contact's match; within each group, most recent transaction first (those that never transacted go last), then by name. Products are sorted by layer and name; brands and categories by layer and by product count, descending.
Examples per type
Customers or suppliers — name, tax id, internal code or phone:
.../busquedas/clientes?texto=30-12345678-9
.../busquedas/proveedores?texto=iatec&limite=5
Each result carries id, nombre ("legal name [trade name]"), cuit,
condicion_iva, localidad, codigo_interno, estado, ultima_operacion
(date of the last active voucher; null if it never transacted),
coincide_por and contacto_coincidente ({id, nombre, email} of the
matching contact, or null when the customer/supplier itself matched).
Products — name, code, barcode, attributes or brand:
.../busquedas/productos?texto=remera%20verde%20m
.../busquedas/productos?texto=&id_marca=12 # every product of brand 12
Each result carries id, nombre, codigo_interno, codigo_barras, tipo
(simple, padre, variante or combo), producto_padre (on a variant),
estado, stock_total, precio_general ({neto, final, moneda} for the
General price list, or null) and coincide_por (campo: "atributos" when
some word only matched an attribute or the brand). A parent product
found by name or attributes also carries filtrado_por_atributos and
variantes_coincidentes ({cantidad, hay_mas, variantes} with up to 10
matching variants, or just {cantidad} when every variant matches by name).
Serial numbers or IMEIs — kept apart from products, on purpose:
.../busquedas/numeros_serie?texto=123456789012345
Each result is a unit: id (fetched as /documentos/numero_serie/{id}),
numero_serie, producto ({id, nombre, codigo_interno, estado}),
fecha_carga, disponible, sucursal and coincide_por. The same number
can exist on several products: each unit is its own result.
Brands or categories — to get the id and filter productos or fetch the
card:
.../busquedas/marcas?texto=nike
.../busquedas/categorias # no text: lists them all
Each result carries id, nombre, estado, cantidad_productos (active,
not counting variants) and coincide_por (null in the no-text listing).
Permissions and the stock trim
GET /v1/{cuenta}/busquedas/{tipo} requires the resource from the table
above (403 if missing). On top of that, in productos, stock_total and
variantes_coincidentes[].variantes[].stock belong to the stock resource,
not productos: if your key doesn't have stock, those two fields are
left out of the response (not null — the key itself is removed), even
though the product search doesn't require stock on its own. The rest of
the product search comes back the same either way.
How it's billed
Same as a document: resource weight +
1 per 500 rows. count in the response is the number of results returned
(plus any nested variants under variantes_coincidentes): that's what got
billed. Usage shows up in your report as busqueda:<tipo>
(busqueda:clientes, busqueda:productos...).
Errors
| Code | When |
|---|---|
404 |
{tipo} isn't one of the six in the table above |
403 |
Missing the resource that search type requires |
400 |
texto has fewer than 2 characters (texto_invalido), or you sent id_marca/id_categoria on a type other than productos (parametro_invalido) |
401 |
The key is missing or invalid |