# Ver un lote

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

Con cada factura: su estado, su id y su error.

## Parámetros

| Nombre | Dónde | Obligatorio | Descripción |
| --- | --- | --- | --- |
| `id` | ruta | sí | El id del objeto. |

## Con el SDK de TypeScript

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

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

const invoiceBatch = await fiscalisto.invoiceBatches.get("bat_OufpKqnrvx9p4hMdcoapAo5aaGJEme7mXj");
```

## Con el SDK de Python

```python
from fiscalisto import Fiscalisto

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

invoice_batch = fiscalisto.invoice_batches.get("bat_OufpKqnrvx9p4hMdcoapAo5aaGJEme7mXj")
```

## Con el SDK de PHP

```php
<?php

use Fiscalisto\Fiscalisto;

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

$invoiceBatch = $fiscalisto->invoiceBatches->get('bat_OufpKqnrvx9p4hMdcoapAo5aaGJEme7mXj');
```

## Con el SDK de .NET

```csharp
using Fiscalisto;

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

var invoiceBatch = await fiscalisto.InvoiceBatches.GetAsync("bat_OufpKqnrvx9p4hMdcoapAo5aaGJEme7mXj");
```

## Con el SDK de Go

```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()

	invoiceBatch, err := client.InvoiceBatches.Get(ctx, "bat_OufpKqnrvx9p4hMdcoapAo5aaGJEme7mXj")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(invoiceBatch.ID)
}
```

## Con el SDK de Java

```java
import com.fiscalisto.FiscalistoClient;

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

var invoiceBatch = fiscalisto.invoiceBatches().get("bat_OufpKqnrvx9p4hMdcoapAo5aaGJEme7mXj");
System.out.println(invoiceBatch.getId());
```

## Respuesta 200

Correcto.

Un objeto `InvoiceBatch`:

| Campo | Tipo | Siempre viene | Descripción |
| --- | --- | --- | --- |
| `id` | string | sí | Identificador del objeto, con su prefijo (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `livemode` | boolean | sí | true en producción (llaves fk_live_), false en pruebas (fk_test_). Lo de pruebas no vale ante el SAT. |
| `object` | `"invoice_batch"` | sí | Qué tipo de objeto es («invoice», «customer»…). |
| `issuer` | string | sí | El emisor (iss_…). |
| `name` | string | sí | Nombre del lote, para usted. |
| `status` | `processing`, `completed` | sí | processing: timbrando. completed: ya no queda ninguna por timbrar. |
| `total` | integer | sí | Cuántas facturas tiene el lote. (de -9007199254740991 a 9007199254740991) |
| `stamped` | integer | sí | Cuántas se timbraron. (de -9007199254740991 a 9007199254740991) |
| `failed` | integer | sí | Cuántas no se timbraron (quedan con su motivo). (de -9007199254740991 a 9007199254740991) |
| `processing` | integer |  | Cuántas siguen en proceso. (de -9007199254740991 a 9007199254740991) |
| `created_at` | string (date-time) o null | sí | Cuándo se creó, ISO 8601 con la hora de la Ciudad de México (-06:00). |
| `completed_at` | string (date-time) o null | sí | Cuándo terminó. |
| `invoices` | arreglo de objeto |  | Cada factura del lote (no viene en listas ni en eventos). |
| `invoices[].index` | integer | sí | Su posición en invoices, desde 0. (de -9007199254740991 a 9007199254740991) |
| `invoices[].reference` | string o null | sí | Su identificador de esta factura (su número de pedido), hasta 100 caracteres. |
| `invoices[].status` | `processing`, `valid`, `failed` | sí | processing, valid (timbrada) o failed (no se timbró; ver error). |
| `invoices[].invoice` | string o null | sí | La factura timbrada (inv_…). |
| `invoices[].uuid` | string o null | sí | Folio fiscal que asigna el SAT (UUID del Timbre Fiscal Digital), en mayúsculas. |
| `invoices[].total` | number | sí | Total en la moneda del comprobante (Total). |
| `invoices[].error` | string o null | sí | Por qué no se timbró. |

```json
{
  "id": "bat_OufpKqnrvx9p4hMdcoapAo5aaGJEme7mXj",
  "object": "invoice_batch",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "name": "Cuotas de octubre",
  "status": "completed",
  "total": 2,
  "stamped": 1,
  "failed": 1,
  "created_at": "2026-10-24T10:15:42-06:00",
  "completed_at": "2026-10-24T10:15:42-06:00",
  "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 exactamente como en su constancia de situación fiscal, en mayúsculas y sin «S.A. de C.V.» ni otro régimen de capital."
    }
  ]
}
```

## Errores

Puede responder 400, 401, 403, 404, 429, 500 con el cuerpo de error de siempre; cada código está en https://fiscalisto.com/docs/api/errores.md.
