Skip to content
Invoicing

FISCALISTO / API

SAT downloads

The invoices an issuer received or issued, straight from SAT with their XML: SAT's bulk download with the issuer's e.firma, with an event when it finishes.

Open in ChatGPTOpen in ClaudeOpen in Cursor

With SAT's bulk download you bring every invoice an issuer received (its expenses, from any supplier) or issued (even if it didn't make them with Fiscalisto), with its XML. It's useful for accounting, for reconciling payments or for checking suppliers against SAT's lists. In production they use timbres according to how many invoices they bring; free in test mode.

SAT takes from a few minutes to a few hours to prepare each download. You request it, carry on with your work and sat_download.completed arrives when the invoices are ready.

In test mode and in production

  • In production SAT is asked with the issuer's e.firma, which you store once (below).
  • In test mode SAT has no test environment for this, so it isn't asked: the download finishes instantly with sample invoices between the issuer and SAT's test RFCs, with their XML and their event. Asking for the same again brings the same invoices, without duplicating them. No e.firma needed: the test issuer always carries sat_downloads.available: true, and in efirma_expires_at when the e.firma it stores in production for the same RFC expires (or the one you send in test mode with keep_for_downloads: true, which is checked the same but not stored).

Store the issuer's e.firma

An RFC of your company (type: "own") uses the e.firma the company already stored in the app (Ajustes › Credenciales): there's no need to send it again, and the issuer carries sat_downloads.available: true and its efirma_expires_at while it's valid. The one you send through the API for that RFC is also kept in the app. The CSD isn't needed to download or to read the invoices: the CSD is only for stamping.

For a connected issuer (type: "connected"), in production, send the e.firma (the .cer and .key in base64 and its password) with keep_for_downloads: true. It's checked to be a valid e.firma of that RFC and stored encrypted, as in the app. If the issuer hasn't signed the PAC contract yet and already has its CSD, the same call signs it.

curl https://api.fiscalisto.com/v1/issuers/iss_OufpKqnrvx9p/efirma \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"cer\": \"$(base64 < efirma.cer | tr -d '\n')\",
    \"key\": \"$(base64 < efirma.key | tr -d '\n')\",
    \"password\": \"$EFIRMA_PASSWORD\",
    \"keep_for_downloads\": true
  }"

The issuer carries sat_downloads.available: true and when its e.firma expires in sat_downloads.efirma_expires_at. To delete it: DELETE /v1/issuers/{id}/efirma. The issuer keeps stamping; it can only no longer request downloads.

With the owner's permission

Ask for the e.firma only with the RFC owner's permission and tell them what it's for. With it, all their invoices at SAT can be queried.

Request a download

curl https://api.fiscalisto.com/v1/sat_downloads \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "direction": "received", "from": "2026-09-01", "to": "2026-09-30" }'

Returns 202 with the download (sdl_…) in status: "processing" (in test mode it already comes completed):

{
  "id": "sdl_OufpKqnrvx9p3n8vQd2LkW7mZr1XyT5uBc",
  "object": "sat_download",
  "livemode": true,
  "issuer": "iss_OufpKqnrvx9p",
  "direction": "received",
  "from": "2026-09-01",
  "to": "2026-09-30",
  "type": null,
  "counterparty_tax_id": null,
  "uuid": null,
  "status": "processing",
  "new_invoices": null,
  "error": null,
  "created_at": "2026-10-24T10:20:00-06:00",
  "completed_at": null
}
FieldWhat it asks for
directionreceived (default) or issued.
from, toThe days, inclusive. Up to one year per download, from January 1 five years ago (what SAT provides) to today.
typeOnly one document type: I, E, P, T or N.
counterparty_tax_idOnly those of one supplier (received) or one customer (issued).
uuidA single invoice, by its folio fiscal.

Received invoices arrive current: SAT only delivers a received invoice's XML while it isn't cancelled.

When it finishes

The sat_download.completed event arrives with the download and new_invoices, how many new invoices it brought (the ones you already had aren't counted twice). If SAT couldn't, sat_download.failed arrives with the reason in error, for example an expired e.firma. You can also look it up with GET /v1/sat_downloads/{id} or list them with GET /v1/sat_downloads.

SAT limits how many times exactly the same thing can be requested (the same period with the same filters). If they run out, the response is sat_request_rejected: request a slightly different period.

The invoices

curl "https://api.fiscalisto.com/v1/sat_invoices?direction=received&date_gte=2026-09-01&limit=20" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"

For an RFC of your company (type: "own"), the list also carries the invoices the app's automatic download brought, on every plan (Gratis too). Listing invoices, viewing them and downloading their XML or PDF uses no timbres; only requesting a new download from SAT does. GET /v1/sat_downloads lists only the downloads the API requested, not the app's automatic ones.

Each invoice (sat_…) carries its folio fiscal, who issued it (issued_by) and to whom (issued_to), the amounts, the transferred and withheld taxes, and its status at SAT (sat_status). They're filtered by direction, type, counterparty_tax_id, date_gte and date_lte, newest to oldest, with the usual pagination. The XML, exactly as SAT delivered it, is at GET /v1/sat_invoices/{id}/xml, and its PDF at GET /v1/sat_invoices/{id}/pdf: the same one the customer received if it was stamped in Fiscalisto; otherwise, drawn with the issuer's PDF design (a supplier's, with its style and color, never with its logo).

Withholding certificates

The issuer's withholding and payment information CFDI (what a bank, a platform or whoever paid it withheld, and the certificates it issued) are at GET /v1/sat_retentions, as Facturas › Retenciones shows them:

curl "https://api.fiscalisto.com/v1/sat_retentions?direction=received&year=2025&status=active" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"

Each certificate (srt_…) carries who withheld (issued_by) and from whom (issued_to), its key (code), the period it covers (period), the amounts (totals), each tax withheld (withheld_taxes) and its status: active or canceled. Received ones SAT reports as cancelled (Fiscalisto checks every month) stay on the list as canceled: they no longer count as tax withheld. They're filtered by direction (received by default or issued), status, counterparty_tax_id, code (like 16 interest or 26 platforms), year and month (the ones covering that month: an annual one from January to December covers all), newest to oldest, with the usual pagination. The XML is at GET /v1/sat_retentions/{id}/xml and the PDF at GET /v1/sat_retentions/{id}/pdf. The ones you issue through the API are also at /v1/retentions, with their stamping.

One the issuer issued (direction issued) is cancelled with POST /v1/sat_retentions/{id}/cancel, also if it was stamped from another system and only came from SAT: motive 02 (with errors, or duplicated), 03 (the operation didn't happen) or 01 with substitution, the certificate that replaces it (its srt_… or its UUID), active, from the same issuer and to the same receiver. It's cancelled at once, with no acceptance, uses no timbres and answers the certificate with status canceled. One another PAC stamped is cancelled in SAT's portal with the e.firma and the CSD the issuer saved; if one is missing, it answers cancellation_failed and says which.

Limits

Up to 300 downloads a day per account in production and 50 in test mode. In production, requesting one uses a timbre, which covers the first 100 CFDI (if SAT rejects it, the timbre comes back). When SAT says how many it has, every 100 more, or the remainder, use another timbre before downloading them: 1,250 CFDI are 13 timbres. If your account doesn't have enough, the download ends failed (event sat_download.failed), without downloading anything, and the request's timbre doesn't come back. Free in test mode. See Limits.

Requesting the same download again (same issuer, dates and filters) while SAT is still working on it returns that same download, without another timbre: that way a retry after a timeout doesn't spend the few identical requests SAT accepts. Once it's finished, an identical one is a new download.

Was this page helpful?