Fiscalapi

Issue and stamp CFDI invoices with a REST API

An API to issue CFDI 4.0 (Mexico's electronic invoice) and stamp every invoice (stamping: the certification by a SAT-authorized provider that makes a CFDI valid) with the SAT (Mexico's tax authority). Issue income, credit note, payment, and payroll CFDIs, plus complements (XML extensions the SAT defines for specific operations). Issue them from all your RFCs (Mexico's taxpayer IDs) in one place.

Supported document types

Generate any CFDI 4.0 type with our API

Income

Standard sales invoices for goods and services.

Credit note

Credit notes for returns, linked to income invoices.

Payment

Payment complements (the complement that records each payment received against a PPD invoice; the type P CFDI that carries it is also called REP) for invoices paid in installments.

Payroll

Employee payroll receipts with the payroll complement 1.2.

Global invoices

A global invoice (factura global, one CFDI that groups a period's sales to the general public).

Local taxes

Support for the local taxes complement (the CFDI complement for state and municipal taxes).

Carta Porte

Carta Porte 3.1 (the CFDI complement that documents the transport of goods in Mexico).

Comercio Exterior

Comercio Exterior (the CFDI foreign trade complement for exports) for international transactions.

How to generate a CFDI 4.0 invoice through the API

Four steps to issue your first SAT-stamped CFDI from your system.

  1. 1

    Sign up and get your API key

    Sign up, set up your issuer RFC with its CSD (the digital seal certificate used to sign CFDIs), and get the credentials that authenticate your calls.

  2. 2

    Build the JSON payload

    Define the CFDI in JSON: version 4.0, series, date, issuer, recipient, line items, form of payment (how the customer paid: cash, bank transfer, card; the FormaPago key), and payment method (whether the CFDI is paid in full when issued, PUE, or later or in installments, PPD; not how the customer pays).

  3. 3

    Send the stamping request

    A single POST to the invoices endpoint validates, seals, and stamps the CFDI with the SAT.

  4. 4

    Receive the stamped CFDI

    The response contains the XML with its UUID (folio fiscal, the unique ID the PAC assigns when it stamps a CFDI), the SAT seal (the seal inside the digital tax stamp that certifies the CFDI), and the PDF, ready to download.

Key capabilities

POST /api/v4/invoices
POST /api/v4/invoices
{
"versionCode": "4.0",
"series": "F",
"typeCode": "I",
"paymentFormCode": "99",
"currencyCode": "MXN",
"issuer": { "id": "bef56..." },
"recipient": { "id": "78d38..." },
"items": [{ "quantity": 1 }]
}
200 OK

JSON invoicing

Generate CFDIs through HTTP calls with JSON payloads. Skip hand-built XML and needless complexity.

  • Simple, predictable JSON payload
  • Immediate response with the stamped invoice
  • Valid for tax purposes, stamped by a SAT-authorized provider
  • Supports many CFDI 4.0 types
FiscalapiRFC-ARFC-BRFC-CRFC-D

Multi-RFC and multi-company

Invoice from any RFC to any RFC in one place. Works for B2B, B2C, and B2G scenarios without added complexity.

  • All your RFCs in one place
  • Unlimited companies and customers
  • A CSD for each issuer RFC
  • Separate sign-ins and API keys
JSON
PDF

Automatic PDF generation

Every invoice automatically gets its PDF, with branding, logo, and colors you can customize for each RFC.

  • PDF generated along with the XML
  • Custom branding for each RFC
  • Configurable logo and colors
  • Direct download through the API or the dashboard
XML
PDF
REST API|Dashboard

CFDI storage and retrieval

Every invoice is stored as XML and PDF. Retrieve your invoices anytime through the API or the dashboard.

  • Secure XML + PDF storage
  • Retrieval through the REST API
  • Download from the web dashboard
  • Full issuance history
Test
Production

Test environment

A free, unlimited test environment. Validate your whole integration before you move to production.

  • Unlimited stamps (stamping credits) in the test environment
  • Same API, same endpoints
  • Credentials separate from production
  • Full end-to-end simulation

Frequently asked questions about the e-invoicing API

What is an e-invoicing API?

It's a REST service that lets your system generate and stamp CFDI 4.0 invoices with the SAT over HTTP. You don't handle XML by hand or deal with a PAC (a SAT-authorized provider that stamps CFDIs) directly.

Which CFDI 4.0 types can I generate with the API?

Income, credit note, and payment CFDIs; payroll CFDIs with the payroll complement 1.2; global invoices; and the Carta Porte 3.1, Comercio Exterior, and local taxes complements.

Does the API support multiple RFCs?

Yes. You can issue CFDIs from several issuer RFCs in one place, each with its own CSD, with the same API keys.

Is there a test environment to validate your integration?

Yes. Fiscalapi offers a free test environment with unlimited stamps and the same endpoints as production.

Take the next step

Start invoicing today