curl --request POST \
--url https://api.newinvoice.dev/v1/downloads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fiscal_profile_id": "fp_2P9K3sample",
"side": "received",
"type": "cfdi",
"date_from": "2026-06-01",
"date_to": "2026-06-30"
}
'import requests
url = "https://api.newinvoice.dev/v1/downloads"
payload = {
"fiscal_profile_id": "fp_2P9K3sample",
"side": "received",
"type": "cfdi",
"date_from": "2026-06-01",
"date_to": "2026-06-30"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fiscal_profile_id: 'fp_2P9K3sample',
side: 'received',
type: 'cfdi',
date_from: '2026-06-01',
date_to: '2026-06-30'
})
};
fetch('https://api.newinvoice.dev/v1/downloads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.newinvoice.dev/v1/downloads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fiscal_profile_id' => 'fp_2P9K3sample',
'side' => 'received',
'type' => 'cfdi',
'date_from' => '2026-06-01',
'date_to' => '2026-06-30'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.newinvoice.dev/v1/downloads"
payload := strings.NewReader("{\n \"fiscal_profile_id\": \"fp_2P9K3sample\",\n \"side\": \"received\",\n \"type\": \"cfdi\",\n \"date_from\": \"2026-06-01\",\n \"date_to\": \"2026-06-30\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.newinvoice.dev/v1/downloads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fiscal_profile_id\": \"fp_2P9K3sample\",\n \"side\": \"received\",\n \"type\": \"cfdi\",\n \"date_from\": \"2026-06-01\",\n \"date_to\": \"2026-06-30\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.newinvoice.dev/v1/downloads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fiscal_profile_id\": \"fp_2P9K3sample\",\n \"side\": \"received\",\n \"type\": \"cfdi\",\n \"date_from\": \"2026-06-01\",\n \"date_to\": \"2026-06-30\"\n}"
response = http.request(request)
puts response.read_body{
"object": "download",
"id": "obj_2P9K3sample",
"fiscal_profile_id": "fp_2P9K3sample",
"livemode": false,
"side": "issued",
"type": "cfdi",
"date_from": "string",
"date_to": "string",
"status": "requested",
"sat_request_id": "obj_2P9K3sample",
"package_count": -9007199254740991,
"error": "string",
"created_at": "2026-07-10T18:25:43Z",
"updated_at": "2026-07-10T18:25:43Z",
"metadata": {
"warnings": [
"string"
]
}
}{
"object": "download",
"id": "obj_2P9K3sample",
"fiscal_profile_id": "fp_2P9K3sample",
"livemode": false,
"side": "issued",
"type": "cfdi",
"date_from": "string",
"date_to": "string",
"status": "requested",
"sat_request_id": "obj_2P9K3sample",
"package_count": -9007199254740991,
"error": "string",
"created_at": "2026-07-10T18:25:43Z",
"updated_at": "2026-07-10T18:25:43Z",
"metadata": {
"warnings": [
"string"
]
}
}{
"type": "https://errors.invoiceapi.mx/auth_unauthorized",
"title": "Authentication required",
"status": 401,
"code": "auth.unauthorized",
"detail": "Missing or invalid API key.",
"remediation": "Send `Authorization: Bearer sk_test_...` (or sk_live_...) with a valid API key.",
"doc_url": "/docs/errors#auth-unauthorized",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/idempotency_key_reuse",
"title": "Idempotency-Key reused with a different request body",
"status": 409,
"code": "idempotency.key_reuse",
"detail": "This Idempotency-Key was already used for a different payload.",
"remediation": "Reuse an Idempotency-Key only for byte-identical retries; use a fresh key otherwise.",
"doc_url": "/docs/errors#idempotency-key_reuse",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/download_invalid_range",
"title": "Invalid date range",
"status": 422,
"code": "download.invalid_range",
"detail": "date_from must be on or before date_to.",
"remediation": "Provide date_from <= date_to.",
"doc_url": "/docs/errors#download-invalid_range",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/rate_limit_exceeded",
"title": "Rate limit exceeded",
"status": 429,
"code": "rate_limit.exceeded",
"detail": "Too many requests for this key + request class (reads and writes are limited separately).",
"remediation": "Back off and retry after the number of seconds in the Retry-After header; batch work or lower your request rate.",
"doc_url": "/docs/errors#rate_limit-exceeded",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/internal_error",
"title": "Internal server error",
"status": 500,
"code": "internal.error",
"detail": "An unexpected error occurred.",
"remediation": "Retry later; contact support with the request_id if it persists.",
"doc_url": "/docs/errors#internal-error",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/sat_download_rejected",
"title": "SAT rejected the solicitud",
"status": 503,
"code": "sat.download_rejected",
"detail": "The descarga masiva request was rejected upstream.",
"remediation": "Verify the FIEL matches the requesting RFC and role.",
"doc_url": "/docs/errors#sat-download_rejected",
"request_id": "req_2P9K3sample"
}Request a massive download
Start a SAT descarga masiva for issued or received CFDIs over a date range, as full XML or a metadata index. Requires a signed carta manifiesto on the fiscal profile. Note the SAT limits: only 2 identical lifetime requests, 200k XML cap, and package URLs expire in ~5 minutes — fragment wide ranges rather than retrying.
curl --request POST \
--url https://api.newinvoice.dev/v1/downloads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fiscal_profile_id": "fp_2P9K3sample",
"side": "received",
"type": "cfdi",
"date_from": "2026-06-01",
"date_to": "2026-06-30"
}
'import requests
url = "https://api.newinvoice.dev/v1/downloads"
payload = {
"fiscal_profile_id": "fp_2P9K3sample",
"side": "received",
"type": "cfdi",
"date_from": "2026-06-01",
"date_to": "2026-06-30"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fiscal_profile_id: 'fp_2P9K3sample',
side: 'received',
type: 'cfdi',
date_from: '2026-06-01',
date_to: '2026-06-30'
})
};
fetch('https://api.newinvoice.dev/v1/downloads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.newinvoice.dev/v1/downloads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fiscal_profile_id' => 'fp_2P9K3sample',
'side' => 'received',
'type' => 'cfdi',
'date_from' => '2026-06-01',
'date_to' => '2026-06-30'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.newinvoice.dev/v1/downloads"
payload := strings.NewReader("{\n \"fiscal_profile_id\": \"fp_2P9K3sample\",\n \"side\": \"received\",\n \"type\": \"cfdi\",\n \"date_from\": \"2026-06-01\",\n \"date_to\": \"2026-06-30\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.newinvoice.dev/v1/downloads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fiscal_profile_id\": \"fp_2P9K3sample\",\n \"side\": \"received\",\n \"type\": \"cfdi\",\n \"date_from\": \"2026-06-01\",\n \"date_to\": \"2026-06-30\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.newinvoice.dev/v1/downloads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fiscal_profile_id\": \"fp_2P9K3sample\",\n \"side\": \"received\",\n \"type\": \"cfdi\",\n \"date_from\": \"2026-06-01\",\n \"date_to\": \"2026-06-30\"\n}"
response = http.request(request)
puts response.read_body{
"object": "download",
"id": "obj_2P9K3sample",
"fiscal_profile_id": "fp_2P9K3sample",
"livemode": false,
"side": "issued",
"type": "cfdi",
"date_from": "string",
"date_to": "string",
"status": "requested",
"sat_request_id": "obj_2P9K3sample",
"package_count": -9007199254740991,
"error": "string",
"created_at": "2026-07-10T18:25:43Z",
"updated_at": "2026-07-10T18:25:43Z",
"metadata": {
"warnings": [
"string"
]
}
}{
"object": "download",
"id": "obj_2P9K3sample",
"fiscal_profile_id": "fp_2P9K3sample",
"livemode": false,
"side": "issued",
"type": "cfdi",
"date_from": "string",
"date_to": "string",
"status": "requested",
"sat_request_id": "obj_2P9K3sample",
"package_count": -9007199254740991,
"error": "string",
"created_at": "2026-07-10T18:25:43Z",
"updated_at": "2026-07-10T18:25:43Z",
"metadata": {
"warnings": [
"string"
]
}
}{
"type": "https://errors.invoiceapi.mx/auth_unauthorized",
"title": "Authentication required",
"status": 401,
"code": "auth.unauthorized",
"detail": "Missing or invalid API key.",
"remediation": "Send `Authorization: Bearer sk_test_...` (or sk_live_...) with a valid API key.",
"doc_url": "/docs/errors#auth-unauthorized",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/idempotency_key_reuse",
"title": "Idempotency-Key reused with a different request body",
"status": 409,
"code": "idempotency.key_reuse",
"detail": "This Idempotency-Key was already used for a different payload.",
"remediation": "Reuse an Idempotency-Key only for byte-identical retries; use a fresh key otherwise.",
"doc_url": "/docs/errors#idempotency-key_reuse",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/download_invalid_range",
"title": "Invalid date range",
"status": 422,
"code": "download.invalid_range",
"detail": "date_from must be on or before date_to.",
"remediation": "Provide date_from <= date_to.",
"doc_url": "/docs/errors#download-invalid_range",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/rate_limit_exceeded",
"title": "Rate limit exceeded",
"status": 429,
"code": "rate_limit.exceeded",
"detail": "Too many requests for this key + request class (reads and writes are limited separately).",
"remediation": "Back off and retry after the number of seconds in the Retry-After header; batch work or lower your request rate.",
"doc_url": "/docs/errors#rate_limit-exceeded",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/internal_error",
"title": "Internal server error",
"status": 500,
"code": "internal.error",
"detail": "An unexpected error occurred.",
"remediation": "Retry later; contact support with the request_id if it persists.",
"doc_url": "/docs/errors#internal-error",
"request_id": "req_2P9K3sample"
}{
"type": "https://errors.invoiceapi.mx/sat_download_rejected",
"title": "SAT rejected the solicitud",
"status": 503,
"code": "sat.download_rejected",
"detail": "The descarga masiva request was rejected upstream.",
"remediation": "Verify the FIEL matches the requesting RFC and role.",
"doc_url": "/docs/errors#sat-download_rejected",
"request_id": "req_2P9K3sample"
}Authorizations
API key: Authorization: Bearer sk_test_... or sk_live_....
Headers
Pin a dated API release (Stripe-style). Omit to use the current version. An unknown value returns 400 request.invalid_version. Echoed back on every response.
"2026-07-10"
Connect: act on behalf of one of your connected accounts (its acct_…/org_… id). Omit to act as your own organization. Not honored on /v1/api_keys.
"org_2P9connectedacct"
Safely retry any POST. The first response is stored for 24h and replayed byte-for-byte for identical retries (the replay adds an idempotent-replayed: true header). Reusing the key with a different body is 409 idempotency.key_reuse; an in-flight duplicate is 409 idempotency.key_processing. This makes retrying a 502/429 safe — no duplicate stamp.
"a1b2c3d4-e5f6-4789-8abc-1234567890ab"
Body
Id of the fiscal profile whose FIEL authorizes the download, e.g. "fp_2P9K3sample".
1Which CFDIs to pull: "issued" (emitidos by this RFC) or "received" (recibidos).
issued, received Package contents: "cfdi" (full XML files) or "metadata" (a summary index only).
cfdi, metadata Start of the range, ISO date (YYYY-MM-DD) or datetime; a bare date covers from 00:00:00.
End of the range, ISO date (YYYY-MM-DD) or datetime; a bare date covers to 23:59:59.
Advisory SAT estatus filter: "active" (vigentes) or "cancelled" (cancelados). Metadata-only per Prodigia.
active, cancelled Response
Default Response
Always "download".
download Download id, e.g. "dl_2P9K3sample".
Id of the fiscal profile whose FIEL authorized this download.
True if created with a live-mode key.
"issued" (emitidos) or "received" (recibidos).
issued, received "cfdi" (full XML) or "metadata" (summary index).
cfdi, metadata Start of the requested range (SAT format yyyy-MM-ddTHH:mm:ss).
End of the requested range (SAT format yyyy-MM-ddTHH:mm:ss).
Lifecycle status: "requested", "processing", "ready" (packages available), "no_data", or "failed".
requested, processing, ready, no_data, failed SAT solicitud id (IdSolicitud), or null until registered.
Number of downloadable packages once ready.
-9007199254740991 <= x <= 9007199254740991Failure detail (problem+json shape) when status is "failed", else null.
Creation timestamp, ISO-8601 UTC.
Last-update timestamp, ISO-8601 UTC.
Request-time advisory metadata.
Show child attributes
Show child attributes