# Get a payroll batch

`GET https://api.fiscalisto.com/v1/payroll_batches/{id}`

With each employee's receipt: stamped (its invoice and UUID) or why not (error.code and error.message).

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | The object's id. |

## 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.get("pyb_OufpKqnrvx9p6tQ2wE8rYu4iOp7aSd3fGh");
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

payroll_batch = fiscalisto.payroll_batches.get("pyb_OufpKqnrvx9p6tQ2wE8rYu4iOp7aSd3fGh")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

$payrollBatch = $fiscalisto->payrollBatches->get('pyb_OufpKqnrvx9p6tQ2wE8rYu4iOp7aSd3fGh');
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

var payrollBatch = await fiscalisto.PayrollBatches.GetAsync("pyb_OufpKqnrvx9p6tQ2wE8rYu4iOp7aSd3fGh");
```

## 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.Get(ctx, "pyb_OufpKqnrvx9p6tQ2wE8rYu4iOp7aSd3fGh")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(payrollBatch.ID)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;

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

var payrollBatch = fiscalisto.payrollBatches().get("pyb_OufpKqnrvx9p6tQ2wE8rYu4iOp7aSd3fGh");
System.out.println(payrollBatch.getId());
```

## Response 200

OK.

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": "completed",
  "total": 2,
  "stamped": 1,
  "failed": 1,
  "processing": 0,
  "created_at": "2026-10-23T09:00:12-06:00",
  "completed_at": "2026-10-23T09:00:19-06:00",
  "receipts": [
    {
      "index": 0,
      "reference": "s43-9",
      "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
      "tax_id": "MASO451221PM4",
      "name": "MARIA OLIVIA MARTINEZ SAGAZ",
      "status": "valid",
      "invoice": "inv_OufpKqnrvx9p8Nm3kR6tYp1wQz4xCv7bNs",
      "uuid": "52378E0C-799A-4E53-85DC-795C6A488776",
      "total": 2146.64,
      "error": null
    },
    {
      "index": 1,
      "reference": "s43-12",
      "employee": "emp_OufpKqnrvx9p4TyuI2OPAsDfGhJkLzXcVb",
      "tax_id": "GORA800101AB1",
      "name": "ANA GOMEZ RUIZ",
      "status": "failed",
      "invoice": null,
      "uuid": null,
      "total": null,
      "error": {
        "code": "payroll_invalid",
        "message": "ANA GOMEZ RUIZ dejó de trabajar antes de este periodo."
      }
    }
  ]
}
```

## Errors

- `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.
- `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.
- `resource_missing` (404): There's no object with that id (or it belongs to another issuer or the other mode).

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