ARCA

received-invoices

arca.gob.ar
InstallationInstalls just this skill for your agent
Side effectread
Authsession (Clave Fiscal with "Mis Comprobantes" adhered; MUST be opened through the portal, setearContribuyente.do sets the session, which is short-lived and single-entry; same-origin, no CORS)
Needsnavigate · evaluate
Summary

List the electronic invoices issued TO a CUIT (received) from ARCA's Mis Comprobantes, by date range: emitter, type, amounts and per-rate IVA. Read-only. UNVERIFIED, mapped on an account with zero received invoices.

Params
{"fechaDesde":"DD/MM/AAAA required","fechaHasta":"DD/MM/AAAA required","cuitConsultada":"11-digit CUIT optional; defaults to the logged-in CUIT read from the page's #cuitConsultada","tipo":"optional 'R' received (default) or 'E' emitted, the same service also lists emitted with the fuller per-rate IVA breakdown","tiposComprobantes":"optional comma list of AFIP type codes; blank = all"}
Returns
{"verificado":"false","tipo":"'R'|'E'","cuitConsultada":"string","rango":"string","total":"int","headers":"[string] the ~52 column headers as ARCA returns them","comprobantes":"[{fecha,tipo,cuitEmisor,denominacionEmisor,importeTotal,celdas:[...all raw cells]}]"}
SKILL.md70 lines

arca-received-invoices

Lists the comprobantes issued to a CUIT from ARCA's Mis Comprobantes service (fes.afip.gob.ar/mcmp/). This is the invoices-received side a business reconciles for input VAT (credito fiscal). With tipo:"E" it also returns issued invoices and, unlike arca-issued-invoices (RCEL only), includes invoices issued from any billing system, with the full per-rate IVA breakdown.

UNVERIFIED (verified:false). This was mapped on a monotributista account with zero received invoices, so the request flow and the ~52-column header row are confirmed but the row parsing is not. The extractor therefore returns each row's full celdas array alongside the mapped fields, so nothing is lost if a column index is off. Whoever first runs it on an account with data should confirm the mapping and flip verified to true.

How it works (and why it is fragile)

  • Entry is only through the portal. Open Mis Comprobantes from the Clave Fiscal portal; setearContribuyente.do establishes the app session. Navigating straight to comprobantes*.do returns "No se encuentra logueado". The session is short-lived and single-entry: it expired within seconds / one navigation during mapping.
  • The backend is asynchronous. ajax.do?f=generarConsulta queues a job and returns a BL... id; ajax.do?f=listaConsultas returns the results page once ready. The extractor queues, then polls listaConsultas up to 6 times (1.5 s apart).
  • Same-origin, ISO-8859-1, credentials:include.

Because of this, expect {error:"session_expired"} more often than with the other skills. The recovery is always: re-open Mis Comprobantes from the portal, then call again immediately.

ARCA (ex AFIP) keeps its service URLs on afip.gob.ar. The catalog domain reads ARCA but the app runs on fes.afip.gob.ar/mcmp/.

The extractor lives as text in the site's localStorage (key arca-received-invoices), rebuilt on each call with synchronous eval. Stored once, persists across navigation and restarts.

Default action: just call (step 1). The call reports NEEDS_STORE when the extractor is missing or out of date; only then store (step 2) and call again.

Versioning. Gated by VER (must match version in the frontmatter). When evaluate.js changes, bump both.

1. Call (do this every run: params only, single bridge call)

await (() => {
  const KEY = "arca-received-invoices", VER = "1";
  const s = localStorage.getItem(KEY);
  if (!s || localStorage.getItem(KEY + ":ver") !== VER) return 'NEEDS_STORE';
  const fn = eval('(' + s + ')');
  return fn(document, { fechaDesde: "01/01/2026", fechaHasta: "31/12/2026" });
})()

Run this snippet verbatim. Never add an await before the eval. Only the outer await is allowed.

2. Store (only when step 1 returned NEEDS_STORE)

From a fes.afip.gob.ar Mis Comprobantes tab (opened via the portal), evaluate the following with the bridge, replacing <FN> with the contents of evaluate.js. Keep VER equal to the call snippet's:

(() => {
  const KEY = "arca-received-invoices", VER = "1";
  const fn = (<FN>);
  localStorage.setItem(KEY, String(fn));
  localStorage.setItem(KEY + ":ver", VER);
  return 'stored';
})()

Returns "stored". Then go back to step 1.

Reading the data

  • cuitEmisor / denominacionEmisor identify who invoiced you; importeTotal is the invoice total. Use celdas for the full row, including the per-rate net/IVA columns (0%, 2.5%, 5%, 10.5%, 21%, 27%) that the mapped fields do not surface.
  • "La informacion esta disponible hasta el dia de ayer inclusive": Mis Comprobantes does not include today's invoices.
  • On tipo:"E", cuitEmisor/denominacionEmisor become the receptor columns; read headers to interpret.

Errors

  • NEEDS_STORE: extractor missing or version-mismatched; run step 2 once, then retry.
  • session_expired: re-open Mis Comprobantes from the portal, then call again immediately.
  • fetch_failed: not on fes.afip.gob.ar, or the tab lost the mcmp session.
  • total: 0 with no error: either genuinely no comprobantes in range, or the async job was still not ready after the poll window, widen the range or retry.

Success assertion

{ "type": "json", "jsonPath": "total" }