1. Descarga Masiva SAT
gigstack API
  • Welcome to gigstack API
  • gigstack Connect API Guide
  • Migrar de API v1 a v2 de gigstack
  • Clients
    • Clients API Guide
    • List clients
      GET
    • Get client
      GET
    • Update client
      PUT
    • Create client
      POST
    • Validate client fiscal information
      POST
    • Get client customer portal access token
      POST
    • Stamp pending receipts
      POST
    • Delete client
      DELETE
    • Search clients
      GET
    • Upload CSF PDF to create or update client
      POST
    • Upload support document
      POST
    • List support documents
      GET
  • Services
    • Services API Guide
    • List services
    • Get service
    • Update service
    • Create service
    • Delete service
  • Invoices
    • Invoices API Guide
    • Income
      • List income invoices
      • Create income invoice
      • Get income invoice
    • Egress
      • List egress invoices
      • Create egress invoice
      • Get egress invoice
    • Drafts
      • Create draft invoice (pre-factura)
      • Stamp draft invoice (finalize)
      • Generate draft preview PDF (pre-factura)
      • Delete draft invoice
      • Update draft invoice
      • Get draft invoice
      • List draft invoices
    • List CFDI errors
    • List payment complement invoices
    • Get payment complement invoice
    • Get invoice files
    • Upload support document
    • List support documents
    • Cancel invoice
    • Search invoices
  • Payments
    • Payments API Guide
    • List payments
    • Get payment
    • Request payment
    • Register payment
    • Mark payment as paid
    • Refund payment
    • Cancel payment
    • Search payments
    • Upload support document
    • List support documents
  • Receipts
    • Receipts API Guide
    • List receipts
    • Get receipt
    • Create receipt
    • Stamp receipt
    • Cancel receipt
    • Search receipts
  • Teams
    • Teams API Guide
    • List teams
    • Get team
    • Get team integrations
    • Get team series
    • Get team onboarding URL
    • Update team
    • Update team series
    • Update team settings
    • Create team
    • Add team member
    • Remove team member
    • Create team series
    • Upload SAT CSD certificates
    • Sign manifest document
  • Users
    • Users API Guide
    • List users
    • Get user
    • Update user
    • Create user
    • Reset user password
    • Generate login link
  • Catalogs
    • Tax Regimes Catalog (Régimen Fiscal)
    • Payment Forms | Formas de pago
    • CFDI Usage Catalog (Uso CFDI)
    • Payment Methods Catalog (Método de Pago)
    • Months and Bimesters Catalog (Meses y Bimestres)
    • Invoice Relationships Catalog (Relación entre Facturas)
  • Webhooks
    • Webhooks
    • List webhooks
    • Create webhook
    • Get webhook
    • Update webhook
    • Delete webhook
  • Retentions
    • Retentions
    • List retentions
    • Create retention
    • Get retention
    • Cancel retention
    • Get retention files
  • Descarga Masiva SAT
    • Descarga Masiva
    • Check activation status
      GET
    • Activate Descarga Masiva SAT
      POST
    • Deactivate Descarga Masiva SAT
      POST
    • Upload FIEL credentials
      POST
    • Register business with SAT (manual)
      POST
    • Get schedule configuration
      GET
    • Save schedule configuration
      PUT
    • Get download request history
      GET
    • Create bulk download request
      POST
    • Check download request status
      GET
    • Download XML package
      GET
    • Get single invoice from SAT
      GET
    • Debug registration status
      GET
    • Enable SAT sync
      POST
  • Schemas
    • Schemas
      • ApiResponse
      • Category
      • Pet
      • Tag
      • Order
      • StandardizedSuccessResponse
      • StandardizedErrorResponse
      • ApiErrorCode
    • RequestBodies
      • UserArray
    • OrderDirection
    • ApiPublicClient
    • Client
    • DateRangeFilter
    • Service
    • ListQueryParams
    • ClientInput
    • ApiPublicService
    • ServiceInput
    • PaginationMeta
    • Invoice
    • InvoiceIncomeInput
    • Payment
    • PaymentInput
    • PaymentItem
    • InvoiceInput
    • InvoiceEgressInput
    • Team
    • PaymentAllowedMethod
    • TeamInput
    • TeamSettingsInput
    • CfdiError
    • ApiPublicPaymentProcessorDetails
    • User
    • DraftInvoiceInput
    • ApiPublicPayment
    • UserInput
    • ClientAddress
    • DraftInvoiceUpdateInput
    • DraftInvoiceOutput
    • TaxSchema
    • RequestPaymentInput
    • StandardSuccessResponse
    • RegisterPaymentInput
    • ListResponse
    • ErrorResponse
    • ApiPublicIncomeInvoice
    • ValidationErrorResponse
    • RefundPaymentInput
    • ApiPublicTeam
    • MarkPaymentAsPaidInput
    • UnauthorizedError
    • ApiPublicUser
    • ApiPublicSearch
    • NotFoundError
    • ApiPublicThirdParty
    • InternalServerError
    • ApiPublicInvoiceConfig
    • ApiPublicRefund
    • ApiPublicAutomations
    • TeamSettings
    • TaxElement
    • SeriesInput
    • Series
    • ApiPublicWebhook
    • WebhookInput
    • ReceiptInput
    • WebhookUpdateInput
    • PaymentMethodEnum
    • PaymentFormEnum
    • AutomationTypeEnum
    • ItemSchema
    • SATDocument
    • UploadSupportDocumentInput
  1. Descarga Masiva SAT

Descarga Masiva

Descarga Masiva SAT Guide#

Download all your issued and received CFDI invoices directly from SAT using your FIEL (Firma Electrónica Avanzada). Descarga Masiva gives you a complete history of every invoice associated with your RFC — whether you issued it in gigstack or not.

Overview#

The Descarga Masiva API lets you connect your RFC to SAT's bulk download service and retrieve your full invoice history. You can run one-time requests for specific date ranges, or set up a daily schedule that automatically syncs new invoices.

Key Features#

Full Invoice History - Download all issued and received CFDIs from SAT, regardless of origin
Automatic Daily Sync - Schedule recurring downloads to keep your data up to date
FIEL Authentication - Secure connection using your electronic signature (FIEL)
Live Status Updates - Status polling refreshes pending requests in real time
Metered Billing - Pay only for what you download ($0.20 MXN per XML)

Prerequisites#

Before using Descarga Masiva:
1.
Your team must have a valid RFC configured
2.
You need an active paid gigstack plan
3.
You must have your FIEL files (.cer + .key) and their password ready
FIEL vs CSD: The FIEL (Firma Electrónica Avanzada) is your personal digital identity certificate used to authenticate with SAT. It is different from the CSD (Certificado de Sello Digital), which is used to stamp CFDI invoices. You need both for full gigstack functionality.

Setup Flow#

Step 1 — Check Activation Status#

Before anything else, check whether Descarga Masiva is activated for your team.
Response:
{
    "success": true,
    "data": {
        "status": "needs_activation",
        "planIncludesFeature": true,
        "isActivated": false,
        "pricing": {
            "perDownload": "$0.20 MXN",
            "addonMonthly": null
        }
    }
}
Status values:
StatusMeaningNext step
activeReady to useGo to Step 3
needs_activationYour plan includes it, not yet turned onCall POST /activate
needs_addonPaid plan, feature not includedCall POST /activate — adds $400 MXN/RFC/month
needs_upgradeFree planUpgrade your plan first

Step 2 — Activate#

Response:
{
    "success": true,
    "message": "Descarga Masiva activada. Cada descarga de XML consumirá créditos SAT.",
    "data": {
        "type": "included",
        "activated": true
    }
}
Billing:
If your plan includes Descarga Masiva (type: "included"): activation is free — you only pay $0.20 MXN per XML downloaded.
If activating as an add-on (type: "addon"): 400MXN/RFC/monthisaddedtoyoursubscription,proratedtotoday,plus0.20 MXN per XML.

Step 3 — Upload your FIEL#

This is the main setup step. Upload your .cer and .key files along with the password. gigstack validates your FIEL, securely stores the credentials, and automatically registers your RFC with SAT — all in one request.
Parameters:
FieldTypeRequiredDescription
certfileYes.cer file from SAT
keyfileYes.key file from SAT
passwordstringYesPassword for the .key file
sync_start_datestringRecommendedStart date for historical sync (YYYY-MM-DD, up to 71 months back)
phonestringRecommendedContact phone in international format (+52...)
Response:
{
    "success": true,
    "message": "FIEL credentials stored successfully. Business registered with SAT sync enabled.",
    "data": {
        "rfc": "XAXX010101000",
        "expires_at": 1893456000000,
        "expires_at_readable": "2029-12-31T00:00:00.000Z",
        "serial_number": "00001000000504465028",
        "sync_start_date": "2023-01-01",
        "phone": "+5215512345678",
        "registered": true,
        "registered_at": 1743600000000
    }
}
When registered: true, your RFC is connected to SAT and you can start downloading invoices immediately.
If registered: false, registration failed (rare — usually a temporary SAT service issue). Use POST /v2/invoices/download/register to retry.

Downloading Invoices#

Once activated and registered, you have two options: scheduled daily sync or manual requests.

Option A — Scheduled Daily Sync#

Set up a schedule and gigstack automatically downloads new invoices every day.
Parameters:
FieldTypeRequiredDescription
enabledbooleanYesEnable or disable the schedule
timestringYesRun time in HH:mm format (America/Mexico_City timezone)
download_typesarrayYes["issued"], ["received"], or ["issued", "received"]
days_backintegerYesHow many days back to look on each run (1–90)
Response:
{
    "success": true,
    "message": "Scheduled download enabled successfully",
    "data": {
        "schedule": {
            "enabled": true,
            "time": "21:00",
            "downloadTypes": ["received"],
            "daysBack": 1,
            "lastRunAt": null,
            "lastRunStatus": null,
            "lastRunError": null
        }
    }
}
To check your current schedule configuration and FIEL status:

Option B — Manual Download Request#

Submit a request for a specific date range. SAT processes it asynchronously.
Parameters:
FieldTypeRequiredDescription
start_datestringYesStart of date range (YYYY-MM-DD)
end_datestringYesEnd of date range (YYYY-MM-DD, max 1 month from start)
rfc_typestringNo"issued" or "received" (default: "received")
request_typestringNo"cfdi" (XML files) or "metadata" (default: "cfdi")
invoice_typestringNoFilter by CFDI type: I, E, P, N, T
invoice_statusstringNo"active", "cancelled", or "all" (default: "all")
third_party_rfcstringNoFilter by counterparty RFC
Date range limit: SAT limits each request to a maximum of 1 month. For longer periods, submit one request per month.
Response:
{
    "success": true,
    "data": {
        "request_id": "req_abc123",
        "status": "pending",
        "duplicate": false
    }
}

Tracking Request Status#

Check the status of your download history — pending requests are updated in real time:
Response:
{
    "success": true,
    "data": {
        "history": [
            {
                "id": "req_abc123",
                "rfcType": "received",
                "startDate": "2024-01-01",
                "endDate": "2024-01-31",
                "status": "completed",
                "invoiceCount": 143,
                "processedCount": 143,
                "source": "manual",
                "latestIssueDate": "2024-01-30",
                "earliestIssueDate": "2024-01-02",
                "createdAt": 1706745600000,
                "completedAt": 1706832000000
            }
        ]
    }
}
Status values:
StatusMeaning
pendingRequest queued, being sent to SAT
acceptedSAT accepted the request
processingSAT is generating the package
completedDone — invoice count available
failedSAT rejected (check statusMessage)
expiredPackage expired before download

Deactivation#

To stop Descarga Masiva and remove billing:
Scheduled downloads stop immediately. If the feature was billed as an add-on, the charge is removed from your subscription (prorated). Any XML downloads already recorded in the current period are still billed at period end.

Common Errors#

ErrorCauseFix
RFC mismatchCertificate RFC doesn't match your team RFCUpload the FIEL that belongs to this team's RFC
Certificate expiredFIEL has expiredRenew your FIEL at SAT's portal
Failed to decrypt private keyWrong password for the .key fileUse the password created when generating the FIEL
Invalid certificate file formatWrong file typeUpload .cer and .key files directly from SAT — do not convert
Team RFC not configuredTeam has no RFCSet up your fiscal information in gigstack settings first
No active subscriptionNo paid planActivate a paid plan before using Descarga Masiva
duplicate: trueSame request already submittedNo action needed — the existing request is still processing

Full Endpoint Reference#

MethodEndpointDescription
GET/v2/invoices/download/activate/statusCheck activation status
POST/v2/invoices/download/activateActivate billing
POST/v2/invoices/download/deactivateDeactivate billing
POST/v2/invoices/download/fielUpload FIEL credentials
POST/v2/invoices/download/registerManual SAT registration (fallback)
GET/v2/invoices/download/scheduleGet schedule + FIEL status
PUT/v2/invoices/download/scheduleSave schedule config
GET/v2/invoices/download/schedule/historyDownload request history
POST/v2/invoices/download/requestSubmit manual download request
GET/v2/invoices/download/status/:request_idCheck specific request
GET/v2/invoices/download/package/:package_idDownload ZIP of XMLs
GET/v2/invoices/download/invoice/:uuidGet single CFDI from SAT
GET/v2/invoices/download/debugDebug SAT connectivity
Modified at 2026-04-03 00:27:45
Previous
Get retention files
Next
Check activation status
Built with