# Descargar la DIOT para el SAT

`GET https://api.fiscalisto.com/v1/accounting/diot/file`

El TXT de carga masiva de la DIOT 2025: 54 campos separados por |, pesos enteros. Con group_small_suppliers=true junta en una línea global a los proveedores chicos (regla 4.5.2 RMF). Un mes sin pagos a proveedores responde diot_empty: esa se presenta sin operaciones en el portal del SAT.

## Parámetros

| Nombre | Dónde | Obligatorio | Descripción |
| --- | --- | --- | --- |
| `month` | consulta | sí | El mes (AAAA-MM). |
| `group_small_suppliers` | consulta |  | true para agrupar proveedores de hasta $50,000 en el mes (regla 4.5.2). |
| `issuer` | consulta |  | El emisor (iss_…). Puede omitirse si la llave o la cuenta tienen uno solo. |

## Con el SDK de TypeScript

```ts
import { writeFile } from "node:fs/promises";
import { Fiscalisto } from "fiscalisto";

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

await writeFile("diot.txt", await fiscalisto.accounting.diotFile({ month: "2026-10" }));
```

## Con el SDK de Python

```python
from fiscalisto import Fiscalisto

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

with open("diot.txt", "w", encoding="utf-8") as f:
    f.write(fiscalisto.accounting.diot_file({"month": "2026-10"}))
```

## Con el SDK de PHP

```php
<?php

use Fiscalisto\Fiscalisto;

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

file_put_contents('diot.txt', $fiscalisto->accounting->diotFile(['month' => '2026-10']));
```

## Con el SDK de .NET

```csharp
using Fiscalisto;

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

await File.WriteAllTextAsync("diot.txt", await fiscalisto.Accounting.DiotFileAsync(new GetDiotFileParams { Month = "2026-10" }));
```

## Con el SDK de Go

```go
package main

import (
	"context"
	"log"
	"os"

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

	xml, err := client.Accounting.DiotFile(ctx, &fiscalisto.GetDiotFileParams{Month: "2026-10"})
	if err != nil {
		log.Fatal(err)
	}
	if err := os.WriteFile("diot.txt", []byte(xml), 0o644); err != nil {
		log.Fatal(err)
	}
}
```

## Con el SDK de Java

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetDiotFileParams;
import java.nio.file.Files;
import java.nio.file.Path;

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

Files.writeString(Path.of("diot.txt"), fiscalisto.accounting().diotFile(new GetDiotFileParams().setMonth("2026-10")));
```

## Respuesta 200

El archivo.

## 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.
