# Get the general ledger

`GET https://api.fiscalisto.com/v1/accounting/general_ledger`

The general ledger for a period of up to 12 months: each account's opening balance, each debit and credit with its journal entry (journal_entry, the same id as journal_entries), its CFDI and the balance it leaves, and the closing balance. Only the accounts that moved, or the one you ask for with account even if it has no movements; grouping_code limits it to those of one grouping code. An account not in the catalog answers account_missing.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `from_month` | query | yes | The first month (YYYY-MM). |
| `to_month` | query |  | The last month (YYYY-MM), up to 12 months later; by default, from_month. |
| `account` | query |  | Only this account, by its number in the catalog. |
| `grouping_code` | query |  | Only the accounts of this SAT grouping code (102 brings 102.01, 102.02…), like a line of a financial statement. Not used with account. |
| `issuer` | query |  | The issuer (iss_…). It can be left out if the key or the account has only one. |

## With the TypeScript SDK

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

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

const generalLedger = await fiscalisto.accounting.generalLedger({ from_month: "2026-01" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

general_ledger = fiscalisto.accounting.general_ledger({"from_month": "2026-01"})
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

$generalLedger = $fiscalisto->accounting->generalLedger(['from_month' => '2026-01']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

var generalLedger = await fiscalisto.Accounting.GeneralLedgerAsync(new GetGeneralLedgerParams { FromMonth = "2026-01" });
```

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

	generalLedger, err := client.Accounting.GeneralLedger(ctx, &fiscalisto.GetGeneralLedgerParams{FromMonth: "2026-01"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *generalLedger)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetGeneralLedgerParams;

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

var generalLedger = fiscalisto.accounting().generalLedger(new GetGeneralLedgerParams().setFromMonth("2026-01"));
System.out.println(generalLedger);
```

## Response 200

OK.

A `GeneralLedger` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"general_ledger"` | yes | What kind of object it is («invoice», «customer»…). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer` | string | yes | The issuer. |
| `from_month` | string | yes | The first month (YYYY-MM). |
| `to_month` | string | yes | The last month (YYYY-MM). |
| `accounts` | array of object | yes | Each account that moved in the period (or the one requested with account): its balances, its totals and its movements. |
| `accounts[].object` | `"ledger_account"` | yes | What kind of object it is («invoice», «customer»…). |
| `accounts[].number` | string | yes | Employee number (NumEmpleado). |
| `accounts[].name` | string | yes | Name. |
| `accounts[].grouping_code` | string | yes | The SAT grouping code. |
| `accounts[].nature` | `debit`, `credit` | yes | debit or credit. |
| `accounts[].opening_balance` | number | yes | The balance at the start of the month. |
| `accounts[].debit` | number | yes | The month's debits. |
| `accounts[].credit` | number | yes | The month's credits. |
| `accounts[].closing_balance` | number | yes | The balance at the end of the month. |
| `accounts[].movements` | array of object | yes | Each debit and credit of the account in the period, in the order of its journal entries, with the balance it leaves. |
| `accounts[].movements[].date` | string | yes | Issue date (Fecha), Mexico City time. |
| `accounts[].movements[].journal_entry` | string | yes | The journal entry (the same id as in GET /v1/accounting/journal_entries). |
| `accounts[].movements[].type` | `invoice`, `payment_received`, `payment_made`, `payroll`, `employee_expenses`, `depreciation`, `manual`, `asset_disposal`, `bank_identification`, `foreign_supplier_operations`, `prepaid_amortization` | yes | Receipt type (TipoDeComprobante): I income, E expense, P payment, T transfer, N payroll. |
| `accounts[].movements[].description` | string | yes | Description. |
| `accounts[].movements[].tax_id` | string or null | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `accounts[].movements[].uuid` | string or null | yes | Tax folio the SAT assigns (UUID of the Timbre Fiscal Digital), in uppercase. |
| `accounts[].movements[].debit` | number | yes | The debit. |
| `accounts[].movements[].credit` | number | yes | The credit. |
| `accounts[].movements[].balance` | number | yes | The account's balance after this movement, by its nature. |

```json
{
  "object": "general_ledger",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "from_month": "2026-10",
  "to_month": "2026-10",
  "accounts": [
    {
      "object": "ledger_account",
      "number": "105-01",
      "name": "Clientes nacionales",
      "grouping_code": "105.01",
      "nature": "debit",
      "opening_balance": 0,
      "debit": 5800,
      "credit": 0,
      "closing_balance": 5800,
      "movements": [
        {
          "date": "2026-10-15",
          "journal_entry": "D-202610-00001",
          "type": "invoice",
          "description": "Factura A-12 a INMOBILIARIA CVA",
          "tax_id": "ICV060329BY0",
          "uuid": "5f0c2b1e-6c8a-4d0e-9f3a-2b7c1d4e8a90",
          "debit": 5800,
          "credit": 0,
          "balance": 5800
        }
      ]
    }
  ]
}
```

## Errors

- `account_missing` (400): That account isn't in the issuer's chart of accounts: see it with GET /v1/accounting/accounts or add it with POST /v1/accounting/accounts.
- `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.

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