FISCALISTO / API
Listas y paginación
Recorra facturas, clientes o eventos página por página con limit y starting_after.
Las rutas que listan (GET /v1/invoices, GET /v1/customers, GET /v1/events…) contestan una página, la más reciente primero:
{
"object": "list",
"data": [{ "id": "inv_OufpKqnrvx9p0Nfbydl9jG4UNGeTYcvdrg", "object": "invoice", "...": "..." }],
"has_more": true,
"url": "/v1/invoices"
}| Parámetro | Qué hace |
|---|---|
limit | Cuántos por página, de 1 a 100. Por omisión 10. |
starting_after | El id del último objeto de la página anterior: la siguiente empieza después de él. |
Mientras has_more sea true hay más: pida la siguiente con el id del último de data.
curl -G https://api.fiscalisto.com/v1/invoices \
-H "Authorization: Bearer $FISCALISTO_API_KEY" \
-d limit=100 \
-d starting_after=inv_OufpKqnrvx9p0Nfbydl9jG4UNGeTYcvdrgasync function* facturas(filtros = {}) {
let startingAfter;
while (true) {
const q = new URLSearchParams({ limit: "100", ...filtros });
if (startingAfter) q.set("starting_after", startingAfter);
const res = await fetch(`https://api.fiscalisto.com/v1/invoices?${q}`, {
headers: { Authorization: `Bearer ${process.env.FISCALISTO_API_KEY}` },
});
const page = await res.json();
yield* page.data;
if (!page.has_more) return;
startingAfter = page.data.at(-1).id;
}
}
for await (const f of facturas({ status: "valid", created_gte: "2026-10-01" })) {
console.log(f.uuid, f.total);
}Las páginas no se saltan ni repiten objetos aunque se creen otros mientras recorre la lista.
Filtros
Cada lista tiene los suyos, por ejemplo:
- Facturas:
issuer,status,type(I, E, P, T o N),customer(RFC del cliente),created_gteycreated_lte. - Constancias de retenciones:
issuer,status,recipient(RFC) yyear. - Clientes:
tax_id. Productos:skuyproduct_key. - Eventos:
type(invoice.stamped…) yobject(el id del comprobante, para ver todo lo que le pasó).
Las listas de comprobantes, clientes, productos, empleados y lotes son de un emisor: mande issuer si la cuenta tiene varios. Los catálogos del SAT (q busca por clave o descripción) y los anticipos contestan una sola lista, sin páginas.
La referencia de cada ruta dice cuáles acepta.