Skip to content
Invoicing

FISCALISTO / API

Invoicing recipes

The most common invoices ready to copy: from your catalog, on credit (PPD), in dollars, with withholdings, global to the general public and in batch.

Open in ChatGPTOpen in ClaudeOpen in Cursor

They all go to POST /v1/invoices with your key and a new Idempotency-Key. Only the body changes; what you don't send has its usual value (PUE, MXN, use G03 or S01 with regime 616, unit E48, or H87 when the SAT key is a good, tax object 02, IVA 16%, quantity 1).

From your customer and product catalog

Save the customer and the product once, and invoice with their ids. The product sets its key, unit, price and taxes; you can change the quantity or the price on each line item.

curl https://api.fiscalisto.com/v1/customers \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "tax_id": "ICV060329BY0", "legal_name": "INMOBILIARIA CVA", "tax_system": "601", "zip": "33826", "email": "pagos@cva.example" }'
curl https://api.fiscalisto.com/v1/invoices \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Idempotency-Key: pedido-A-1043" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": "cus_OufpKqnrvx9p1",
    "payment_form": "04",
    "items": [{ "product": "prd_OufpKqnrvx9p1", "quantity": 3 }],
    "send_email": true
  }'

With send_email the customer gets the PDF and the XML at the email on their record (or customer.email); without either it returns 400 parameter_missing, so an invoice that reaches nobody isn't stamped. A new customer can also go in full in customer, as in the quickstart; it isn't saved to the catalog.

By email

Each email carries the PDF and the XML, goes out in the issuer's name and replies reach the issuer. To send it again, or to another address, use POST /v1/invoices/{id}/send with to (and cc if you want); without to it goes to the invoice's email. The send_email email goes out once even when stamping takes a while: if the invoice answered 202 (processing) or the email service didn't answer, it's sent by itself in the following minutes, to the same addresses.

curl https://api.fiscalisto.com/v1/invoices/inv_OufpKqnrvx9p9Gl0bAlQ2mZr8sKdLx/send \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "to": "pagos@cliente.mx" }'

The invoice says in email what happened to its last send: status is sent, delivered, opened, bounced or complained (the customer marked it as spam), and recipients says it per address, with a bounce's reason in bounce_reason («mailbox doesn't exist», «mailbox full»…). When it bounces or is marked as spam, invoice.email_bounced or invoice.email_complained arrives.

Before sending, we check each address at no cost: that the domain exists and receives mail, that it isn't a disposable address, that it isn't misspelled (@gmial.com) and that it hasn't bounced permanently in the last 90 days, from any account. If one fails, it returns 400 email_failed with the reason and nothing is sent; the invoice does stay stamped.

Each address (including those in cc) gets its own message, with the Darse de baja (unsubscribe) link at the bottom and the List-Unsubscribe and List-Unsubscribe-Post headers (RFC 8058), so Gmail and the others show their unsubscribe button. Whoever unsubscribes stops getting that issuer's emails (not other issuers'): that address is skipped on sends and, if none is left, it returns 400 email_failed and says so. Only that person can resubscribe, from the same link. To keep emails reaching the inbox, an invoice is sent at most 10 times a day, and resends to addresses that are neither the customer's nor the issuer's have a daily cap that grows with your account (see Limits).

PPD (paid in installments or later)

If the customer pays you later or in parts, the invoice goes with method PPD and payment form 99 (to be defined), which Fiscalisto sets on its own. Each payment is recorded afterwards with a payment complement.

curl https://api.fiscalisto.com/v1/invoices \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Idempotency-Key: contrato-88-oct" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": { "tax_id": "ICV060329BY0", "legal_name": "INMOBILIARIA CVA", "tax_system": "601", "zip": "33826" },
    "payment_method": "PPD",
    "items": [{ "description": "Implementación del sistema", "product_key": "81111500", "unit_price": 45000 }]
  }'

In dollars

Send the currency and the day's exchange rate (the one the DOF publishes the previous business day). Prices go in dollars.

curl https://api.fiscalisto.com/v1/invoices \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Idempotency-Key: pedido-USD-17" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": { "tax_id": "ICV060329BY0", "legal_name": "INMOBILIARIA CVA", "tax_system": "601", "zip": "33826" },
    "payment_form": "03",
    "currency": "USD",
    "exchange_rate": 18.35,
    "items": [{ "description": "Licencia anual", "product_key": "43232400", "unit_price": 1200 }]
  }'

With withholdings

Withholdings go per line item, as a rate. For example, freight to a company carries a 4% IVA withholding:

curl https://api.fiscalisto.com/v1/invoices \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Idempotency-Key: flete-5521" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": { "tax_id": "ICV060329BY0", "legal_name": "INMOBILIARIA CVA", "tax_system": "601", "zip": "33826" },
    "payment_form": "03",
    "items": [{ "description": "Flete Monterrey–Saltillo", "product_key": "78101800", "unit_price": 8000, "iva_retention": 0.04 }]
  }'

The response carries what was withheld in taxes.iva_withheld and taxes.isr_withheld, and the total already net of them. Other common ones: professional fees or rent from an individual to a company (isr_retention: 0.10, iva_retention: 0.106667) and RESICO to a company (isr_retention: 0.0125). Fiscalisto doesn't add withholdings on its own: it stamps the ones you send. If the issuer is an individual billing a company and a line item lacks the one its tax regime calls for (or carries professional-fee withholdings on a sale of goods), the response says so in warnings, as the preview does. Only a company withholds (article 1o.-A, section II, of the IVA law and articles 106, 113-J and 116 of the ISR law): for an individual customer, the general public or a foreigner, the invoice is stamped without the withholdings you send, and warnings says that too.

Global to the general public

What you sold with a receipt to whoever didn't ask for an invoice goes in a global invoice per day, week, month or two months. The customer is the general public: RFC XAXX010101000, name PUBLICO EN GENERAL, regime 616 and, as postal code, the issuer's (in test mode, SAT's test issuer's: 42501). Each line item is a sale, with the receipt number in sku.

In the global invoice, each line item is stamped with the description Venta, the key 01010101, the unit ACT, without Unidad, and quantity 1 with the sale's amount as price, even if you send others: that's what SAT's filling guide for the global CFDI asks (Anexo 20). year is the invoice date's year or up to five years earlier (SAT's error matrix, rule CFDI40136). To describe what was sold, invoice the person instead: RFC XAXX010101000 with their name (not PUBLICO EN GENERAL, which is only valid on the global), regime 616 and the issuer's postal code; there the description is free.

Donees and associations: keep the line items

If the issuer is a non-profit company (tax_system 603), send "keep_concepts": true in global and each line item is stamped with its own description, product_key, unit_key, unit_name and quantity. It's what SAT's material on donees' CFDI shows: the recovery fee carries the service's key, the unit M4 and a description saying it's a recovery fee, and a global's donation states its purpose. The receiver is still PUBLICO EN GENERAL with the global information, and each fee can go on its own line item with its folio or id in sku (NoIdentificacion):

"global": { "periodicity": "04", "months": "11", "year": 2026, "keep_concepts": true },
"items": [
  {
    "description": "Cuota de recuperación ciclo escolar 2026-2027, CR-MM-000754",
    "product_key": "93141514",
    "unit_key": "M4",
    "unit_name": "Servicio",
    "sku": "CR-MM-000754",
    "unit_price": 200,
    "taxability": "02",
    "iva": "exento"
  }
]

With another regime, keep_concepts is refused with invoice_invalid.

curl https://api.fiscalisto.com/v1/invoices \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Idempotency-Key: global-2026-10" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": { "tax_id": "XAXX010101000", "legal_name": "PUBLICO EN GENERAL", "tax_system": "616", "zip": "42501" },
    "global": { "periodicity": "04", "months": "10", "year": 2026 },
    "payment_form": "01",
    "items": [
      { "description": "Venta", "product_key": "01010101", "unit_key": "ACT", "sku": "T-1001", "unit_price": 431.03 },
      { "description": "Venta", "product_key": "01010101", "unit_key": "ACT", "sku": "T-1002", "unit_price": 862.07 }
    ]
  }'

Check it without stamping

With the same body, POST /v1/invoices/preview runs every check stamping runs, without stamping or using a timbre, and needs no Idempotency-Key. Use it to show the total before charging, or to validate in your system before sending the invoice.

curl https://api.fiscalisto.com/v1/invoices/preview \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -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", "unit_price": 2500, "quantity": 2 }] }'

It answers the invoice as it would be stamped now: the subtotal, taxes (taxes) and total Fiscalisto computes, the next folio, the warnings in warnings (a customer on SAT's lists, an invoice that looks like a duplicate, a withholding the issuer's tax regime calls for, a lease without its cuenta predial) and the unsigned XML in unsigned_xml. If something fails, it answers the same invoice_invalid as stamping. It works with a read-only key.

Without waiting for the PAC

If the PAC is slow or the SAT doesn't answer, the invoice isn't lost: it answers 202 with the invoice in status: "processing" (already with its folio, without a uuid), Fiscalisto retries it on its own every few minutes, and invoice.stamped tells you when it's stamped (or invoice.failed if the SAT rejects it). Don't send it again: repeating the request with the same Idempotency-Key answers the same invoice, never a second one.

To never wait for the PAC (a checkout, a queue on your server), send "async": true: it answers 202 as soon as the invoice is saved with its folio and stamps it after answering. Everything else is the same: the same checks (a data error answers 400 or 422 right away), the same warnings in warnings (checked before stamping), the same timbre and the same webhooks.

curl https://api.fiscalisto.com/v1/invoices \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Idempotency-Key: pedido-2026-0042" \
  -H "Content-Type: application/json" \
  -d '{ "async": true, "customer": { "tax_id": "ICV060329BY0", "legal_name": "INMOBILIARIA CVA", "tax_system": "601", "zip": "33826" }, "payment_form": "03", "items": [{ "description": "Mensualidad", "product_key": "86121700", "unit_price": 2500 }] }'

Check how it's going with GET /v1/invoices/{id} or wait for the webhook.

Change the PDF's note

notes is the note for the customer printed on the PDF (up to 1,000 characters); it isn't in the XML. That's why it can be changed or removed after stamping, with POST /v1/invoices/{id}: the invoice before SAT doesn't change, and the next PDF (GET /v1/invoices/{id}/pdf and the email) already carries the new one. null removes it. If you already sent it, your customer has the earlier PDF: send them the new one with POST /v1/invoices/{id}/send.

curl https://api.fiscalisto.com/v1/invoices/inv_OufpKqnrvx9p0Nfbydl9jG4UNGeTYcvdrg \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "notes": "Orden de compra 4512" }'

It returns the invoice with notes. Each change is kept in the invoice's Historial in Fiscalisto, with who made it and when. A payment complement carries no note (parameter_invalid), and an invoice not stamped yet returns invoice_not_stamped.

Many at once

For hundreds or thousands of invoices (the month's fees, a marketplace's invoicing), use a batch: a single request with up to 1,000.

Learn more

Was this page helpful?