Skip to content

FISCALISTO / API / REFERENCE

Stamp a batch of invoices · Batches

Open in ChatGPTOpen in ClaudeOpen in Cursor
POST
/v1/invoice_batches

Up to 1,000 income invoices of one issuer, stamped in the background. They're all checked before starting: if one doesn't pass, none is stamped. Answers 202; listen for invoice_batch.completed or look up the batch.

Before you call

  • An issuer that already stamps. In production, with its digital seal (CSD) current: POST /v1/issuers/{id}/certificates. In test mode it stamps with SAT's test CSD.

  • The Idempotency-Key header, a new one for each call (for example, the order's id in your system). If the response is lost, repeat the call with the same one and it isn't done twice: Idempotency.

Authorization

bearerAuth
headerAuthorizationBearer <key>

Your secret key: fk_test_… in test mode, fk_live_… in production. Desarrolladores › Llaves.

Headers

Idempotency-Key*string

A new one per CFDI (8 to 255 characters; your order id works). If the response is lost, repeat the request with the same value: it answers the same and never stamps twice.

Length8 <= length <= 255

Request body

application/json
  1. body
issuer?string

Issuer (iss_…). If the key has a single issuer or the account has only one, it can be left out.

Pattern^iss_
name?string

The batch's name, for you.

Lengthlength <= 120
invoices*array<>

The invoices, like the body of POST /v1/invoices, with an optional reference.

Items1 <= items <= 1000

Response body

OK. Repeating the request with the same Idempotency-Key answers the same, with the same status and the idempotent-replayed: true header.

application/json
  1. response

A batch of up to 1,000 invoices stamped in the background.

id*string

Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_).

livemode*boolean

true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT.

object*string

What kind of object it is («invoice», «customer»…).

issuer*string

The issuer (iss_…).

name*string

The batch's name, for you.

status*string

processing: stamping. completed: none are left to stamp.

One of"processing""completed"
total*integer

How many invoices the batch has.

Range-9007199254740991 <= value <= 9007199254740991
stamped*integer

How many were stamped.

Range-9007199254740991 <= value <= 9007199254740991
failed*integer

How many weren't stamped (they keep their reason).

Range-9007199254740991 <= value <= 9007199254740991
processing?integer

How many are still processing.

Range-9007199254740991 <= value <= 9007199254740991
created_at*|

When it was created, ISO 8601 with Mexico City time (-06:00).

completed_at*|

When it finished.

invoices?array<>

Each invoice in the batch (not included in lists or events).

Errors

  • Stamping requires the Idempotency-Key header (8 to 255 characters, a new one per document), so a retry never stamps twice.

  • The issuer is archived and no longer stamps. Its documents can still be read and canceled.

  • The account has several issuers and the request doesn't say which: send issuer (iss_…).

  • The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.

  • Live, this part of the API (inventario, portal de proveedores, pedidos, comprobación de gastos) follows the empresa's plan, as in the app: it comes with Operaciones (added to any paid plan; included in Corporativo). The books (the /v1/accounting routes except DIOT, cross checks, IVA refunds and fixed assets) come with Contabilidad (added to Independiente, Emprendedor or Negocio; included in Despacho and Corporativo): without it, changing the books answers this error, and reading them works only up to the last month it had it. Add either in Ajustes › Plan y pagos; test mode has everything.

  • That issuer is an empresa of the app connected to your account: through the API it only offers its Portal de proveedores (/v1/portal_suppliers and /v1/supplier_invoices) and, once someone who may pay suppliers and change Configurar pagos turned them on, its supplier payouts (/v1/payouts and /v1/payroll_payouts). It also stops when whoever connected it (or turned its payouts on) no longer has that permission in the empresa: message_es says which. Do everything else in the app.

  • This key can't use that issuer.

  • There is no such issuer in the account (or it belongs to the other mode).

  • There's no object with that id (or it belongs to another issuer or the other mode).

  • An invoice of the batch doesn't pass the checks; param says which (invoices.3.items.0.unit_price). None of the batch was stamped.

  • You reached today's limit of something not paid with stamps. Retry-After says how many seconds until midnight in Mexico City.

Plus those of any call (key, fields, limits): Errors. They all carry code, message and, when it's about a field, param.

curl -X POST 'https://api.fiscalisto.com/v1/invoice_batches' \  -H 'Authorization: Bearer fk_test_…' \  -H 'Idempotency-Key: lote-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",        "email": "pagos@cva.example"      },      "payment_form": "03",      "items": [        {          "description": "Cuota de mantenimiento",          "product_key": "80131500",          "unit_price": 1500        }      ]    }  ]}'
{  "id": "bat_OufpKqnrvx9p4hMdcoapAo5aaGJEme7mXj",  "object": "invoice_batch",  "livemode": false,  "issuer": "iss_OufpKqnrvx9p",  "name": "Cuotas de octubre",  "status": "processing",  "total": 2,  "stamped": 0,  "failed": 0,  "created_at": "2026-10-24T10:15:42-06:00",  "completed_at": null,  "processing": 2,  "invoices": [    {      "index": 0,      "reference": "depto-101",      "status": "processing",      "invoice": null,      "uuid": null,      "total": 1740,      "error": null    },    {      "index": 1,      "reference": "depto-102",      "status": "processing",      "invoice": null,      "uuid": null,      "total": 1740,      "error": null    }  ]}

Was this page helpful?