/v1/cfdi/download/request
Download the CFDIs a taxpayer issued or received, straight from SAT's bulk download service (Descarga Masiva), with the taxpayer's e.firma: every invoice in a period as XML, or one line of metadata per invoice, including the ones a supplier never sent. CFDI de retenciones too.
Use it for an accounting firm's monthly close, to reconcile the invoices a company received against its payments, or to keep a client's invoice history complete without asking for each XML.
SAT works in three steps, and so do these endpoints. SAT builds the download on its side, which takes from a few seconds to some hours:
- /cfdi/download/request: say what to download. SAT answers with a request_id.
- /cfdi/download/status: ask about the request_id until its state is finished. It then lists package_ids.
- /cfdi/download/package: fetch each package: SAT's zip, plus each line parsed for a metadata download.
SAT asks for the e.firma on every one of its calls, so each step takes it again: nothing is kept between them. It is used for that one request and then dropped: it is never stored, and the private key and its password never reach a log. Send it only for a taxpayer who has authorized you to. SAT's bulk download takes no SAT password.
Request body
Every step takes the e.firma's three parts, certificate, private_key, and password, as on /csf/generate, and retentions: true to work with CFDI de retenciones instead of invoices.
| Field | Type | Required | Description |
|---|---|---|---|
direction |
string | Unless uuid | issued for the CFDIs the taxpayer issued, received for the ones they received. |
start, end |
string | Unless uuid | The period, by issue date: a date (2026-01-31), which covers the whole day, or a date and time (2026-01-31T18:00:00). |
type |
string | No | cfdi (the default) for the XML files, or metadata for one line per CFDI: folio, both parties, dates, total, and status. Metadata comes faster and includes cancelled CFDIs. |
status |
string | No | current or cancelled. SAT never hands over the XML of a cancelled CFDI, so an XML download is of current ones unless you ask otherwise. |
counterparty_rfc |
string or list | No | Only CFDIs with this other party: up to 5 receivers' RFCs for issued CFDIs, one issuer's RFC for received ones. |
document_type |
string | No | Only one kind: I (ingreso), E (egreso), T (traslado), N (nómina), or P (pago). |
uuid |
string | No | One CFDI by its folio fiscal, instead of a period. |
Try it
/v1/cfdi/download/request
Sign in to send a real request from this page.
New accounts get a $5 USD signup credit, no card required.
Example request
curl -X POST https://rfccheck.com/v1/cfdi/download/request \
-H "x-api-key: rfc_your_api_key" \
-F [email protected] \
-F [email protected] \
-F password="$EFIRMA_PASSWORD" \
-F direction=received \
-F start=2026-10-01 \
-F end=2026-10-31
Response (200)
{
"request_id": "8808c60b-da17-4b8a-bc9b-000000000000",
"accepted": true,
"sat_code": "5000",
"message": "Solicitud Aceptada"
}
accepted is true when SAT took the request, false when SAT refused it, and null when SAT could not be reached. A refusal carries SAT's code and message, for example 5002 when the same query was requested too many times (change the period), and is not charged; neither is null.
POST /v1/cfdi/download/status
Send the e.firma and request_id (and retentions: true if the request was for retentions). Ask again every minute or so until state is finished.
{
"request_id": "8808c60b-da17-4b8a-bc9b-000000000000",
"state": "finished",
"cfdi_count": 45,
"package_ids": ["8808C60B-DA17-4B8A-BC9B-000000000000_01"],
"sat_code": "5000",
"message": "Solicitud Aceptada"
}
state |
Meaning |
|---|---|
accepted, in_progress |
SAT is building the packages. Ask again later. |
finished |
Done: package_ids lists the packages and cfdi_count how many CFDIs they hold. SAT keeps the packages for about three days. |
error, rejected, expired |
SAT gave up, refused the request, or the packages expired. sat_code and message say why; 5004 means SAT found no CFDIs for the query. |
null |
SAT could not be reached. Retry; it is not charged. |
Try it
/v1/cfdi/download/status
Sign in to send a real request from this page.
New accounts get a $5 USD signup credit, no card required.
POST /v1/cfdi/download/package
Send the e.firma and one package_id (and retentions: true if the request was for retentions).
{
"package_id": "8808C60B-DA17-4B8A-BC9B-000000000000_01",
"found": true,
"sat_code": "5000",
"message": "Solicitud Aceptada",
"files": 1,
"cfdi_count": 45,
"metadata": [
{
"uuid": "013E5806-0000-0000-0000-000000000000",
"rfc_emisor": "ACM010101AAA",
"nombre_emisor": "ACME CONSULTORES",
"rfc_receptor": "PEJU800101AAA",
"nombre_receptor": "JUAN PEREZ LOPEZ",
"rfc_pac": "SAT970701NN3",
"fecha_emision": "2026-10-01 16:12:18",
"fecha_certificacion": "2026-10-01 16:12:18",
"total": "1160.00",
"efecto_comprobante": "I",
"estado": "vigente",
"fecha_cancelacion": null
}
],
"package_base64": "UEsDBBQAAAAIA..."
}
| Field | Description |
|---|---|
found |
true with the package; false when SAT does not hand it over, with sat_code 5004 for no such package or 5008 when it was already downloaded as many times as SAT allows (save each package the first time); null when SAT could not be reached. Only true is charged. |
files |
How many files the zip holds: one XML per CFDI, or one text file of metadata. |
cfdi_count |
How many CFDIs the package holds: its XML files, or its metadata lines. A package is charged by it: 1 credit per 25 CFDIs, at least 5. /status gives the request's total before you fetch. |
metadata |
For a metadata download, each line parsed, with the field names /cfdi/verify uses; estado is vigente or cancelado. Null for an XML package. |
package_base64 |
SAT's zip, base64-encoded. |
Try it
/v1/cfdi/download/package
Sign in to send a real request from this page.
New accounts get a $5 USD signup credit, no card required.
Errors
Each step checks the e.firma first, as /csf/generate does: parts that are missing or do not fit are a 422 invalid_fields naming the field, and an e.firma SAT refuses is a 422 efirma_rejected. A request whose fields are wrong is a 422 naming them, with a message. None is charged.
{
"error": "invalid_fields",
"fields": ["start", "end"],
"message": "start must be before end."
}