Skip to content

Stamp CFDI 4.0 from your own system,
without paying for the API

Send a JSON or your already-sealed XML and get back the stamped CFDI with XML and PDF. API v5 is included: you pay for folios that never expire, 1 per stamped CFDI.

JSON · XML Base64 · XML file

$0
To use the API
1 folio
Per stamped CFDI
100%
Uptime
2008
Invoicing since

Stamp your way

Starting from scratch? Send JSON. Already generating and sealing your own XML? Just change where you send it.

To connect your ERP or your system

You send the data as JSON and we generate the XML, seal it with your account's CSD and stamp it. You get the UUID, the XML in Base64 and the PDF link.

  • Fecha, Folio and Carta Porte IdCCP accept "AUTO"
  • PDF with the template you choose (plantilla_id)
  • Email the CFDI at stamping time (enviar_mail)
  • SAT errors in Spanish, with the element and field
Endpoint
POST /api/v5/invoice/create
factura.jsonIncome invoice with 16% IVA
{
  "Version": "4.0",
  "Serie": "F",
  "Folio": "AUTO",
  "Fecha": "AUTO",
  "FormaPago": "03",
  "MetodoPago": "PUE",
  "Moneda": "MXN",
  "TipoDeComprobante": "I",
  "Exportacion": "01",
  "LugarExpedicion": "64000",
  "SubTotal": "1000.00",
  "Total": "1160.00",
  "Emisor": { "RegimenFiscal": "601" },
  "Receptor": {
    "Rfc": "XIA190128J61",
    "Nombre": "XENON INDUSTRIAL ARTICLES",
    "DomicilioFiscalReceptor": "76343",
    "RegimenFiscalReceptor": "601",
    "UsoCFDI": "G03"
  },
  "Conceptos": [{
    "ClaveProdServ": "81111811",
    "Cantidad": "1",
    "ClaveUnidad": "E48",
    "Descripcion": "Servicio de soporte técnico",
    "ValorUnitario": "1000.00",
    "Importe": "1000.00",
    "ObjetoImp": "02",
    "Impuestos": { "Traslados": [{
      "Base": "1000.00",
      "Impuesto": "002",
      "TipoFactor": "Tasa",
      "TasaOCuota": "0.160000",
      "Importe": "160.00"
    }] }
  }],
  "Impuestos": { ... },
  "enviar_mail": {
    "destinatarios": "cliente@facturadigital.com.mx"
  }
}

Sent in the json field of POST /invoice/create:

curl -X POST \
  "https://app.facturadigital.com.mx/api/v5/invoice/create" \
  -H "X-Api-Key: $FD_API_KEY" \
  --data-urlencode "json@factura.json"
Production
https://app.facturadigital.com.mx/api/v5
Sandbox
https://sandbox-app.facturadigital.com.mx/api/v5

What API v5 includes

No extra cost: you pay for folios, not the API.

WebhooksNew

Your system gets a signed notification when a CFDI is stamped or cancelled, or a payment is recorded. If it doesn't respond, the notification is retried.

Official SDKsNew

The API is REST over HTTPS and works with any language. If you'd rather use a library, there are SDKs for Node.js, PHP and Python.

MCP serverNew

Connect Claude, ChatGPT or Gemini to your account. The assistant prepares the invoice and you confirm before it's stamped.

The full CFDI lifecycle

Stamp, cancel with reasons 01 to 04, re-send by email, list issued, received and payments, and look up related CFDI.

Catalogs, self-invoicing and validation

Create customers, products and suppliers; register tickets for your self-invoicing kiosk; and validate RFCs, blacklists and CFDI status with separate credits.

Ultra-fast PAC stamping with backup

If a PAC doesn't respond, your CFDI still gets stamped and your integration doesn't change. It runs on AWS (Mexico region) and Google Cloud; your XML and PDF files are stored for 5 years.

Integrate in 4 steps

  1. 01

    Create your sandbox account

    It's free, and the CFDI you generate there have no tax validity.

  2. 02

    Upload your CSD

    In Configuración → Certificados (Settings → Certificates), upload your .cer, your .key and the password.

    Use your Certificado de Sello Digital (CSD), not your e.firma.

  3. 03

    Copy your API key

    It's in Configuración → Datos de facturación (Settings → Billing details) and goes in the X-Api-Key header. Sandbox and production use separate keys.

  4. 04

    Make your first request

    Check your folios with GET /account/balance and stamp your first CFDI with POST /invoice/create.

Complements via JSON or XML

Stamp invoices, credit notes, payment receipts, payroll and Carta Porte. Complements are included with a limit; with Premium they're unlimited.

Complements via API
  • Carta Porte 3.1 (income and transfer)
  • Payment receipt (Pagos 2.0) and Payroll 1.2
  • Comercio Exterior 2.0
  • Local taxes, INE, Donatarias, Construction, Payment in kind, Used vehicles and Hydrocarbons
  • IEDU, property tax account and customs entry in line items
  • API only: Detallista, Notaries, Airlines, Artwork, Currency exchange and Third-party billing

Developer guides and tools

Guides by use case

Payment complement

Pagos 2.0 with installments, balances and per-document taxes.

Recipient errors

Keys CFDI40143 to CFDI40161, how they show up in the response and the generic RFC fallback.

For testing without your certificate

Test XML generatorNew

A CFDI 4.0 sealed with the SAT's test RFCs and CSDs, ready for the sandbox.

XML validatorNew

Check your XML's seal, certificate, date and amounts.

JSON validator

Check the invoice/create JSON against the SAT rules and the sandbox.

Examples by language

Stamping in curl, PHP, Node.js, Python, C# and Java.

API questions

Need help with your integration?

Do I need to generate the XML, original chain and seal?

With JSON (POST /invoice/create), no: you send the data and we build the XML, seal it with your CSD and stamp it. If you already generate and seal your XML, send it to /invoice/stampxml (Base64) or /invoice/stampxmlfile (file) and we just stamp it.

Does the API cost extra?

No. API v5 is included: you pay for folios, not the API. Each stamped CFDI uses 1 folio, same as on the web, and folios never expire.

Can I try it for free?

Yes. The sandbox at sandbox-app.facturadigital.com.mx is free and stamps with a test PAC; the CFDI you generate there have no tax validity. When you're ready, switch to the production URL and key.

How do I authenticate?

With the X-Api-Key header. The key already comes Base64-encoded: copy it from Configuración → Datos de facturación or get it with GET /account/authorize by sending your username and password.

Which languages can I use?

Any language that makes HTTPS requests: curl, fetch, Guzzle, requests or HttpClient are enough. If you'd rather use a library, there are official SDKs (new) for Node.js, PHP and Python.

How does my system find out about a cancellation or a payment?

With webhooks (new): we send a signed notification to your system's URL when a CFDI is stamped or cancelled, or when a payment is recorded. If your server doesn't respond, the notification is retried.

Can I invoice from Claude, ChatGPT or Gemini?

Yes, with the MCP server (new). You connect your AI assistant to your account and ask for the invoice; the assistant prepares it and you confirm before it's stamped. It has the same permissions as your user.

What happens if a PAC doesn't respond?

Ultra-fast PAC stamping with backup: if a PAC doesn't respond, your CFDI still gets stamped. The switch happens on our side, with no changes to your integration. The platform runs on AWS (Mexico region) and on Google Cloud.

Can I switch from my current PAC without rewriting my code?

If you already generate and seal your XML, yes: send it as-is to /invoice/stampxml or /invoice/stampxmlfile. You change the URL and authentication; your XML generator stays the same. To cancel without uploading your CSD to the account, use /invoice/cancelwithcsd.

Can I stamp Carta Porte, payment receipts and payroll via API?

Yes: Carta Porte 3.1 (with IdCCP set to "AUTO"), payment receipt 2.0, payroll 1.2, Comercio Exterior 2.0 and the other current complements, plus some that exist only via API, like Detallista or Notaries.

What happens if my JSON has an error?

Nothing is stamped and the response tells you what to fix. If the CFDI doesn't match the SAT schema, the API responds with code 702, a summary in Spanish and an errors list with the element, field and message of each error; for example: «Elemento 'Comprobante': El campo 'Exportacion' es obligatorio.»

I'm an integrator. Can I create my customers' accounts?

Yes, as an enabled partner: account creation and CSD upload via API, only from the IP addresses you register. Message us on WhatsApp to enable it.

Start with 10 free stamps.

No card. Upload your certificate and your CSD, and stamp from your browser.

10 free stamps, no credit card. You finish signing up on the next screen.