Skip to content
Invoicing

FISCALISTO / API

Invoice batches

Stamp up to 1,000 invoices of one issuer with a single request, all checked before starting.

Open in ChatGPTOpen in ClaudeOpen in Cursor

A batch is for what's invoiced all at once: a condominium's monthly fees, tuition, a marketplace's sales of the day. Instead of a thousand requests and their limits, you send one.

Payroll receipts have their own batch: see Stamp the whole payroll at once.

curl https://api.fiscalisto.com/v1/invoice_batches \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Idempotency-Key: cuotas-2026-10" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cuotas de octubre",
    "invoices": [
      {
        "reference": "depto-101",
        "customer": "cus_OufpKqnrvx9p1",
        "payment_form": "03",
        "items": [{ "product": "prd_OufpKqnrvx9p1" }]
      },
      {
        "reference": "depto-102",
        "customer": { "tax_id": "ICV060329BY0", "legal_name": "INMOBILIARIA CVA", "tax_system": "601", "zip": "33826" },
        "payment_form": "03",
        "items": [{ "description": "Cuota de mantenimiento", "product_key": "80131500", "unit_price": 1500 }]
      }
    ]
  }'

Each invoice in the batch is the same body as POST /v1/invoices, without issuer (the batch belongs to one issuer), without type or global (they're income invoices) and with reference instead of metadata: your identifier for that invoice, which comes back in the result.

How it's stamped

  1. They're all checked before starting. If one fails the check, the API returns 422 batch_invalid with param set to the invoice and field (invoices.3.items.0.unit_price) and none is stamped. Correct it and send the batch again.
  2. It answers 202 right away, with the batch in status: "processing". Each invoice that has warnings carries them in invoices[].warnings, the same POST /v1/invoices would give (a customer on SAT's lists, a lease without property tax account, withholdings that won't be stamped): it's stamped as you sent it. They come only in this answer (and when you repeat it with the same Idempotency-Key), not in GET.
  3. They're stamped in the background, at the speed the PAC allows. Each stamped invoice sends its invoice.stamped, like any other.
  4. When done, invoice_batch.completed arrives and the batch becomes completed, with how many were stamped (stamped) and how many weren't (failed).
{
  "id": "bat_OufpKqnrvx9p4hMdcoapAo5aaGJEme7mXj",
  "object": "invoice_batch",
  "status": "completed",
  "total": 2,
  "stamped": 1,
  "failed": 1,
  "processing": 0,
  "invoices": [
    { "index": 0, "reference": "depto-101", "status": "valid", "invoice": "inv_OufpKqnrvx9p0mn7VjQ6JlfipKAkHWstOK", "uuid": "DB494B07-D6DE-4F70-8ED0-C8B864FF8717", "total": 1740, "error": null },
    { "index": 1, "reference": "depto-102", "status": "failed", "invoice": null, "uuid": null, "total": 1740, "error": "El SAT no reconoce el nombre del cliente. Escríbalo letra por letra como en su constancia de situación fiscal: completo, con o sin acentos según venga ahí, y sin «S.A. de C.V.» ni otro régimen de capital." }
  ]
}

An invoice can fail even though it passed the check, if SAT rejects it (almost always because of the customer's data). Those don't use a timbre: correct them and stamp each one with POST /v1/invoices.

Check the progress

GET /v1/invoice_batches/{id} says how many are done and each one's status. If you don't use webhooks, check it every few seconds until it says completed.

Timbres

Each stamped invoice uses a timbre, when it's stamped. Before sending a large batch check you have enough with GET /v1/balance: if they run out halfway, the remaining ones end failed with the reason in error. After buying, send them in another batch, with another Idempotency-Key.

Repeat it

Sending the same batch with the same Idempotency-Key returns the batch that already exists (202, like the first time, with idempotent-replayed: true), without stamping anything again.

Was this page helpful?