FISCALISTO / API
Invoicing API
Stamp CFDI 4.0 from your system with one call: invoices, payments, credit notes, payroll and withholdings, with Fiscalisto's SAT checks.
Fiscalisto's API stamps Mexican electronic invoices (CFDI 4.0) from your server. You send the invoice's data as JSON; Fiscalisto fills in what has a usual value, checks SAT's rules before spending a timbre, seals it with the issuer's certificate, has an authorized PAC stamp it, and answers with the stamped invoice, its UUID, the PDF and the XML.
Field names are in English, as in any API (customer, items, unit_price). These guides are also in Spanish; error messages come in English when you send Accept-Language: en. The API reference is in Spanish, generated from the OpenAPI document.
Your first invoice in a minute
- In Fiscalisto, open Desarrolladores (Developers) in your company's menu (every company has the API). The first time, you get a test key that starts with
fk_test_and a test issuer ready to stamp. No account yet? Create one: you land straight in Desarrolladores with your key. - Keep the key in an environment variable on your server:
export FISCALISTO_API_KEY="fk_test_..."- Stamp an invoice:
curl https://api.fiscalisto.com/v1/invoices \
-H "Authorization: Bearer $FISCALISTO_API_KEY" \
-H "Idempotency-Key: pedido-A-1042" \
-H "Content-Type: application/json" \
-d '{
"customer": {
"tax_id": "ICV060329BY0",
"legal_name": "INMOBILIARIA CVA",
"tax_system": "601",
"zip": "33826"
},
"payment_form": "03",
"items": [
{ "description": "Mensualidad", "product_key": "86121700", "quantity": 2, "unit_price": 2500 }
]
}'The answer is the stamped invoice (201):
{
"id": "inv_OufpKqnrvx9p0Nfbydl9jG4UNGeTYcvdrg",
"object": "invoice",
"livemode": false,
"status": "valid",
"uuid": "5F1E8C2A-3B7D-4C9E-A1B2-C3D4E5F60718",
"folio": "1",
"subtotal": 5000,
"taxes": { "iva": 800, "ieps": 0, "iva_withheld": 0, "isr_withheld": 0, "local_transferred": 0, "local_withheld": 0 },
"total": 5800,
"...": "..."
}- Download the PDF or the XML:
curl https://api.fiscalisto.com/v1/invoices/inv_OufpKqnrvx9p0Nfbydl9jG4UNGeTYcvdrg/pdf \
-H "Authorization: Bearer $FISCALISTO_API_KEY" -o factura.pdfYou didn't send the CFDI use, the payment method, the currency, the unit, the tax object or the IVA: they take their usual values (use G03, PUE, MXN, unit E48, or H87 for a good, object 02, IVA 16%). Send only what changes.
With TypeScript, Python, PHP, Go, Java or C#, the SDKs give you types for every field and the Idempotency-Key without thinking about it:
import { Fiscalisto } from "fiscalisto";
const fiscalisto = new Fiscalisto(process.env.FISCALISTO_API_KEY);
const invoice = await fiscalisto.invoices.create({ customer, payment_form: "03", items });What you need to know
- Test and live.
fk_test_keys stamp for free in SAT's test environment;fk_live_keys stamp real CFDI and use one timbre each. See Test and live. - Idempotency-Key. Everything that stamps requires one. If the answer gets lost, repeat the request with the same key: nothing is ever stamped twice. See Idempotency.
- Clear errors. Every error says which field to fix (
param), how (message) and, if SAT rejected it, its code (sat_code). See Errors. - Webhooks. Cancellations the customer accepts days later, invoices the PAC took a while to stamp and batches reach you as signed events. See Webhooks.
What you can stamp
| Document | Route |
|---|---|
| Income, global or transfer invoice (with complementos) | POST /v1/invoices |
| Payment complement (type P) | POST /v1/payments |
| Credit note (type E) | POST /v1/credit_notes |
| Advance payment and its application | POST /v1/advances |
| Payroll receipt (type N) | POST /v1/payroll_receipts |
| Withholding certificate (retenciones) | POST /v1/retentions |
| Up to 1,000 invoices at once | POST /v1/invoice_batches |
| A whole payroll at once | POST /v1/payroll_batches |
For agents and tools
- To have a coding agent (Claude Code, Cursor, Codex…) integrate Fiscalisto, connect this documentation's MCP server and give it the one-page guide: see Fiscalisto for AI agents.
- The complete OpenAPI 3.1 document is at
https://api.fiscalisto.com/v1/openapi.json, no key needed. Every field has its description and its name in SAT's XML. - Every page of the Spanish guides is also in Markdown: add
.mdto its address (for example/docs/api/idempotencia.md). /docs/api/llms.txtindexes every page, and/docs/api/llms-full.txthas the whole guides in one file.
Was this page helpful?