Bulk download requests

A download request asks the SAT (Mexico's tax authority, Servicio de Administración Tributaria) for CFDIs (Mexico's electronic invoices), metadata, or withholding CFDIs (CFDI de Retenciones e Información de Pagos, the CFDIs that report taxes withheld from a payment). Each request is created from a download rule, which must be approved. Fiscalapi manages each request's lifecycle with resilience and retry mechanisms to make the most of the SAT's download services, so you don't have to handle it yourself.

Download request model

The download request model contains all of a request's data. When a request is created, it inherits the values of its download rule, and each inherited property says so in its description.

Properties

  • Name
    id
    Type
    string?
    Description

    The download request ID, assigned by Fiscalapi.

  • Name
    consecutive
    Type
    number?
    Description

    The request's sequential number.

  • Name
    satRequestId
    Type
    string?
    Description

    The request's ID at the SAT.

  • Name
    downloadRuleId
    Type
    string?
    Description

    The ID of the request's download rule.

  • Name
    downloadTypeId
    Type
    string?
    expandable
    Description

    Whether the request downloads issued or received CFDIs. Inherited from the rule.

    Type
    enum:
    Values
    "Emitidos""Recibidos"
  • Name
    downloadRequestTypeId
    Type
    string?
    expandable
    Description

    The download request type.

    Type
    enum:
    Values
    "Automatica""Manual"
  • Name
    recipientTin
    Type
    string?
    Description

    The recipient's RFC (Mexico's taxpayer ID, Registro Federal de Contribuyentes) on the downloaded CFDIs. Inherited from the rule.

  • Name
    issuerTin
    Type
    string?
    Description

    The issuer's RFC on the downloaded CFDIs. Inherited from the rule.

  • Name
    requesterTin
    Type
    string?
    Description

    The requester's RFC for the download. Inherited from the rule.

  • Name
    startDate
    Type
    string?
    Description

    The start date of the download period.

  • Name
    endDate
    Type
    string?
    Description

    The end date of the download period.

  • Name
    satQueryTypeId
    Type
    string?
    expandable
    Description

    The type of document the request downloads. Inherited from the rule.

    Type
    enum:
    Values
    "CFDI""Metadata""Retenciones"
  • Name
    satInvoiceTypeId
    Type
    string?
    expandable
    Description

    The CFDI type (the TipoDeComprobante key: I income, the regular sales invoice; E credit note; T transfer, moves goods without a sale; N payroll; P payment) of the CFDIs the request downloads. Inherited from the rule.

    Type
    enum:
    Values
    """E""I"
  • Name
    satInvoiceStatusId
    Type
    string?
    expandable
    Description

    The status of the CFDIs the request downloads. Inherited from the rule.

    Type
    enum:
    Values
    "Cancelado""Vigente"
  • Name
    satInvoiceComplementId
    Type
    string?
    expandable
    Description

    The complement (complemento, an XML extension the SAT defines for specific operations) of the CFDIs the request downloads. Inherited from the rule.

    Type
    enum:
    Values
    """acreditamientoieps10""aerolineas"
  • Name
    satRequestStatusId
    Type
    string?
    expandable
    Description

    The request's status at the SAT.

    Type
    enum:
    Values
    "0""1""2"
  • Name
    downloadRequestStatusId
    Type
    string?
    expandable
    Description

    The request's status in Fiscalapi.

    Type
    enum:
    Values
    "1""2""3"
  • Name
    lastAttemptDate
    Type
    string?
    Description

    The date of the last download attempt. Fiscalapi doesn't schedule a next attempt for each request: pending requests are checked periodically.

  • Name
    invoiceCount
    Type
    number?
    Description

    The number of CFDIs the request found.

  • Name
    packageIds
    Type
    array of strings?
    Description

    The IDs of the request's packages.

  • Name
    isReadyToDownload
    Type
    boolean?
    Description

    Whether the request is ready to download.

  • Name
    retriesCount
    Type
    number?
    Description

    The total number of download attempts for the request.


GET/api/v4/download-requests

List requests

This endpoint returns a paginated list of download requests, ten per page by default. Use the query parameters to adjust the pagination.

Query parameters

  • Name
    pageNumber
    Type
    integer | number
    required
    Description

    The page number you want to retrieve.

    Default:
    1
  • Name
    pageSize
    Type
    integer | number
    required
    Description

    The number of records per page, from 1 to 50.

    Default:
    10

Request

GET
/api/v4/download-requests?pageNumber=1&pageSize=2
curl --location 'https://test.fiscalapi.com/api/v4/download-requests?pageNumber=1&pageSize=2' \
--header 'X-TENANT-KEY: <tenant-key>' \
--header 'X-TIME-ZONE: America/Mexico_City' \
--header 'X-API-KEY: <api-key>'

Response

{
    "data": {
        "items": [
            {
                "consecutive": 5,
                "satRequestId": "6cfd1310-82f6-46fb-a23e-6c312632cb85",
                "downloadRuleId": "b9b2d8b0-80a0-4c08-ae07-cf5e193fe839",
                "downloadType": {
                    "description": "Recibidos",
                    "id": "Recibidos",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "downloadRequestType": {
                    "description": "Manual",
                    "id": "Manual",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "recipientTin": "FUNK671228PH6",
                "issuerTin": null,
                "requesterTin": "FUNK671228PH6",
                "startDate": "2025-06-13T18:00:00.000",
                "endDate": "2025-08-14T17:59:59.000",
                "invoiceUuid": null,
                "satQueryType": {
                    "description": "Facturas",
                    "id": "CFDI",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "satInvoiceType": {
                    "description": "Ingreso",
                    "id": "I",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "satInvoiceStatus": {
                    "description": "Vigente",
                    "id": "Vigente",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "satInvoiceComplement": {
                    "description": "Todos",
                    "id": "",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "satRequestStatus": {
                    "description": "Terminada",
                    "id": "3",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "downloadRequestStatus": {
                    "description": "Completada",
                    "id": "3",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "lastAttemptDate": "2025-08-14T17:36:55.760",
                "invoiceCount": 3,
                "packageIds": [
                    "76103bc8-b457-4cd7-9f5d-e816fe4d3036_01"
                ],
                "isReadyToDownload": true,
                "reSubmissionCount": 0,
                "retriesCount": 1,
                "timeOffsetSeconds": 0,
                "id": "0367634b-b3a9-4551-93de-afba276d057e",
                "createdAt": "2025-08-14T17:36:55.762",
                "updatedAt": "2025-08-14T17:36:55.762"
            },
            {
                "consecutive": 4,
                "satRequestId": "1101a3d3-6008-43f7-a06e-42f900b2ed4f",
                "downloadRuleId": "6f345af1-d21f-4a82-8bd3-997a9d0dcb21",
                "downloadType": {
                    "description": "Recibidos",
                    "id": "Recibidos",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "downloadRequestType": {
                    "description": "Manual",
                    "id": "Manual",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "recipientTin": "FUNK671228PH6",
                "issuerTin": null,
                "requesterTin": "FUNK671228PH6",
                "startDate": "2025-06-13T18:00:00.000",
                "endDate": "2025-08-14T17:59:59.000",
                "invoiceUuid": null,
                "satQueryType": {
                    "description": "Facturas",
                    "id": "CFDI",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "satInvoiceType": {
                    "description": "Ingreso",
                    "id": "I",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "satInvoiceStatus": {
                    "description": "Vigente",
                    "id": "Vigente",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "satInvoiceComplement": {
                    "description": "Todos",
                    "id": "",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "satRequestStatus": {
                    "description": "Terminada",
                    "id": "3",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "downloadRequestStatus": {
                    "description": "Completada",
                    "id": "3",
                    "createdAt": "2024-08-10T15:46:30.373",
                    "updatedAt": null
                },
                "lastAttemptDate": "2025-08-14T17:17:01.930",
                "invoiceCount": 3,
                "packageIds": [
                    "f23fac6c-9012-4f1d-a3ba-ae6bb876bb14_01"
                ],
                "isReadyToDownload": true,
                "reSubmissionCount": 0,
                "retriesCount": 1,
                "timeOffsetSeconds": 0,
                "id": "12e55d8f-8abc-4879-972a-f572fdc44190",
                "createdAt": "2025-08-14T17:17:02.163",
                "updatedAt": "2025-08-14T17:17:02.163"
            }
        ],
        "pageNumber": 1,
        "totalPages": 1,
        "totalCount": 6,
        "hasPreviousPage": false,
        "hasNextPage": false
    },
    "succeeded": true,
    "message": "",
    "details": "",
    "httpStatusCode": 200
}

POST/api/v4/download-requests

Create a request

This endpoint creates a manual download request from an approved rule. The request's period can't exceed the limit for the rule's query type.

Request body

  • Name
    downloadRuleId
    Type
    string
    required
    Description

    The download rule ID. The rule must be approved.

  • Name
    downloadRequestTypeId
    Type
    string
    required
    Description

    The download request type. With the API, the only valid value is "Manual".

  • Name
    startDate
    Type
    string
    required
    Description

    The start date of the download period, in ISO 8601 format.

  • Name
    endDate
    Type
    string
    required
    Description

    The end date of the download period, in ISO 8601 format.

Request

POST
/api/v4/download-requests
curl --location 'https://test.fiscalapi.com/api/v4/download-requests' \
--header 'X-TENANT-KEY: <tenant-key>' \
--header 'X-TIME-ZONE: America/Mexico_City' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '{
      "downloadRuleId": "dc17ba67-05cd-4e8d-93c5-aeae0137b8c1",
      "downloadRequestTypeId": "Manual",
      "startDate": "2025-08-07T01:59:00.000Z",
      "endDate": "2025-08-15T01:59:00.000Z"
  }'

Response

{
    "data": {
        "consecutive": 19,
        "satRequestId": "8846fbec-483a-4b47-b264-046b744690fc",
        "downloadRuleId": "dc17ba67-05cd-4e8d-93c5-aeae0137b8c1",
        "downloadType": null,
        "downloadRequestType": null,
        "recipientTin": "FUNK671228PH6",
        "issuerTin": "",
        "requesterTin": "FUNK671228PH6",
        "startDate": "2025-08-06T13:59:00.000",
        "endDate": "2025-08-14T13:59:00.000",
        "invoiceUuid": null,
        "satQueryType": null,
        "satInvoiceType": null,
        "satInvoiceStatus": null,
        "satInvoiceComplement": null,
        "satRequestStatus": null,
        "downloadRequestStatus": null,
        "lastAttemptDate": null,
        "invoiceCount": 0,
        "packageIds": [],
        "isReadyToDownload": false,
        "reSubmissionCount": 0,
        "retriesCount": 0,
        "timeOffsetSeconds": 0,
        "id": "672ddd02-bb4a-48ba-99ef-488c94b8da31",
        "createdAt": "2025-08-14T20:01:24.184",
        "updatedAt": "2025-08-14T20:01:24.184"
    },
    "succeeded": true,
    "message": "",
    "details": "",
    "httpStatusCode": 200
}

GET/api/v4/download-requests/<id>

Get a request by ID

This endpoint returns a download request by its ID.

Errors

In the message, which arrives in details, <id> is the request ID.

StatusWhen it happensMessage
404The request doesn't exist or belongs to another tenant (the space in Fiscalapi that holds your issuers, recipients, credits, and data).No such resource for the given Id: <id>

Request

GET
/api/v4/download-requests/<id>
curl --location 'https://test.fiscalapi.com/api/v4/download-requests/2c6aafcf-8cd2-4fb1-94a8-687adc671380' \
--header 'X-TENANT-KEY: <tenant-key>' \
--header 'X-TIME-ZONE: America/Mexico_City' \
--header 'X-API-KEY: <api-key>'

Response

{
    "data": {
        "consecutive": 12,
        "satRequestId": "2f7713dd-030b-40e6-8e58-a449210ce496",
        "downloadRuleId": "3b54bbe5-b8de-4760-b6c7-bb17da3fa680",
        "downloadType": {
            "description": "Recibidos",
            "id": "Recibidos",
            "createdAt": "2024-08-10T15:46:30.373",
            "updatedAt": null
        },
        "downloadRequestType": {
            "description": "Manual",
            "id": "Manual",
            "createdAt": "2024-08-10T15:46:30.373",
            "updatedAt": null
        },
        "recipientTin": "FUNK671228PH6",
        "issuerTin": null,
        "requesterTin": "FUNK671228PH6",
        "startDate": "2025-06-13T18:00:00.000",
        "endDate": "2025-08-15T17:59:59.000",
        "invoiceUuid": null,
        "satQueryType": {
            "description": "Facturas",
            "id": "CFDI",
            "createdAt": "2024-08-10T15:46:30.373",
            "updatedAt": null
        },
        "satInvoiceType": {
            "description": "Ingreso",
            "id": "I",
            "createdAt": "2024-08-10T15:46:30.373",
            "updatedAt": null
        },
        "satInvoiceStatus": {
            "description": "Vigente",
            "id": "Vigente",
            "createdAt": "2024-08-10T15:46:30.373",
            "updatedAt": null
        },
        "satInvoiceComplement": {
            "description": "Todos",
            "id": "",
            "createdAt": "2024-08-10T15:46:30.373",
            "updatedAt": null
        },
        "satRequestStatus": {
            "description": "Terminada",
            "id": "3",
            "createdAt": "2024-08-10T15:46:30.373",
            "updatedAt": null
        },
        "downloadRequestStatus": {
            "description": "Completada",
            "id": "3",
            "createdAt": "2024-08-10T15:46:30.373",
            "updatedAt": null
        },
        "lastAttemptDate": "2025-08-14T19:15:33.661",
        "invoiceCount": 3,
        "packageIds": [
            "4216856e-7191-4429-9884-814662fc4c09_01"
        ],
        "isReadyToDownload": true,
        "reSubmissionCount": 0,
        "retriesCount": 1,
        "timeOffsetSeconds": 0,
        "id": "e9b2bf4b-9aa0-4be7-8ed6-63896979d137",
        "createdAt": "2025-08-14T19:15:33.814",
        "updatedAt": "2025-08-14T19:15:33.814"
    },
    "succeeded": true,
    "message": "",
    "details": "",
    "httpStatusCode": 200
}

GET/api/v4/download-requests/<id>/xmls

List XMLs by ID

This endpoint returns the downloaded XML files of a request, by its ID. Each XML's date is the CFDI's Fecha as is: the local time at the place of issue (the postal code where the CFDI is issued), with no time zone. It doesn't depend on the X-TIME-ZONE header.

Request

GET
/api/v4/download-requests/<id>/xmls
curl --location 'https://test.fiscalapi.com/api/v4/download-requests/2c6aafcf-8cd2-4fb1-94a8-687adc671380/xmls' \
--header 'X-TENANT-KEY: <tenant-key>' \
--header 'X-TIME-ZONE: America/Mexico_City' \
--header 'X-API-KEY: <api-key>'

This example omits the Base64 content because of its size.

Response

{
    "data": {
        "items": [
            {
                "downloadRequestId": "e9b2bf4b-9aa0-4be7-8ed6-63896979d137",
                "version": "4.0",
                "series": "F",
                "number": "FUNK671228PH6-90",
                "date": "2025-06-18T18:58:30.000",
                "paymentForm": "01",
                "paymentMethod": "PUE",
                "certificateNumber": "30001000000500003446",
                "paymentConditions": null,
                "subTotal": 200,
                "discount": 5.85,
                "currency": "MXN",
                "exchangeRate": 1,
                "total": 226.15,
                "invoiceType": "I",
                "export": "01",
                "expeditionZipCode": "42501",
                "confirmation": null,
                "totalWithheldTaxes": 0,
                "totalTransferredTaxes": 32,
                "xmlGlobalInformation": null,
                "taxes": [
                    {
                        "base": 200,
                        "tax": "002",
                        "taxType": "Tasa",
                        "rate": 0.16,
                        "amount": 32,
                        "taxFlag": "T",
                        "xmlId": "efd84190-bc60-4251-a7e5-8768befa3d47",
                        "id": "8ea07f6e-8b67-4710-8fda-b14fb1cf8fb8",
                        "createdAt": "2025-08-14T19:15:33.814",
                        "updatedAt": "2025-08-14T19:15:33.814"
                    }
                ],
                "xmlRelated": [],
                "xmlIssuer": {
                    "tin": "FUNK671228PH6",
                    "legalName": "KARLA FUENTE NOLASCO",
                    "taxRegime": "626",
                    "id": "6bd719c8-d947-4f13-90e5-9199f8c8dd61",
                    "createdAt": "2025-08-14T19:15:33.814",
                    "updatedAt": "2025-08-14T19:15:33.814"
                },
                "xmlRecipient": {
                    "tin": "EKU9003173C9",
                    "legalName": "ESCUELA KEMPER URGATE",
                    "zipCode": "42501",
                    "taxRegime": "601",
                    "cfdiUse": "G03",
                    "foreignTaxId": null,
                    "fiscalResidence": null,
                    "id": "ebcf40a1-de99-4c02-bbdb-31f6af79c60a",
                    "createdAt": "2025-08-14T19:15:33.814",
                    "updatedAt": "2025-08-14T19:15:33.814"
                },
                "xmlItems": [
                    {
                        "xmlId": "efd84190-bc60-4251-a7e5-8768befa3d47",
                        "itemCode": "84111500",
                        "sku": "310301b3-1ae9-441b-b463-51a8f9ca8ba2",
                        "quantity": 1,
                        "unitMeasurement": "E48",
                        "description": "Servicios contables",
                        "unitPrice": 200,
                        "amount": 200,
                        "discount": 5.85,
                        "taxObject": "02",
                        "thirdPartyAccount": null,
                        "xmlItemCustomsInformation": [],
                        "xmlItemPropertyAccounts": [],
                        "taxes": [
                            {
                                "base": 200,
                                "tax": "002",
                                "taxType": "Tasa",
                                "rate": 0.16,
                                "amount": 32,
                                "taxFlag": "T",
                                "tenantId": "102e5f13-e114-41dd-bea7-507fce177281",
                                "isShared": false,
                                "xmlItemId": "58e3085e-28d1-4ed0-ab28-a2ec7616961a",
                                "id": "3140cd5a-6b2c-4e1f-ad0f-d8203fddffc0",
                                "createdAt": "2025-08-14T19:15:33.814",
                                "updatedAt": "2025-08-14T19:15:33.814"
                            }
                        ],
                        "id": "58e3085e-28d1-4ed0-ab28-a2ec7616961a",
                        "createdAt": "2025-08-14T19:15:33.814",
                        "updatedAt": "2025-08-14T19:15:33.814"
                    }
                ],
                "xmlComplements": [
                    {
                        "complementName": "TimbreFiscalDigital",
                        "base64ComplementValue": "<base64>",
                        "xmlId": "efd84190-bc60-4251-a7e5-8768befa3d47",
                        "id": "b2c6c551-f600-4f72-bb5a-5368a1d88256",
                        "createdAt": "2025-08-14T19:15:33.814",
                        "updatedAt": "2025-08-14T19:15:33.814"
                    }
                ],
                "base64Content": "<base64>",
                "id": "efd84190-bc60-4251-a7e5-8768befa3d47",
                "createdAt": "2025-08-14T19:15:33.814",
                "updatedAt": "2025-08-14T19:15:33.814"
            },
            {
                "downloadRequestId": "e9b2bf4b-9aa0-4be7-8ed6-63896979d137",
                "version": "4.0",
                "series": "CN",
                "number": "FUNK671228PH6-30",
                "date": "2025-06-12T11:39:42.000",
                "paymentForm": "03",
                "paymentMethod": "PUE",
                "certificateNumber": "30001000000500003446",
                "paymentConditions": null,
                "subTotal": 150,
                "discount": 0,
                "currency": "MXN",
                "exchangeRate": 1,
                "total": 174,
                "invoiceType": "E",
                "export": "01",
                "expeditionZipCode": "01160",
                "confirmation": null,
                "totalWithheldTaxes": 0,
                "totalTransferredTaxes": 24,
                "xmlGlobalInformation": null,
                "taxes": [
                    {
                        "base": 150,
                        "tax": "002",
                        "taxType": "Tasa",
                        "rate": 0.16,
                        "amount": 24,
                        "taxFlag": "T",
                        "xmlId": "fd064209-ac8d-42a2-8435-43c2b02d6218",
                        "id": "091b411e-f71e-42a4-bbe8-8599a6e55bd7",
                        "createdAt": "2025-08-14T19:15:33.814",
                        "updatedAt": "2025-08-14T19:15:33.814"
                    }
                ],
                "xmlRelated": [
                    {
                        "xmlId": "fd064209-ac8d-42a2-8435-43c2b02d6218",
                        "relationshipType": "01",
                        "cfdiUuid": "5FB2822E-396D-4725-8521-CDC4BDD20CCF",
                        "id": "7a9f358e-896b-4f84-a787-c8c81c4ffec3",
                        "createdAt": "2025-08-14T19:15:33.814",
                        "updatedAt": "2025-08-14T19:15:33.814"
                    }
                ],
                "xmlIssuer": {
                    "tin": "FUNK671228PH6",
                    "legalName": "KARLA FUENTE NOLASCO",
                    "taxRegime": "626",
                    "id": "dc14ed55-9b39-497b-b534-9f5f36481ce6",
                    "createdAt": "2025-08-14T19:15:33.814",
                    "updatedAt": "2025-08-14T19:15:33.814"
                },
                "xmlRecipient": {
                    "tin": "EKU9003173C9",
                    "legalName": "ESCUELA KEMPER URGATE",
                    "zipCode": "42501",
                    "taxRegime": "601",
                    "cfdiUse": "G03",
                    "foreignTaxId": null,
                    "fiscalResidence": null,
                    "id": "d99cd1a5-8c4e-4461-a2ee-7795a208cd88",
                    "createdAt": "2025-08-14T19:15:33.814",
                    "updatedAt": "2025-08-14T19:15:33.814"
                },
                "xmlItems": [
                    {
                        "xmlId": "fd064209-ac8d-42a2-8435-43c2b02d6218",
                        "itemCode": "84111500",
                        "sku": "310301b3-1ae9-441b-b463-51a8f9ca8ba2",
                        "quantity": 1,
                        "unitMeasurement": "E48",
                        "description": "Servicios contables",
                        "unitPrice": 150,
                        "amount": 150,
                        "discount": 0,
                        "taxObject": "02",
                        "thirdPartyAccount": null,
                        "xmlItemCustomsInformation": [],
                        "xmlItemPropertyAccounts": [],
                        "taxes": [
                            {
                                "base": 150,
                                "tax": "002",
                                "taxType": "Tasa",
                                "rate": 0.16,
                                "amount": 24,
                                "taxFlag": "T",
                                "tenantId": "102e5f13-e114-41dd-bea7-507fce177281",
                                "isShared": false,
                                "xmlItemId": "cf5720b6-9349-414f-b2fe-4c7d731d01fc",
                                "id": "d4e62386-486f-44aa-8153-988bf80a1632",
                                "createdAt": "2025-08-14T19:15:33.814",
                                "updatedAt": "2025-08-14T19:15:33.814"
                            }
                        ],
                        "id": "cf5720b6-9349-414f-b2fe-4c7d731d01fc",
                        "createdAt": "2025-08-14T19:15:33.814",
                        "updatedAt": "2025-08-14T19:15:33.814"
                    }
                ],
                "xmlComplements": [
                    {
                        "complementName": "TimbreFiscalDigital",
                        "base64ComplementValue": "<base64>",
                        "xmlId": "fd064209-ac8d-42a2-8435-43c2b02d6218",
                        "id": "7288e5e4-3ef5-44c8-8592-9ce68e8940c8",
                        "createdAt": "2025-08-14T19:15:33.814",
                        "updatedAt": "2025-08-14T19:15:33.814"
                    }
                ],
                "base64Content": "<base64>",
                "id": "fd064209-ac8d-42a2-8435-43c2b02d6218",
                "createdAt": "2025-08-14T19:15:33.814",
                "updatedAt": "2025-08-14T19:15:33.814"
            },
            {
                "downloadRequestId": "e9b2bf4b-9aa0-4be7-8ed6-63896979d137",
                "version": "4.0",
                "series": "F:123",
                "number": "FUNK671228PH6-2",
                "date": "2025-06-12T11:39:42.000",
                "paymentForm": "01",
                "paymentMethod": "PUE",
                "certificateNumber": "30001000000500003446",
                "paymentConditions": null,
                "subTotal": 250.85,
                "discount": 0,
                "currency": "MXN",
                "exchangeRate": 1,
                "total": 290.99,
                "invoiceType": "I",
                "export": "01",
                "expeditionZipCode": "42501",
                "confirmation": null,
                "totalWithheldTaxes": 0,
                "totalTransferredTaxes": 40.14,
                "xmlGlobalInformation": null,
                "taxes": [
                    {
                        "base": 250.85,
                        "tax": "002",
                        "taxType": "Tasa",
                        "rate": 0.16,
                        "amount": 40.14,
                        "taxFlag": "T",
                        "xmlId": "6abcf066-a7aa-452e-89d7-8c77d27ef961",
                        "id": "63a1e43d-d81d-4156-8762-734be6afaadc",
                        "createdAt": "2025-08-14T19:15:33.814",
                        "updatedAt": "2025-08-14T19:15:33.814"
                    }
                ],
                "xmlRelated": [],
                "xmlIssuer": {
                    "tin": "FUNK671228PH6",
                    "legalName": "KARLA FUENTE NOLASCO",
                    "taxRegime": "626",
                    "id": "ef48a8ff-95e7-4dc3-84b6-e6bfcc6f87bc",
                    "createdAt": "2025-08-14T19:15:33.814",
                    "updatedAt": "2025-08-14T19:15:33.814"
                },
                "xmlRecipient": {
                    "tin": "EKU9003173C9",
                    "legalName": "ESCUELA KEMPER URGATE",
                    "zipCode": "42501",
                    "taxRegime": "601",
                    "cfdiUse": "G03",
                    "foreignTaxId": null,
                    "fiscalResidence": null,
                    "id": "8708039d-3638-4baa-af72-ee0fda895578",
                    "createdAt": "2025-08-14T19:15:33.814",
                    "updatedAt": "2025-08-14T19:15:33.814"
                },
                "xmlItems": [
                    {
                        "xmlId": "6abcf066-a7aa-452e-89d7-8c77d27ef961",
                        "itemCode": "84111500",
                        "sku": "310301b3-1ae9-441b-b463-51a8f9ca8ba2",
                        "quantity": 1,
                        "unitMeasurement": "E48",
                        "description": "Servicios contables",
                        "unitPrice": 250.85,
                        "amount": 250.85,
                        "discount": 0,
                        "taxObject": "02",
                        "thirdPartyAccount": null,
                        "xmlItemCustomsInformation": [],
                        "xmlItemPropertyAccounts": [],
                        "taxes": [
                            {
                                "base": 250.85,
                                "tax": "002",
                                "taxType": "Tasa",
                                "rate": 0.16,
                                "amount": 40.136,
                                "taxFlag": "T",
                                "tenantId": "102e5f13-e114-41dd-bea7-507fce177281",
                                "isShared": false,
                                "xmlItemId": "6e59e440-12a1-41cc-81eb-ead2222ed56a",
                                "id": "917e29e0-6094-47c6-aaa9-518d2c1254c5",
                                "createdAt": "2025-08-14T19:15:33.814",
                                "updatedAt": "2025-08-14T19:15:33.814"
                            }
                        ],
                        "id": "6e59e440-12a1-41cc-81eb-ead2222ed56a",
                        "createdAt": "2025-08-14T19:15:33.814",
                        "updatedAt": "2025-08-14T19:15:33.814"
                    }
                ],
                "xmlComplements": [
                    {
                        "complementName": "TimbreFiscalDigital",
                        "base64ComplementValue": "<base64>",
                        "xmlId": "6abcf066-a7aa-452e-89d7-8c77d27ef961",
                        "id": "72166516-251c-40ef-803e-ec5c9801209e",
                        "createdAt": "2025-08-14T19:15:33.814",
                        "updatedAt": "2025-08-14T19:15:33.814"
                    }
                ],
                "base64Content": "<base64>",
                "id": "6abcf066-a7aa-452e-89d7-8c77d27ef961",
                "createdAt": "2025-08-14T19:15:33.814",
                "updatedAt": "2025-08-14T19:15:33.814"
            }
        ],
        "pageNumber": 1,
        "totalPages": 1,
        "totalCount": 3,
        "hasPreviousPage": false,
        "hasNextPage": false
    },
    "succeeded": true,
    "message": "",
    "details": "",
    "httpStatusCode": 200
}

GET/api/v4/download-requests/<id>/meta-items

List meta-items by ID

This endpoint returns the downloaded metadata of a request, by its ID. The three dates of each record (invoiceDate, satCertificationDate, and cancellationDate) come from the SAT metadata as is.

In particular, invoiceDate is the CFDI's Fecha: the local time at the place of issue, with no time zone. None of the three dates depends on the X-TIME-ZONE header.

Request

GET
/api/v4/download-requests/<id>/meta-items
curl --location 'https://test.fiscalapi.com/api/v4/download-requests/2c6aafcf-8cd2-4fb1-94a8-687adc671380/meta-items' \
--header 'X-TENANT-KEY: <tenant-key>' \
--header 'X-TIME-ZONE: America/Mexico_City' \
--header 'X-API-KEY: <api-key>'

Response

{
    "data": {
        "items": [
            {
                "invoiceUuid": "c8b8addd-e834-4f94-b410-31723018d7ea",
                "issuerTin": "FUNK671228PH6",
                "issuerName": "KARLA FUENTE NOLASCO",
                "recipientTin": "EKU9003173C9",
                "recipientName": "ESCUELA KEMPER URGATE",
                "pacTin": "PAC010203ABC",
                "invoiceDate": "2025-06-12T11:39:42.000",
                "satCertificationDate": "2025-08-15T12:24:27.000",
                "amount": 174,
                "invoiceType": "E",
                "status": 1,
                "cancellationDate": null,
                "downloadPackageId": null,
                "downloadRequestId": "71bdec41-fd18-4f1b-9e5e-2b9cdad9978f",
                "id": "19deb039-0150-47c9-8f16-975fe897d06c",
                "createdAt": "2025-08-15T12:24:27.562",
                "updatedAt": "2025-08-15T12:24:27.562"
            },
            {
                "invoiceUuid": "6e98b006-4783-4712-a0bb-fef8f11c459a",
                "issuerTin": "FUNK671228PH6",
                "issuerName": "KARLA FUENTE NOLASCO",
                "recipientTin": "EKU9003173C9",
                "recipientName": "ESCUELA KEMPER URGATE",
                "pacTin": "PAC010203ABC",
                "invoiceDate": "2025-06-12T11:39:42.000",
                "satCertificationDate": "2025-08-15T12:24:27.000",
                "amount": 290.99,
                "invoiceType": "I",
                "status": 1,
                "cancellationDate": null,
                "downloadPackageId": null,
                "downloadRequestId": "71bdec41-fd18-4f1b-9e5e-2b9cdad9978f",
                "id": "c6a65658-4ce2-4ab3-b462-dba1ecdaa6d2",
                "createdAt": "2025-08-15T12:24:27.562",
                "updatedAt": "2025-08-15T12:24:27.562"
            }
        ],
        "pageNumber": 1,
        "totalPages": 2,
        "totalCount": 3,
        "hasPreviousPage": false,
        "hasNextPage": false
    },
    "succeeded": true,
    "message": "",
    "details": "",
    "httpStatusCode": 200
}

GET/api/v4/download-requests/<id>/package

Download a package by ID

This endpoint downloads the package (a ZIP file) with a request's CFDIs, by its ID. The package exists only when the request has the Completada (Completed) status.

With any other status, the endpoint returns 425 (Too Early) with "succeeded": false, "message": "Too Early", and the Retry-After: 1800 header (in seconds). Those statuses are Esperando SAT (Waiting for SAT), Esperando API (Waiting for API), and Abandonada (Abandoned). Check the status with Get a request by ID and download the package once it's Completada (Completed). An Abandonada (Abandoned) request never completes; see the request lifecycle.

Errors

The messages arrive in details. In them, <id> is the request ID and <estatus> is its current status.

StatusWhen it happensMessage
404The request doesn't exist or belongs to another tenant.No such resource for the given Id: <id>
425The request doesn't have the Completada (Completed) status.El paquete aún no estÔ disponible: la solicitud estÔ en estatus '<estatus>'. Solo puede descargarse cuando el estatus es 'Completada'. Consulta la solicitud con GET download-requests/<id> y reintenta en 1800 segundos o mÔs.

Request

GET
/api/v4/download-requests/<id>/package
curl --location 'https://test.fiscalapi.com/api/v4/download-requests/2c6aafcf-8cd2-4fb1-94a8-687adc671380/package' \
--header 'X-TENANT-KEY: <tenant-key>' \
--header 'X-TIME-ZONE: America/Mexico_City' \
--header 'X-API-KEY: <api-key>'

This example omits the Base64 content because of its size.

Response

{
    "data": [
        {
            "base64File": "<base64>",
            "fileName": "4216856e-7191-4429-9884-814662fc4c09_01.zip",
            "fileExtension": ".zip"
        }
    ],
    "succeeded": true,
    "message": "",
    "details": "",
    "httpStatusCode": 200
}

GET/api/v4/download-requests/<id>/raw-request

Download the SAT request by ID

This endpoint downloads, as an XML file, the raw request that Fiscalapi sent to the SAT for a download request, by its ID. Use it to debug the request.

Errors

In the message, which arrives in details, <id> is the request ID.

StatusWhen it happensMessage
404The request doesn't exist or belongs to another tenant.No such resource for the given Id: <id>

Request

GET
/api/v4/download-requests/<id>/raw-request
curl --location 'https://test.fiscalapi.com/api/v4/download-requests/2c6aafcf-8cd2-4fb1-94a8-687adc671380/raw-request' \
--header 'X-TENANT-KEY: <tenant-key>' \
--header 'X-TIME-ZONE: America/Mexico_City' \
--header 'X-API-KEY: <api-key>'

This example omits the Base64 content because of its size.

Response

{
    "data": {
        "base64File": "<base64>",
        "fileName": "RawRequest_cd9959d1-3c6d-40d7-bf13-551b2265dded.xml",
        "fileExtension": ".xml"
    },
    "succeeded": true,
    "message": "",
    "details": "",
    "httpStatusCode": 200
}

GET/api/v4/download-requests/<id>/raw-response

Download the SAT response by ID

This endpoint downloads, as an XML file, the raw response that the SAT returned for a download request, by its ID. Use it to debug the response.

Errors

In the message, which arrives in details, <id> is the request ID.

StatusWhen it happensMessage
404The request doesn't exist or belongs to another tenant.No such resource for the given Id: <id>

Request

GET
/api/v4/download-requests/<id>/raw-response
curl --location 'https://test.fiscalapi.com/api/v4/download-requests/2c6aafcf-8cd2-4fb1-94a8-687adc671380/raw-response' \
--header 'X-TENANT-KEY: <tenant-key>' \
--header 'X-TIME-ZONE: America/Mexico_City' \
--header 'X-API-KEY: <api-key>'

This example omits the Base64 content because of its size.

Response

{
    "data": {
        "base64File": "<base64>",
        "fileName": "RawResponse_cd9959d1-3c6d-40d7-bf13-551b2265dded.xml",
        "fileExtension": ".xml"
    },
    "succeeded": true,
    "message": "",
    "details": "",
    "httpStatusCode": 200
}

DELETE/api/v4/download-requests/<id>

Delete a request by ID

This endpoint deletes a download request by its ID.

Errors

In the message, which arrives in details, <id> is the request ID.

StatusWhen it happensMessage
404The request doesn't exist or belongs to another tenant.No such resource for the given Id: <id>

Request

DELETE
/api/v4/download-requests/<id>
curl --location --request DELETE 'https://test.fiscalapi.com/api/v4/download-requests/5d2dfd35-9e1c-4263-973e-5121aef74087' \
--header 'X-TENANT-KEY: <tenant-key>' \
--header 'X-TIME-ZONE: America/Mexico_City' \
--header 'X-API-KEY: <api-key>'

Response

{
    "data": true,
    "succeeded": true,
    "message": "",
    "details": "",
    "httpStatusCode": 200
}

Was this page helpful?