# Stamp a whole payroll (batch)

`POST https://api.fiscalisto.com/v1/payroll_batches`

A whole payroll run in one request: up to 1,000 receipts of one issuer, stamped in the background one after another, without the stamps-per-second limit of a single request. In one of two ways, never mixed: receipts (employee ids; Fiscalisto calculates each receipt with the batch's period) or external_receipts (the receipts your system calculated, as in POST /v1/payroll_receipts/external, with reference instead of metadata). Everything that can be checked beforehand is checked beforehand: if something fails, none is stamped and the error says which receipt (param receipts.3.employee). What's only known when stamping (a period already paid, SAT rejecting an RFC) stays on that receipt, with its error. One receipt per employee and period: sending the run again, even with another Idempotency-Key, returns the receipts it already has. Answers 202; listen for payroll_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`](https://fiscalisto.com/en/docs/api/referencia/emisores/upload-certificate). 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](https://fiscalisto.com/en/docs/api/idempotencia).

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | yes | 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. |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `issuer` | string (iss_…) |  | Issuer (iss_…). If the key has a single issuer or the account has only one, it can be left out. |
| `name` | string |  | The batch's name, for you (Quincena 20). (up to 120 characters) |
| `period` | object |  | The pay period: first and last day (FechaInicialPago, FechaFinalPago) and, if it isn't the last one, the payment day (FechaPago). It applies to every receipt in receipts that doesn't carry its own. |
| `period.start` | string | yes | First day paid (FechaInicialPago). |
| `period.end` | string | yes | Last day paid (FechaFinalPago). |
| `period.payment_date` | string |  | Payment day (FechaPago); without it, the last day of the period. |
| `send_email` | boolean |  | Send each employee their receipt by email (those with an email). Only with receipts. |
| `receipts` | array of object |  | The receipts Fiscalisto calculates: one employee (emp_…) in each, as in POST /v1/payroll_receipts. (up to 1000) |
| `receipts[].employee` | string | yes | The employee (emp_…) of the batch's issuer. |
| `receipts[].period` | object |  | Their pay period (FechaInicialPago, FechaFinalPago and FechaPago), if it isn't the batch's (period). |
| `receipts[].period.start` | string | yes | First day paid (FechaInicialPago). |
| `receipts[].period.end` | string | yes | Last day paid (FechaFinalPago). |
| `receipts[].period.payment_date` | string |  | Payment day (FechaPago); without it, the last day of the period. |
| `receipts[].days` | number |  | Days paid; without it, all the period's days that apply to them minus absences and disability_days. (greater than 0 and up to 31) |
| `receipts[].absences` | integer |  | Absences in the period (unpaid days), from 0 to 31: they aren't paid (they come out of days) and contribute to IMSS only for illness and maternity, up to 7 per month (LSS art. 31 fr. I). (from 0 to 31) |
| `receipts[].disability_days` | integer |  | Days of disability IMSS issued in the period, from 0 to 31: they aren't paid (they come out of days) and don't generate the worker's IMSS contributions (LSS art. 31 fr. IV). (from 0 to 31) |
| `receipts[].send_email` | boolean |  | Send them their receipt by email; without it, whatever the batch's send_email says. With true the employee must have an email. |
| `receipts[].reference` | string |  | Your identifier for this receipt, up to 100 characters. (up to 100 characters) |
| `external_receipts` | array of object |  | The receipts your payroll system calculated, stamped as they are. Instead of receipts. (up to 1000) |
| `external_receipts[].issuer` | string |  | The receipt's issuer (employer); without it, the only issuer in your account in this mode. |
| `external_receipts[].type` | `O`, `E` | yes | TipoNomina: O ordinary (frequency 01–10) or E extraordinary (frequency 99). |
| `external_receipts[].periodicity` | string | yes | PeriodicidadPago (c_PeriodicidadPago). (up to 2 characters) |
| `external_receipts[].period` | object | yes | FechaInicialPago, FechaFinalPago and FechaPago. |
| `external_receipts[].period.start` | string | yes | First day of the period (FechaInicialPago), YYYY-MM-DD. |
| `external_receipts[].period.end` | string | yes | Last day of the period (FechaFinalPago), YYYY-MM-DD. |
| `external_receipts[].period.payment_date` | string | yes | Payment date (FechaPago), YYYY-MM-DD. The last day of the period by default. |
| `external_receipts[].days` | number | yes | NumDiasPagados: from 0.001 to 36160, up to 3 decimals. |
| `external_receipts[].employer` | object |  | The employer (Emisor of the complement): employer registration and CURP if it is a persona física. |
| `external_receipts[].employer.registration` | string or null |  | Employer registration. Without the field: the issuer's when the contract is 01–08. null: without employer registration. |
| `external_receipts[].employer.curp` | string or null |  | CURP of the persona física employer. Without the field: the one saved on the issuer. |
| `external_receipts[].employer.origin_tax_id` | string |  | RfcPatronOrigen. (up to 13 characters) |
| `external_receipts[].employer.sncf` | object |  | EntidadSNCF, only for entities that belong to the SNCF. |
| `external_receipts[].employer.sncf.resource_origin` | string | yes | OrigenRecurso: IP, IF or IM. (up to 2 characters) |
| `external_receipts[].employer.sncf.own_resource_amount` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].employee` | object | yes | The employee (Receptor and Nomina/Receptor) with the data from your payroll system; it doesn't use or change Fiscalisto's employees. |
| `external_receipts[].employee.tax_id` | string | yes | Employee's RFC. XAXX010101000 if deceased: with their name and CURP. (up to 13 characters) |
| `external_receipts[].employee.name` | string | yes | Name. (up to 300 characters) |
| `external_receipts[].employee.zip` | string | yes | Postal code of the tax address, 5 digits, as on the constancia de situación fiscal. An issuer's is the place of issue (LugarExpedicion) of its CFDIs. (up to 5 characters) |
| `external_receipts[].employee.curp` | string | yes | CURP, 18 characters. (up to 18 characters) |
| `external_receipts[].employee.number` | string | yes | NumEmpleado. (up to 15 characters) |
| `external_receipts[].employee.email` | string or null |  | For send_email; it doesn't go in the XML. |
| `external_receipts[].employee.social_security_number` | string |  | Social security number (NumSeguridadSocial), 11 digits. (up to 15 characters) |
| `external_receipts[].employee.start_date` | string |  | FechaInicioRelLaboral. |
| `external_receipts[].employee.seniority` | string |  | Seniority (P52W or P1Y2M3D). Without the field and with employer registration: weeks from start_date to the end of the period (days if under a week, P3D). (up to 20 characters) |
| `external_receipts[].employee.contract_type` | string | yes | Contract type (TipoContrato), c_TipoContrato. 01 by default, permanent. (up to 2 characters) |
| `external_receipts[].employee.regime_type` | string | yes | Regime type (TipoRegimen): 02 wages and salaries. (up to 2 characters) |
| `external_receipts[].employee.unionized` | boolean |  | true if they're unionized (Sindicalizado). |
| `external_receipts[].employee.workday_type` | string |  | Shift type (TipoJornada), c_TipoJornada. 01 by default, day shift. (up to 2 characters) |
| `external_receipts[].employee.risk_class` | string |  | The position's risk class with IMSS (RiesgoPuesto), 1 to 5. 1 by default. (up to 2 characters) |
| `external_receipts[].employee.department` | string |  | Department (Departamento). (up to 100 characters) |
| `external_receipts[].employee.position` | string |  | Position (Puesto). (up to 100 characters) |
| `external_receipts[].employee.contribution_base_salary` | number |  | SalarioBaseCotApor. |
| `external_receipts[].employee.integrated_daily_salary` | number |  | SalarioDiarioIntegrado. |
| `external_receipts[].employee.state` | string | yes | ClaveEntFed (c_Estado): JAL, CMX, NLE… (up to 3 characters) |
| `external_receipts[].employee.bank` | string |  | Bank (c_Banco); it doesn't go with a CLABE. (up to 3 characters) |
| `external_receipts[].employee.bank_account` | string |  | CuentaBancaria: 18-digit CLABE, card or account. (up to 18 characters) |
| `external_receipts[].employee.subcontracting` | array of object |  | SubContratacion: the percentage adds up to 100. (up to 50) |
| `external_receipts[].employee.subcontracting[].tax_id` | string | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. (up to 13 characters) |
| `external_receipts[].employee.subcontracting[].percentage` | number | yes | PorcentajeTiempo. |
| `external_receipts[].perceptions` | array of object |  | Earnings (Percepcion): wages and the rest, taxable and exempt. (up to 500) |
| `external_receipts[].perceptions[].type` | string | yes | TipoPercepcion (c_TipoPercepcion): 001 wages, 002 year-end bonus… (up to 3 characters) |
| `external_receipts[].perceptions[].key` | string | yes | Employer's code (3 to 15 characters). (up to 15 characters) |
| `external_receipts[].perceptions[].concept` | string | yes | Payment concept (ConceptoPago), c_TipoContribuyenteSujetoRetencion. (up to 100 characters) |
| `external_receipts[].perceptions[].taxed` | number | yes | ImporteGravado. |
| `external_receipts[].perceptions[].exempt` | number | yes | ImporteExento. |
| `external_receipts[].perceptions[].overtime` | array of object |  | HorasExtra: only with earning 019. (up to 100) |
| `external_receipts[].perceptions[].overtime[].days` | number | yes | Days with overtime (Dias). |
| `external_receipts[].perceptions[].overtime[].hours_type` | string | yes | c_TipoHoras: 01 double, 02 triple, 03 single. (up to 2 characters) |
| `external_receipts[].perceptions[].overtime[].hours` | number | yes | Overtime hours (HorasExtra). |
| `external_receipts[].perceptions[].overtime[].amount_paid` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].perceptions[].stock_options` | object |  | AccionesOTitulos: only with earning 045. |
| `external_receipts[].perceptions[].stock_options.market_value` | number | yes | Market value (ValorMercado). |
| `external_receipts[].perceptions[].stock_options.grant_price` | number | yes | Price when granted (PrecioAlOtorgarse). |
| `external_receipts[].separation` | object |  | SeparacionIndemnizacion: with earnings 022, 023 or 025. |
| `external_receipts[].separation.total_paid` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].separation.years_of_service` | number | yes | NumAñosServicio. |
| `external_receipts[].separation.last_monthly_salary` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].separation.accumulable_income` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].separation.non_accumulable_income` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].retirement` | object |  | JubilacionPensionRetiro: with earnings 039 or 044. |
| `external_receipts[].retirement.total_one_payment` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].retirement.total_installment` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].retirement.daily_amount` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].retirement.accumulable_income` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].retirement.non_accumulable_income` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].deductions` | array of object |  | Deductions (Deduccion): ISR, IMSS contributions and the rest. (up to 500) |
| `external_receipts[].deductions[].type` | string | yes | TipoDeduccion (c_TipoDeduccion): 001 IMSS, 002 ISR, 010 Infonavit… (up to 3 characters) |
| `external_receipts[].deductions[].key` | string | yes | The .key file in base64 (it can carry the data: prefix). (up to 15 characters) |
| `external_receipts[].deductions[].concept` | string | yes | Concept of the outflows (IntegracEgresos/ConceptoS), up to 100 characters. (up to 100 characters) |
| `external_receipts[].deductions[].amount` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].other_payments` | array of object |  | Other payments (OtroPago): employment subsidy. (up to 100) |
| `external_receipts[].other_payments[].type` | string | yes | TipoOtroPago (c_TipoOtroPago): 002 employment subsidy… (up to 3 characters) |
| `external_receipts[].other_payments[].key` | string | yes | The .key file in base64 (it can carry the data: prefix). (up to 15 characters) |
| `external_receipts[].other_payments[].concept` | string | yes | Payment concept (ConceptoPago), c_TipoContribuyenteSujetoRetencion. (up to 100 characters) |
| `external_receipts[].other_payments[].amount` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].other_payments[].subsidy_caused` | number |  | SubsidioCausado: only with 002. |
| `external_receipts[].other_payments[].balance_compensation` | object |  | CompensacionSaldosAFavor: only with 004. |
| `external_receipts[].other_payments[].balance_compensation.balance` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].other_payments[].balance_compensation.year` | number | yes | Year (Ejercicio). |
| `external_receipts[].other_payments[].balance_compensation.remaining` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].disabilities` | array of object |  | Incapacidades: with earning 014 or deduction 006. (up to 100) |
| `external_receipts[].disabilities[].days` | number | yes | Days paid (NumDiasPagados). By default, all the period's days that apply to them. |
| `external_receipts[].disabilities[].type` | string | yes | Receipt type (TipoDeComprobante): I income, E expense, P payment, T transfer, N payroll. (up to 2 characters) |
| `external_receipts[].disabilities[].amount` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].totals` | object | yes | The totals your system calculated: Fiscalisto compares them to the cent with the lines and rejects the receipt if they don't match. |
| `external_receipts[].totals.perceptions` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].totals.deductions` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].totals.other_payments` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].totals.net` | number | yes | Net: earnings plus other payments minus deductions. |
| `external_receipts[].totals.salaries` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].totals.separation` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].totals.retirement` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].totals.taxed` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].totals.exempt` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].totals.taxes_withheld` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].totals.other_deductions` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `external_receipts[].references` | object |  | Your ids: the employee and the payroll run. payroll_run_id is mandatory on an extraordinary receipt. |
| `external_receipts[].references.employee_id` | string |  | The employee's id in your system. (up to 100 characters) |
| `external_receipts[].references.payroll_run_id` | string |  | The payroll run's id in your system. (up to 100 characters) |
| `external_receipts[].replaces` | string |  | The valid receipt (inv_… or UUID) this one replaces: relation 04, and it is canceled with reason 01. |
| `external_receipts[].send_email` | boolean |  | true to send the PDF and the XML by email when stamping, with Fiscalisto's design. Not sent by default. |
| `external_receipts[].metadata` | object |  | Your own data: up to 50 keys of 40 characters with text values of up to 500. They don't go into the CFDI; they come back in the object and in webhooks. |
| `external_receipts[].reference` | string |  | Your identifier for this receipt, up to 100 characters. (up to 100 characters) |

Example:

```json
{
  "name": "Semana 2026-43",
  "period": {
    "start": "2026-10-17",
    "end": "2026-10-23"
  },
  "send_email": true,
  "receipts": [
    {
      "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
      "reference": "s43-9"
    },
    {
      "employee": "emp_OufpKqnrvx9p4TyuI2OPAsDfGhJkLzXcVb",
      "reference": "s43-12",
      "days": 5
    }
  ]
}
```

## With the TypeScript SDK

```ts
import { Fiscalisto } from "fiscalisto";

// La llave viene de FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const payrollBatch = await fiscalisto.payrollBatches.create({
  name: "Semana 2026-43",
  period: { start: "2026-10-17", end: "2026-10-23" },
  send_email: true,
  receipts: [
    {
      employee: "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
      reference: "s43-9",
    },
    {
      employee: "emp_OufpKqnrvx9p4TyuI2OPAsDfGhJkLzXcVb",
      reference: "s43-12",
      days: 5,
    },
  ],
}, { idempotencyKey: "nomina-2026-q20" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

# La llave viene de FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

payroll_batch = fiscalisto.payroll_batches.create({
    "name": "Semana 2026-43",
    "period": {"start": "2026-10-17", "end": "2026-10-23"},
    "send_email": True,
    "receipts": [
        {
            "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
            "reference": "s43-9",
        },
        {
            "employee": "emp_OufpKqnrvx9p4TyuI2OPAsDfGhJkLzXcVb",
            "reference": "s43-12",
            "days": 5,
        },
    ],
}, idempotency_key="nomina-2026-q20")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$payrollBatch = $fiscalisto->payrollBatches->create([
    'name' => 'Semana 2026-43',
    'period' => [
        'start' => '2026-10-17',
        'end' => '2026-10-23',
    ],
    'send_email' => true,
    'receipts' => [
        [
            'employee' => 'emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV',
            'reference' => 's43-9',
        ],
        [
            'employee' => 'emp_OufpKqnrvx9p4TyuI2OPAsDfGhJkLzXcVb',
            'reference' => 's43-12',
            'days' => 5,
        ],
    ],
], ['idempotency_key' => 'nomina-2026-q20']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var payrollBatch = await fiscalisto.PayrollBatches.CreateAsync(new CreatePayrollBatchParams
{
    Name = "Semana 2026-43",
    Period = new() { Start = "2026-10-17", End = "2026-10-23" },
    SendEmail = true,
    Receipts = new()
    {
        new()
        {
            Employee = "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
            Reference = "s43-9",
        },
        new()
        {
            Employee = "emp_OufpKqnrvx9p4TyuI2OPAsDfGhJkLzXcVb",
            Reference = "s43-12",
            Days = 5,
        },
    },
}, new RequestOptions { IdempotencyKey = "nomina-2026-q20" });
```

## With the Go SDK

```go
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// La llave viene de FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	payrollBatch, err := client.PayrollBatches.Create(ctx, &fiscalisto.CreatePayrollBatchParams{
		Name: fiscalisto.String("Semana 2026-43"),
		Period: &fiscalisto.CreatePayrollBatchParamsPeriod{
			Start: "2026-10-17",
			End:   "2026-10-23",
		},
		SendEmail: fiscalisto.Bool(true),
		Receipts: []fiscalisto.CreatePayrollBatchParamsReceipt{
			{
				Employee:  "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
				Reference: fiscalisto.String("s43-9"),
			},
			{
				Employee:  "emp_OufpKqnrvx9p4TyuI2OPAsDfGhJkLzXcVb",
				Reference: fiscalisto.String("s43-12"),
				Days:      fiscalisto.Float64(5),
			},
		},
	}, fiscalisto.WithIdempotencyKey("nomina-2026-q20"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(payrollBatch.ID)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.CreatePayrollBatchParams;
import com.fiscalisto.model.CreatePayrollBatchParamsPeriod;
import com.fiscalisto.model.CreatePayrollBatchParamsReceipt;
import java.util.List;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var payrollBatch = fiscalisto.payrollBatches().create(new CreatePayrollBatchParams()
        .setName("Semana 2026-43")
        .setPeriod(new CreatePayrollBatchParamsPeriod()
                .setStart("2026-10-17")
                .setEnd("2026-10-23"))
        .setSendEmail(true)
        .setReceipts(List.of(
                new CreatePayrollBatchParamsReceipt()
                        .setEmployee("emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV")
                        .setReference("s43-9"),
                new CreatePayrollBatchParamsReceipt()
                        .setEmployee("emp_OufpKqnrvx9p4TyuI2OPAsDfGhJkLzXcVb")
                        .setReference("s43-12")
                        .setDays(5)
        )), RequestOptions.idempotencyKey("nomina-2026-q20"));
System.out.println(payrollBatch.getId());
```

## Response 202

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

A `PayrollBatch` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `object` | `"payroll_batch"` | yes | What kind of object it is («invoice», «customer»…). |
| `issuer` | string | yes | The issuer (iss_…). |
| `name` | string | yes | The batch's name, for you. |
| `calculation` | `fiscalisto`, `external` | yes | fiscalisto: Fiscalisto calculated each receipt (receipts); external: the amounts from your system were stamped (external_receipts). |
| `status` | `processing`, `completed` | yes | processing: stamping. completed: no receipts are left to stamp. |
| `total` | integer | yes | How many receipts the batch has. (from -9007199254740991 to 9007199254740991) |
| `stamped` | integer | yes | How many receipts were stamped. (from -9007199254740991 to 9007199254740991) |
| `failed` | integer | yes | How many weren't stamped (each with its error). (from -9007199254740991 to 9007199254740991) |
| `processing` | integer | yes | How many are left to stamp. (from -9007199254740991 to 9007199254740991) |
| `created_at` | string (date-time) or null | yes | When it was created, ISO 8601 with Mexico City time (-06:00). |
| `completed_at` | string (date-time) or null | yes | When it finished. |
| `receipts` | array of object |  | Each employee's receipt, in the order you sent them (not included in lists). |
| `receipts[].index` | integer | yes | Its position in receipts (or external_receipts), from 0. (from -9007199254740991 to 9007199254740991) |
| `receipts[].reference` | string or null | yes | Your identifier for this invoice (your order number), up to 100 characters. |
| `receipts[].employee` | string or null | yes | The employee (emp_…), when Fiscalisto calculated the receipt. |
| `receipts[].tax_id` | string | yes | The employee's RFC. |
| `receipts[].name` | string or null | yes | Name. |
| `receipts[].status` | `processing`, `valid`, `failed` | yes | Object status. |
| `receipts[].invoice` | string or null | yes | The receipt (inv_…, a type N invoice); also the one the SAT rejected. |
| `receipts[].uuid` | string or null | yes | Tax folio the SAT assigns (UUID of the Timbre Fiscal Digital), in uppercase. |
| `receipts[].total` | number or null | yes | The stamped receipt's net. |
| `receipts[].error` | object or null | yes | Why this receipt wasn't stamped: its code and its message. |
| `receipts[].error.code` | string | yes | payroll_invalid, payroll_approval_required, payroll_period_overlap, payroll_receipt_exists, invoice_rejected, invoice_invalid, insufficient_balance… |
| `receipts[].error.message` | string | yes | What happened and how to fix it, for a person. |

```json
{
  "id": "pyb_OufpKqnrvx9p6tQ2wE8rYu4iOp7aSd3fGh",
  "object": "payroll_batch",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "name": "Semana 2026-43",
  "calculation": "fiscalisto",
  "status": "processing",
  "total": 2,
  "stamped": 0,
  "failed": 0,
  "processing": 2,
  "created_at": "2026-10-23T09:00:12-06:00",
  "completed_at": null,
  "receipts": [
    {
      "index": 0,
      "reference": "s43-9",
      "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
      "tax_id": "MASO451221PM4",
      "name": "MARIA OLIVIA MARTINEZ SAGAZ",
      "status": "processing",
      "invoice": null,
      "uuid": null,
      "total": null,
      "error": null
    },
    {
      "index": 1,
      "reference": "s43-12",
      "employee": "emp_OufpKqnrvx9p4TyuI2OPAsDfGhJkLzXcVb",
      "tax_id": "GORA800101AB1",
      "name": "ANA GOMEZ RUIZ",
      "status": "processing",
      "invoice": null,
      "uuid": null,
      "total": null,
      "error": null
    }
  ]
}
```

## Errors

- `calculation_mode_ambiguous` (400): This mixes the two ways of issuing a payroll receipt: POST /v1/payroll_receipts calculates it from an employee (emp_…); POST /v1/payroll_receipts/external stamps the amounts your payroll system calculated. Use the matching endpoint.
- `daily_limit` (429): You reached today's limit of something not paid with stamps. Retry-After says how many seconds until midnight in Mexico City.
- `feature_not_in_plan` (403): 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.
- `idempotency_key_missing` (400): Stamping requires the Idempotency-Key header (8 to 255 characters, a new one per document), so a retry never stamps twice.
- `insufficient_balance` (402): The account has no live stamps left: to stamp, check RFCs against SAT's lists, look up constancias, request SAT downloads or fetch declarations, the compliance opinion or the mailbox from SAT. Buy a pack in Desarrolladores › Timbres y pagos, or turn on auto-recharge. Never happens in test mode.
- `issuer_archived` (400): The issuer is archived and no longer stamps. Its documents can still be read and canceled.
- `issuer_linked_empresa` (403): 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.
- `issuer_missing` (404): There is no such issuer in the account (or it belongs to the other mode).
- `issuer_not_allowed` (403): This key can't use that issuer.
- `issuer_required` (400): The account has several issuers and the request doesn't say which: send `issuer` (iss_…).
- `livemode_mismatch` (400): The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.
- `payroll_calculation_unsupported` (400): POST /v1/payroll_receipts only calculates ordinary payroll (salary, ISR with the employment subsidy and the employee's IMSS quotas). Fiscalisto calculates the aguinaldo, PTU and severance (finiquito or liquidación) with POST /v1/payroll_receipts/extraordinary; pensions, bonuses and the rest are calculated by your payroll system and stamped with POST /v1/payroll_receipts/external. `param` says which field asked for it.
- `payroll_invalid` (422): The payroll receipt can't be calculated or stamped with that data (period, days, the issuer's employer registration…). `message_es` says which; for an externally calculated receipt, `errors` lists every problem with its `param`.

Plus those of any call (key, fields, limits): https://fiscalisto.com/en/docs/api/errores.md.
