# Accounting

> Each issuer's journal entries, trial balance, financial statements, chart of accounts, electronic accounting for SAT and DIOT, built from its CFDI.

With the invoices the issuer stamped and the ones it received (from [SAT downloads](https://fiscalisto.com/en/docs/api/descargas-del-sat)), Fiscalisto builds its accounting for each month: the journal entries of its CFDI, its payments, its payroll and its assets' depreciation; the trial balance; the income statement and the balance sheet; the chart of accounts with SAT's grouping code; the electronic accounting XMLs and the DIOT. What has no CFDI (accruals, adjustments, assets bought without an invoice) goes in with [manual journal entries](#manual-journal-entries) and [fixed assets](#fixed-assets).

## Journal entries

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/journal_entries?month=2026-10" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

for await (const item of fiscalisto.accounting.journalEntries({ month: "2026-10" })) {
  console.log(item.id);
}
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

for item in fiscalisto.accounting.journal_entries({"month": "2026-10"}):
    print(item["id"])
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

foreach ($fiscalisto->accounting->journalEntries(['month' => '2026-10']) as $item) {
    echo $item['id'], "\n";
}
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	for item, err := range client.Accounting.JournalEntriesAutoPaging(ctx, &fiscalisto.ListJournalEntriesParams{Month: "2026-10"}) {
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(item.ID)
	}
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.ListJournalEntriesParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

for (var item : fiscalisto.accounting().journalEntriesAutoPaging(new ListJournalEntriesParams().setMonth("2026-10"))) {
    System.out.println(item.getId());
}
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

await foreach (var item in fiscalisto.Accounting.JournalEntriesAutoPagingAsync(new ListJournalEntriesParams { Month = "2026-10" }))
    Console.WriteLine(item.Id);
```

The month's journal entries (`D-202610-00001`…), in date order, with their debits and credits in pesos, which always balance. `type` says what each one is from:

| `type` | From | Debit | Credit |
| --- | --- | --- | --- |
| `invoice` | Issued invoice | Customers (or Cash or Banks if PUE), withholdings made to it | Sales net of discounts, split by IVA (16%, 8%, 0%, exempt, not subject), transferred IVA and IEPS (collected if PUE, uncollected if PPD) |
| `invoice` | Received invoice | The expense of its category with its IEPS (or the fixed asset, uses I01 to I08 or marked as construction), creditable IVA; a currency purchase, an item to clarify or a personal expense (D uses) goes in full, with its IVA, to its own account | Suppliers (or Cash or Banks if PUE), withholdings payable |
| `invoice` | Credit note | The reverse of the invoice; one on fixed assets credits the asset | |
| `payment_received` | Payment of a complement it issued | Banks, exchange loss | Customers, exchange gain; the IVA moves from uncollected to collected |
| `payment_made` | Payment of a complement it received | Suppliers | Banks; the IVA moves from pending to paid |
| `payroll` | Payroll receipt | Salaries and other payments; its travel expenses (050 and advance 003) to Officers and employees | ISR withheld, other withholdings (travel's 081 to Officers and employees), Banks for the net |
| `employee_expenses` | Advance, reimbursement, return or approved travel expense report | Officers and employees for what they're given; on the report, the account each invoice the person paid was recorded with (Banks, the card, Suppliers) and Travel expenses for what isn't in received invoices | Banks or Cash; on the report, Officers and employees |
| `depreciation` | The month's depreciation | Depreciation of each asset type | Its accumulated depreciation |
| `asset_disposal` | The sale or write-off of a fixed asset | Its accumulated depreciation; its book value to loss on sale or write-off (703) | The asset for its original amount |
| `manual` | A journal entry entered by hand, or an accrual's reversal | What was entered | What was entered |
| `foreign_supplier_operations` | What was paid in the month to a foreign supplier (Impuestos › Proveedores extranjeros), on the month's last day | The supplier's account (or Gastos: Sin categoría) for the value and the non-creditable IVA; creditable IVA paid | Suppliers for the value and, for a platform registered in the RFC (article 18-D of the LIVA), its IVA; an imported service's IVA to transferred IVA collected (you cause it, articles 24 and 26); the customs entry's IVA to Sundry creditors |
| `prepaid_amortization` | The month's share of a prepaid expense, on the last day of each month it covers | The expense account it's amortized to | Its prepaid account (109) |

A PUE is recorded as collected or paid according to its payment form: cash in Cash, transfer, check or card in Banks, and a received one paid by credit card in Credit cards payable. Depreciation is straight-line with the rates of article 34 of the LISR, from the month after it starts being used, without INPC.

Each entry says which document it comes from (`uuid`, and `invoice` if it's a CFDI this issuer stamped); depreciation and travel expense entries have no `uuid`, and depreciation has no `tax_id` either. A CFDI in another currency is recorded with its exchange rate; without one, it isn't recorded. Up to 1,000 entries per page with `limit`, and the next with `starting_after`. An entry's number is its place in the month: a CFDI of that month that arrives later (for example, in a SAT download) shifts the ones after it, so to relate an entry to its document use `uuid`, not `id`.

## Manual journal entries

What has no CFDI (an accrual, an accountant's adjustment, a reclassification, buying an asset without an invoice) goes in with a journal entry entered by hand, like **Nueva póliza** in the app's **Estados financieros**. It counts in the trial balance, the financial statements and the electronic accounting just like those of its CFDI.

For an entry booked the same way every month (rent, the amortization of a prepaid insurance), send `repeat_until` (YYYY-MM, up to 60 months): it goes in on the same day of each month through that month, or on the last day when its date is a month's last. Correcting or deleting it changes all its months and answers `period_closed` if any is closed; changing only `repeat_until` touches only the months it adds or removes.

Each line can carry its `cost_center` (`ccn_…`, from [`GET /v1/cost_centers`](https://fiscalisto.com/en/docs/api/centros-de-costo)): it counts in the [results by cost center](#results-by-cost-center) and in that cost center's budget. The electronic accounting doesn't carry it.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/manual_entries \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2026-10-31",
    "description": "Provisión de honorarios de octubre",
    "kind": "accrual",
    "reverse_next_month": true,
    "lines": [
      { "account": "601-48", "debit": 12000 },
      { "account": "205-06", "credit": 12000 }
    ]
  }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const manualJournalEntry = await fiscalisto.manualEntries.create({
  date: "2026-10-31",
  description: "Provisión de honorarios de octubre",
  kind: "accrual",
  reverse_next_month: true,
  lines: [
    { account: "601-48", debit: 12000 },
    { account: "205-06", credit: 12000 },
  ],
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

manual_journal_entry = fiscalisto.manual_entries.create({
    "date": "2026-10-31",
    "description": "Provisión de honorarios de octubre",
    "kind": "accrual",
    "reverse_next_month": True,
    "lines": [
        {"account": "601-48", "debit": 12000},
        {"account": "205-06", "credit": 12000},
    ],
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$manualJournalEntry = $fiscalisto->manualEntries->create([
    'date' => '2026-10-31',
    'description' => 'Provisión de honorarios de octubre',
    'kind' => 'accrual',
    'reverse_next_month' => true,
    'lines' => [
        [
            'account' => '601-48',
            'debit' => 12000,
        ],
        [
            'account' => '205-06',
            'credit' => 12000,
        ],
    ],
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	manualJournalEntry, err := client.ManualEntries.Create(ctx, &fiscalisto.CreateManualEntryParams{
		Date:             "2026-10-31",
		Description:      "Provisión de honorarios de octubre",
		Kind:             fiscalisto.String("accrual"),
		ReverseNextMonth: fiscalisto.Bool(true),
		Lines: []fiscalisto.CreateManualEntryParamsLine{
			{Account: "601-48", Debit: fiscalisto.Float64(12000)},
			{Account: "205-06", Credit: fiscalisto.Float64(12000)},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(manualJournalEntry.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.CreateManualEntryParams;
import com.fiscalisto.model.CreateManualEntryParamsLine;
import java.util.List;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var manualJournalEntry = fiscalisto.manualEntries().create(new CreateManualEntryParams()
        .setDate("2026-10-31")
        .setDescription("Provisión de honorarios de octubre")
        .setKind("accrual")
        .setReverseNextMonth(true)
        .setLines(List.of(
                new CreateManualEntryParamsLine()
                        .setAccount("601-48")
                        .setDebit(12000),
                new CreateManualEntryParamsLine()
                        .setAccount("205-06")
                        .setCredit(12000)
        )));
System.out.println(manualJournalEntry.getId());
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var manualJournalEntry = await fiscalisto.ManualEntries.CreateAsync(new CreateManualEntryParams
{
    Date = "2026-10-31",
    Description = "Provisión de honorarios de octubre",
    Kind = "accrual",
    ReverseNextMonth = true,
    Lines = new()
    {
        new() { Account = "601-48", Debit = 12000 },
        new() { Account = "205-06", Credit = 12000 },
    },
});
```

Each line carries the number of an account in the chart (`GET /v1/accounting/accounts`) and a debit or a credit; debits add up to the same as credits (otherwise `entry_unbalanced`) and an account that isn't in the chart answers `account_missing`. With `kind` `accrual` and `reverse_next_month`, the entry reverses itself on the 1st of the next month, so the invoice that arrives later doesn't double the expense; a closing `adjustment` (like the [FX revaluation](#fx-revaluation)) can reverse too. In `GET /v1/accounting/journal_entries` it shows with `type` `manual` and its `manual_entry` (`mje_…`); so does its reversal. `GET /v1/accounting/manual_entries` lists them, `POST /v1/accounting/manual_entries/{id}` corrects one and `DELETE` deletes it.

A line in another currency carries `currency` (ISO 4217), `foreign_amount` and `exchange_rate`, and its `debit` or `credit` is their product in pesos (otherwise `parameter_invalid` on `lines`). A line can carry its own CFDI in `cfdi_uuid` and `cfdi_tax_id`, apart from the entry's `uuid`: so an entry that collects several invoices carries each one on its line. In the electronic accounting each line goes out with its `CompNal` (with its currency and exchange rate) and the folio auxiliary lists each CFDI once.

If your chart doesn't have the account you need, add it with `POST /v1/accounting/accounts` (`number`, `name` and a sub-account of the grouping code in `grouping_code`, for example 210.01). Its nature comes from the grouping code and its number isn't repeated.

## Entry templates

For an entry you book often with the same accounts (a purchase with IVA, rent), save it as an entry template with `POST /v1/accounting/entry_templates`, like **Guardar como modelo** in the app. Each line goes on its `side` (`debit` or `credit`) with a `percentage` of the total, a fixed `amount` or neither, to write each time; a side's percentages add up to at most 100 and the `name` isn't repeated.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/entry_templates \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Compra con IVA al 16%",
    "description": "Compra de papelería",
    "kind": "other",
    "journal_type": "expense",
    "lines": [
      { "account": "601-84", "side": "debit", "percentage": 86.2069 },
      { "account": "118-01", "side": "debit", "percentage": 13.7931 },
      { "account": "102-01", "side": "credit", "percentage": 100 }
    ]
  }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const entryTemplate = await fiscalisto.entryTemplates.create({
  name: "Compra con IVA al 16%",
  description: "Compra de papelería",
  kind: "other",
  journal_type: "expense",
  lines: [
    {
      account: "601-84",
      side: "debit",
      percentage: 86.2069,
    },
    {
      account: "118-01",
      side: "debit",
      percentage: 13.7931,
    },
    {
      account: "102-01",
      side: "credit",
      percentage: 100,
    },
  ],
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

entry_template = fiscalisto.entry_templates.create({
    "name": "Compra con IVA al 16%",
    "description": "Compra de papelería",
    "kind": "other",
    "journal_type": "expense",
    "lines": [
        {
            "account": "601-84",
            "side": "debit",
            "percentage": 86.2069,
        },
        {
            "account": "118-01",
            "side": "debit",
            "percentage": 13.7931,
        },
        {
            "account": "102-01",
            "side": "credit",
            "percentage": 100,
        },
    ],
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$entryTemplate = $fiscalisto->entryTemplates->create([
    'name' => 'Compra con IVA al 16%',
    'description' => 'Compra de papelería',
    'kind' => 'other',
    'journal_type' => 'expense',
    'lines' => [
        [
            'account' => '601-84',
            'side' => 'debit',
            'percentage' => 86.2069,
        ],
        [
            'account' => '118-01',
            'side' => 'debit',
            'percentage' => 13.7931,
        ],
        [
            'account' => '102-01',
            'side' => 'credit',
            'percentage' => 100,
        ],
    ],
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	entryTemplate, err := client.EntryTemplates.Create(ctx, &fiscalisto.CreateEntryTemplateParams{
		Name:        "Compra con IVA al 16%",
		Description: "Compra de papelería",
		Kind:        fiscalisto.String("other"),
		JournalType: fiscalisto.String("expense"),
		Lines: []fiscalisto.CreateEntryTemplateParamsLine{
			{
				Account:    "601-84",
				Side:       "debit",
				Percentage: fiscalisto.Float64(86.2069),
			},
			{
				Account:    "118-01",
				Side:       "debit",
				Percentage: fiscalisto.Float64(13.7931),
			},
			{
				Account:    "102-01",
				Side:       "credit",
				Percentage: fiscalisto.Float64(100),
			},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(entryTemplate.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.CreateEntryTemplateParams;
import com.fiscalisto.model.CreateEntryTemplateParamsLine;
import java.util.List;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var entryTemplate = fiscalisto.entryTemplates().create(new CreateEntryTemplateParams()
        .setName("Compra con IVA al 16%")
        .setDescription("Compra de papelería")
        .setKind("other")
        .setJournalType("expense")
        .setLines(List.of(
                new CreateEntryTemplateParamsLine()
                        .setAccount("601-84")
                        .setSide("debit")
                        .setPercentage(86.2069),
                new CreateEntryTemplateParamsLine()
                        .setAccount("118-01")
                        .setSide("debit")
                        .setPercentage(13.7931),
                new CreateEntryTemplateParamsLine()
                        .setAccount("102-01")
                        .setSide("credit")
                        .setPercentage(100)
        )));
System.out.println(entryTemplate.getId());
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var entryTemplate = await fiscalisto.EntryTemplates.CreateAsync(new CreateEntryTemplateParams
{
    Name = "Compra con IVA al 16%",
    Description = "Compra de papelería",
    Kind = "other",
    JournalType = "expense",
    Lines = new()
    {
        new()
        {
            Account = "601-84",
            Side = "debit",
            Percentage = 86.2069m,
        },
        new()
        {
            Account = "118-01",
            Side = "debit",
            Percentage = 13.7931m,
        },
        new()
        {
            Account = "102-01",
            Side = "credit",
            Percentage = 100,
        },
    },
});
```

`POST /v1/accounting/entry_templates/{id}/apply` with a `total` gives its lines for that total: each percentage to the cent, and the cent rounding leaves goes to the largest line of a side that adds up to 100%, so it balances. It saves nothing: review them and send them as `lines` in `POST /v1/accounting/manual_entries`. `GET /v1/accounting/entry_templates` lists them, `POST /v1/accounting/entry_templates/{id}` changes one and `DELETE` deletes it; entries already made with it don't change.

## Fixed assets

`GET /v1/accounting/fixed_assets?month=2026-10` gives each asset with its original amount, its rate, its month's and accumulated depreciation, and its book value at the close of that month. Those that came in a received invoice (uses I01 to I08) show up on their own (`fxc_…`); one bought without a CFDI is added with `POST /v1/accounting/fixed_assets` (`fxa_…`):

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/fixed_assets \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "description": "Laptop", "cfdi_use": "I04", "cost": 24000, "acquired_on": "2026-01-10" }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const fixedAsset = await fiscalisto.fixedAssets.create({
  description: "Laptop",
  cfdi_use: "I04",
  cost: 24000,
  acquired_on: "2026-01-10",
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

fixed_asset = fiscalisto.fixed_assets.create({
    "description": "Laptop",
    "cfdi_use": "I04",
    "cost": 24000,
    "acquired_on": "2026-01-10",
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$fixedAsset = $fiscalisto->fixedAssets->create([
    'description' => 'Laptop',
    'cfdi_use' => 'I04',
    'cost' => 24000,
    'acquired_on' => '2026-01-10',
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	fixedAsset, err := client.FixedAssets.Create(ctx, &fiscalisto.CreateFixedAssetParams{
		Description: "Laptop",
		CFDIUse:     "I04",
		Cost:        24000,
		AcquiredOn:  "2026-01-10",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(fixedAsset.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.CreateFixedAssetParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var fixedAsset = fiscalisto.fixedAssets().create(new CreateFixedAssetParams()
        .setDescription("Laptop")
        .setCfdiUse("I04")
        .setCost(24000)
        .setAcquiredOn("2026-01-10"));
System.out.println(fixedAsset.getId());
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var fixedAsset = await fiscalisto.FixedAssets.CreateAsync(new CreateFixedAssetParams
{
    Description = "Laptop",
    CfdiUse = "I04",
    Cost = 24000,
    AcquiredOn = "2026-01-10",
});
```

An asset added this way only adds its depreciation; its cost enters the trial balance with your opening balances or with a manual entry (debit to the asset's account, credit to Banks). When you sell it or write it off, `POST /v1/accounting/fixed_assets/{id}/dispose` (`date`, `reason` `sale` or `write_off`, `note`) stops depreciating it that month and records an `asset_disposal` entry that cancels the asset and its accumulated depreciation; its book value goes to loss on sale or write-off of fixed assets (703). A sale's income comes in with the invoice you issue. `DELETE /v1/accounting/fixed_assets/{id}/disposal` undoes the disposal, and `DELETE /v1/accounting/fixed_assets/{id}` deletes one added without a CFDI (one with a CFDI answers `asset_from_cfdi`).

## Book and tax depreciation

By default the books depreciate each asset at the rate of article 34 of the Ley del ISR. `POST /v1/accounting/book_depreciation_rates` sets the annual rate (`annual_rate`, 0.2 is a 5-year useful life) and the residual value (`residual_rate`, a fraction of the original cost) of one asset (`fixed_asset`) or of every asset of a type (`cfdi_use`) from `from_month` on (NIF C-6); the asset's own wins over its type's. Earlier months don't change and the month must be open. `annual_rate: null` removes that month's rate. The tax deduction keeps the article 34 rate, and each asset carries both: `annual_rate` and `tax_annual_rate`.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/book_depreciation_rates \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "cfdi_use": "I03", "from_month": "2026-01", "annual_rate": 0.2, "residual_rate": 0.1 }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const bookDepreciationRate = await fiscalisto.bookDepreciationRates.save({
  cfdi_use: "I03",
  from_month: "2026-01",
  annual_rate: 0.2,
  residual_rate: 0.1,
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

book_depreciation_rate = fiscalisto.book_depreciation_rates.save({
    "cfdi_use": "I03",
    "from_month": "2026-01",
    "annual_rate": 0.2,
    "residual_rate": 0.1,
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$bookDepreciationRate = $fiscalisto->bookDepreciationRates->save([
    'cfdi_use' => 'I03',
    'from_month' => '2026-01',
    'annual_rate' => 0.2,
    'residual_rate' => 0.1,
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	bookDepreciationRate, err := client.BookDepreciationRates.Save(ctx, &fiscalisto.SaveBookDepreciationRateParams{
		CFDIUse:      fiscalisto.String("I03"),
		FromMonth:    "2026-01",
		AnnualRate:   fiscalisto.Float64(0.2),
		ResidualRate: fiscalisto.Float64(0.1),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *bookDepreciationRate)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.SaveBookDepreciationRateParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var bookDepreciationRate = fiscalisto.bookDepreciationRates().save(new SaveBookDepreciationRateParams()
        .setCfdiUse("I03")
        .setFromMonth("2026-01")
        .setAnnualRate(0.2)
        .setResidualRate(0.1));
System.out.println(bookDepreciationRate);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var bookDepreciationRate = await fiscalisto.BookDepreciationRates.SaveAsync(new SaveBookDepreciationRateParams
{
    CfdiUse = "I03",
    FromMonth = "2026-01",
    AnnualRate = 0.2m,
    ResidualRate = 0.1m,
});
```

`GET /v1/accounting/depreciation_reconciliations/{year}` compares each asset's book depreciation for the year (`book_depreciation`) with its tax deduction updated by the INPC (`tax_deduction`, with its `inflation_factor`). `difference` is the reconciling item of the annual return's conciliación contable-fiscal.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/depreciation_reconciliations/2025 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const depreciationReconciliation = await fiscalisto.depreciationReconciliations.get("2025");
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

depreciation_reconciliation = fiscalisto.depreciation_reconciliations.get("2025")
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$depreciationReconciliation = $fiscalisto->depreciationReconciliations->get('2025');
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	depreciationReconciliation, err := client.DepreciationReconciliations.Get(ctx, "2025", nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *depreciationReconciliation)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var depreciationReconciliation = fiscalisto.depreciationReconciliations().get("2025");
System.out.println(depreciationReconciliation);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var depreciationReconciliation = await fiscalisto.DepreciationReconciliations.GetAsync("2025");
```

## Bank movements without an invoice

What an invoice paid or collected is already in the books through its CFDI. `GET /v1/accounting/bank_movements?month=2026-10` gives the rest: the withdrawals of the statements imported in the reconciliation (`bwd_…`: fees, taxes, loan payments, transfers) and the deposits classified there as a loan, transfer, refund or interest (`btx_…`). Each one has its `status` (`pending`, `posted`, `paid_invoices` or `ignored`) and, if a `bank.movement` [rule](https://fiscalisto.com/en/docs/api/reglas) matches it, its account in `suggested_account`. With `remember: true`, booking it creates that rule (or changes it): movements in the same direction with the same bank text are booked to that account on their own when they arrive; it is seen and changed in Ajustes › Reglas.

`POST /v1/accounting/bank_movements/{id}/post` makes its journal entry on the bank's date: an expense entry for a withdrawal (`account` against Bancos) and an income entry for a deposit (Bancos against `account`). It is like any manual journal entry (`manual_entry`) in the trial balance, the general ledger and the electronic accounting:

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/bank_movements/bwd_OufpKqnrvx9p4Kc8Tn2Vr6Lm1aQzWx9P0d/post \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "account": "701-10", "remember": true }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const accountingBankMovement = await fiscalisto.bankMovements.post("bwd_OufpKqnrvx9p4Kc8Tn2Vr6Lm1aQzWx9P0d", { account: "701-10", remember: true });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

accounting_bank_movement = fiscalisto.bank_movements.post("bwd_OufpKqnrvx9p4Kc8Tn2Vr6Lm1aQzWx9P0d", {"account": "701-10", "remember": True})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$accountingBankMovement = $fiscalisto->bankMovements->post('bwd_OufpKqnrvx9p4Kc8Tn2Vr6Lm1aQzWx9P0d', ['account' => '701-10', 'remember' => true]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	accountingBankMovement, err := client.BankMovements.Post(ctx, "bwd_OufpKqnrvx9p4Kc8Tn2Vr6Lm1aQzWx9P0d", &fiscalisto.PostBankMovementParams{
		Account:  "701-10",
		Remember: fiscalisto.Bool(true),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(accountingBankMovement.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.PostBankMovementParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var accountingBankMovement = fiscalisto.bankMovements().post("bwd_OufpKqnrvx9p4Kc8Tn2Vr6Lm1aQzWx9P0d", new PostBankMovementParams().setAccount("701-10").setRemember(true));
System.out.println(accountingBankMovement.getId());
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var accountingBankMovement = await fiscalisto.BankMovements.PostAsync("bwd_OufpKqnrvx9p4Kc8Tn2Vr6Lm1aQzWx9P0d", new PostBankMovementParams
{
    Account = "701-10",
    Remember = true,
});
```

A withdrawal that paid invoices already in Fiscalisto is marked with `POST /v1/accounting/bank_movements/{id}/mark` and `status` `paid_invoices`, so it isn't booked twice; `ignored` leaves it without an entry and `pending` brings it back. `DELETE /v1/accounting/bank_movements/{id}/post` removes its entry. One already booked answers `bank_movement_posted`, and an unclassified deposit or a marked withdrawal, `bank_movement_not_bookable`.

## The account of each invoice

Each invoice goes to its category's account or, for income, to the sales account its VAT gives. To book its income or expense to another account of your chart, send `account` with its number to `POST /v1/sat_invoices/{id}`; `null` sends it back to its category's. Each `sat_invoice` has `account`, and its journal entries, the trial balance and the electronic accounting use it. Only invoices and credit notes, never Cash or Banks (its payment books those) and not in a closed month (`400` with `param` `account`). Each change goes into the books log as `invoice_account`. To have a supplier's, RFC's, product key's, use's or series' invoices take their account by themselves, use the `account` action in [Rules](https://fiscalisto.com/en/docs/api/reglas): it never changes the one a person chose.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/sat_invoices/sat_OufpKqnrvx9p1G \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "account": "601-84-002" }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const satInvoice = await fiscalisto.satInvoices.update("sat_OufpKqnrvx9p1G", { account: "601-84-002" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

sat_invoice = fiscalisto.sat_invoices.update("sat_OufpKqnrvx9p1G", {"account": "601-84-002"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$satInvoice = $fiscalisto->satInvoices->update('sat_OufpKqnrvx9p1G', ['account' => '601-84-002']);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	satInvoice, err := client.SatInvoices.Update(ctx, "sat_OufpKqnrvx9p1G", &fiscalisto.UpdateSatInvoiceParams{
		Account: fiscalisto.String("601-84-002"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(satInvoice.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.UpdateSatInvoiceParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var satInvoice = fiscalisto.satInvoices().update("sat_OufpKqnrvx9p1G", new UpdateSatInvoiceParams().setAccount("601-84-002"));
System.out.println(satInvoice.getId());
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var satInvoice = await fiscalisto.SatInvoices.UpdateAsync("sat_OufpKqnrvx9p1G", new UpdateSatInvoiceParams { Account = "601-84-002" });
```

## Edit a CFDI's journal entry

The journal entry Fiscalisto builds for an invoice, a credit note or a payroll receipt can be edited, as in the app (**Editar póliza** in Estados financieros › Pólizas). `GET /v1/accounting/automatic_entries/{uuid}` shows it by the CFDI's UUID. `POST` with `lines` (and `description`, optional) puts its lines in place of the automatic ones, with the rules of a manual journal entry: accounts of your chart by number and debits that add up to the credits (`entry_unbalanced`). The edit stays even when the CFDI is downloaded again, goes into its month, the balances of the months after and the electronic accounting, and goes into the books log as `automatic_journal_entry`. If what builds it changes later (its `account` or its category), `original_changed` is `true` and `original_lines` has today's lines. `DELETE` goes back to the original. A closed month answers `period_closed`. In `GET /v1/accounting/journal_entries`, each edited entry has `edited: true`. A payment has no entry of its own to edit: correct it with a manual journal entry.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/automatic_entries/8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Luz y agua de la oficina, octubre",
    "lines": [
      { "account": "601-84-002", "debit": 3000 },
      { "account": "601-84-003", "debit": 2000 },
      { "account": "118-01", "debit": 800 },
      { "account": "102-01", "credit": 5800 }
    ]
  }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const automaticJournalEntry = await fiscalisto.automaticEntries.update("8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D", {
  description: "Luz y agua de la oficina, octubre",
  lines: [
    { account: "601-84-002", debit: 3000 },
    { account: "601-84-003", debit: 2000 },
    { account: "118-01", debit: 800 },
    { account: "102-01", credit: 5800 },
  ],
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

automatic_journal_entry = fiscalisto.automatic_entries.update("8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D", {
    "description": "Luz y agua de la oficina, octubre",
    "lines": [
        {"account": "601-84-002", "debit": 3000},
        {"account": "601-84-003", "debit": 2000},
        {"account": "118-01", "debit": 800},
        {"account": "102-01", "credit": 5800},
    ],
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$automaticJournalEntry = $fiscalisto->automaticEntries->update('8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D', [
    'description' => 'Luz y agua de la oficina, octubre',
    'lines' => [
        [
            'account' => '601-84-002',
            'debit' => 3000,
        ],
        [
            'account' => '601-84-003',
            'debit' => 2000,
        ],
        ['account' => '118-01', 'debit' => 800],
        [
            'account' => '102-01',
            'credit' => 5800,
        ],
    ],
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	automaticJournalEntry, err := client.AutomaticEntries.Update(ctx, "8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D", &fiscalisto.UpdateAutomaticEntryParams{
		Description: fiscalisto.String("Luz y agua de la oficina, octubre"),
		Lines: []fiscalisto.UpdateAutomaticEntryParamsLine{
			{Account: "601-84-002", Debit: fiscalisto.Float64(3000)},
			{Account: "601-84-003", Debit: fiscalisto.Float64(2000)},
			{Account: "118-01", Debit: fiscalisto.Float64(800)},
			{Account: "102-01", Credit: fiscalisto.Float64(5800)},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *automaticJournalEntry)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.UpdateAutomaticEntryParams;
import com.fiscalisto.model.UpdateAutomaticEntryParamsLine;
import java.util.List;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var automaticJournalEntry = fiscalisto.automaticEntries().update("8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D", new UpdateAutomaticEntryParams()
        .setDescription("Luz y agua de la oficina, octubre")
        .setLines(List.of(
                new UpdateAutomaticEntryParamsLine()
                        .setAccount("601-84-002")
                        .setDebit(3000),
                new UpdateAutomaticEntryParamsLine()
                        .setAccount("601-84-003")
                        .setDebit(2000),
                new UpdateAutomaticEntryParamsLine()
                        .setAccount("118-01")
                        .setDebit(800),
                new UpdateAutomaticEntryParamsLine()
                        .setAccount("102-01")
                        .setCredit(5800)
        )));
System.out.println(automaticJournalEntry);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var automaticJournalEntry = await fiscalisto.AutomaticEntries.UpdateAsync("8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D", new UpdateAutomaticEntryParams
{
    Description = "Luz y agua de la oficina, octubre",
    Lines = new()
    {
        new() { Account = "601-84-002", Debit = 3000 },
        new() { Account = "601-84-003", Debit = 2000 },
        new() { Account = "118-01", Debit = 800 },
        new() { Account = "102-01", Credit = 5800 },
    },
});
```

## Prepaid expenses

A year of insurance, rent paid ahead or a license that covers several months isn't an expense of the month it's paid (NIF C-5): `POST /v1/accounting/prepaid_expenses/{uuid}` with `months` (and, optionally, `kind`, `start_month` and `expense_account`) sends the received invoice's journal entry to prepaid expenses (`insurance` 109.01, `rent` 109.05, `other` 109.23) and the books move it to its expense with a `prepaid_amortization` entry on the last day of each month it covers, all equal to the cent and the last one taking the rounding. `schedule` lists each one and `pending` what's left in the 109 account. `GET` says whether it's amortized; `DELETE` makes it an expense of the month again. Only a received ingreso invoice booked as an expense, not one whose entry was edited by hand, and not in a closed month (`period_closed`). Taxes don't change: the invoice is deducted as before. It goes to the books log as `prepaid_expense`.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/prepaid_expenses/8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "insurance",
    "months": 12,
    "start_month": "2026-01"
  }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const prepaidExpense = await fiscalisto.prepaidExpenses.update("8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D", {
  kind: "insurance",
  months: 12,
  start_month: "2026-01",
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

prepaid_expense = fiscalisto.prepaid_expenses.update("8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D", {
    "kind": "insurance",
    "months": 12,
    "start_month": "2026-01",
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$prepaidExpense = $fiscalisto->prepaidExpenses->update('8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D', [
    'kind' => 'insurance',
    'months' => 12,
    'start_month' => '2026-01',
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	prepaidExpense, err := client.PrepaidExpenses.Update(ctx, "8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D", &fiscalisto.UpdatePrepaidExpenseParams{
		Kind:       fiscalisto.String("insurance"),
		Months:     12,
		StartMonth: fiscalisto.String("2026-01"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *prepaidExpense)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.UpdatePrepaidExpenseParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var prepaidExpense = fiscalisto.prepaidExpenses().update("8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D", new UpdatePrepaidExpenseParams()
        .setKind("insurance")
        .setMonths(12)
        .setStartMonth("2026-01"));
System.out.println(prepaidExpense);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var prepaidExpense = await fiscalisto.PrepaidExpenses.UpdateAsync("8A1D2C3B-4E5F-4A6B-9C7D-0E1F2A3B4C5D", new UpdatePrepaidExpenseParams
{
    Kind = "insurance",
    Months = 12,
    StartMonth = "2026-01",
});
```

## Subaccounts per customer and supplier

As in CONTPAQi or Aspel COI, the company can keep what each customer owes in its own subaccount of Clientes (`105-01-0001`, `105-01-0002`…) and what it owes each supplier in its own of Proveedores (`201-01-0001`…), named as its CFDI names it and with the grouping code `105.01` or `201.01`. `POST /v1/accounting/settings` with `party_subaccounts: true` turns them on; `GET /v1/accounting/settings` says whether they are on. Each customer and supplier gets its number in the order of its first invoice, and a new one the next number when its first CFDI arrives; a number never moves to someone else, even if you turn them off and on again. A foreigner (`XEXX010101000`) is told apart by its name. The journal entries of its invoices, credit notes and payments go to each one's subaccount in `GET /v1/accounting/journal_entries`, the trial balance, the general ledger, the chart and the electronic accounting; manual journal entries keep the account they name. With `false`, everything goes back to Clientes and Proveedores with the same totals. The change goes into the books log. In the app it is **Subcuentas por cliente y proveedor** in **Catálogo de cuentas**.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/settings \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "party_subaccounts": true }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const accountingSettings = await fiscalisto.accountingSettings.update({ party_subaccounts: true });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

accounting_settings = fiscalisto.accounting_settings.update({"party_subaccounts": True})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$accountingSettings = $fiscalisto->accountingSettings->update(['party_subaccounts' => true]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	accountingSettings, err := client.AccountingSettings.Update(ctx, &fiscalisto.UpdateAccountingSettingsParams{
		PartySubaccounts: true,
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *accountingSettings)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.UpdateAccountingSettingsParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var accountingSettings = fiscalisto.accountingSettings().update(new UpdateAccountingSettingsParams().setPartySubaccounts(true));
System.out.println(accountingSettings);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var accountingSettings = await fiscalisto.AccountingSettings.UpdateAsync(new UpdateAccountingSettingsParams
{
    PartySubaccounts = true,
});
```

```json
{
  "object": "accounting_settings",
  "livemode": true,
  "issuer": "iss_8f2a1c",
  "party_subaccounts": true
}
```

## Closed months

Once you've filed a month's electronic accounting and tax returns, close it with `POST /v1/accounting/closed_period` and `closed_through` (YYYY-MM): that month and the earlier ones are closed, and creating, changing or deleting a manual journal entry, booking or removing a bank movement's entry, or disposing of an asset dated in them answers `period_closed`. `GET /v1/accounting/closed_period` says through which month the books are closed; to correct something, send an earlier month, or `null` to reopen them all. Invoices keep arriving from the SAT and go into their month even when it's closed.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/closed_period \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "closed_through": "2026-10" }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const closedPeriod = await fiscalisto.closedPeriod.set({ closed_through: "2026-10" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

closed_period = fiscalisto.closed_period.set({"closed_through": "2026-10"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$closedPeriod = $fiscalisto->closedPeriod->set(['closed_through' => '2026-10']);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	closedPeriod, err := client.ClosedPeriod.Set(ctx, &fiscalisto.SetClosedPeriodParams{
		ClosedThrough: fiscalisto.String("2026-10"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *closedPeriod)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.SetClosedPeriodParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var closedPeriod = fiscalisto.closedPeriod().set(new SetClosedPeriodParams().setClosedThrough("2026-10"));
System.out.println(closedPeriod);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var closedPeriod = await fiscalisto.ClosedPeriod.SetAsync(new SetClosedPeriodParams { ClosedThrough = "2026-10" });
```

## Bank accounts in the books

Each of the issuer's bank accounts is its own Bancos subaccount (`102-01-<last 4>`, código agrupador 102.01). What reconciliation identifies on its statement (a deposit matched to its invoice, a withdrawal marked `paid_invoices`) moves from Bancos to that account on the bank's date, in an entry of type `bank_identification`; what no statement explains stays in Bancos. `GET /v1/accounting/bank_accounts` lists them (`ledger_bank_account`: `last4`, `name`, `account`, `currency`) and `POST /v1/accounting/bank_accounts/{last_four}` changes their name or currency. An account in another currency isn't identified from the CFDI: its balance comes from its entries and is revalued at the month's close.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/bank_accounts/7788 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "currency": "USD" }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const ledgerBankAccount = await fiscalisto.ledgerBankAccounts.update("7788", { currency: "USD" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

ledger_bank_account = fiscalisto.ledger_bank_accounts.update("7788", {"currency": "USD"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$ledgerBankAccount = $fiscalisto->ledgerBankAccounts->update('7788', ['currency' => 'USD']);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	ledgerBankAccount, err := client.LedgerBankAccounts.Update(ctx, "7788", &fiscalisto.UpdateLedgerBankAccountParams{Currency: "USD"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *ledgerBankAccount)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.UpdateLedgerBankAccountParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var ledgerBankAccount = fiscalisto.ledgerBankAccounts().update("7788", new UpdateLedgerBankAccountParams().setCurrency("USD"));
System.out.println(ledgerBankAccount);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var ledgerBankAccount = await fiscalisto.LedgerBankAccounts.UpdateAsync("7788", new UpdateLedgerBankAccountParams { Currency = "USD" });
```

## FX revaluation

At each month's close, what your customers and suppliers still owe in another currency (PPD invoices in dollars, euros…) is valued at the closing exchange rate, not the invoice's (NIF B-15). `GET /v1/accounting/fx_revaluations/{month}` gives those invoices (`documents`, with what was still unpaid on each and its `booked_rate`), what's pending per currency (`currencies`: `receivable`, `payable`) and the closing rate we suggest (`closing_rate`, the FIX the DOF publishes the business day after the close). `POST` with `rates` records the adjusting entry on the month's last day: Clientes against Utilidad or Pérdida cambiaria and Proveedores against Pérdida or Utilidad cambiaria. It reverses itself on the 1st of the next month, so each payment keeps computing its exchange difference from the invoice's rate. Sending it again replaces it; `DELETE` removes it. Bank accounts in another currency are revalued too (`bank_accounts`: the balance of the month's last statement, `statement_balance`, against the pesos the books carry, `book_balance`). The entry comes in `manual_entry` (`mje_…`); in a closed month it answers `period_closed`.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/fx_revaluations/2026-10 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "rates": { "USD": 18.2915 } }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const fxRevaluation = await fiscalisto.fxRevaluations.create("2026-10", { rates: { USD: 18.2915 } });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

fx_revaluation = fiscalisto.fx_revaluations.create("2026-10", {"rates": {"USD": 18.2915}})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$fxRevaluation = $fiscalisto->fxRevaluations->create('2026-10', ['rates' => ['USD' => 18.2915]]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	fxRevaluation, err := client.FxRevaluations.Create(ctx, "2026-10", &fiscalisto.CreateFxRevaluationParams{
		Rates: map[string]any{"USD": 18.2915},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *fxRevaluation)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.CreateFxRevaluationParams;
import java.util.Map;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var fxRevaluation = fiscalisto.fxRevaluations().create("2026-10", new CreateFxRevaluationParams().setRates(Map.of("USD", 18.2915)));
System.out.println(fxRevaluation);
```

```csharp tab="C#"
using System.Text.Json;
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var fxRevaluation = await fiscalisto.FxRevaluations.CreateAsync("2026-10", new CreateFxRevaluationParams
{
    Rates = JsonDocument.Parse("{\"USD\":18.2915}").RootElement,
});
```

## Cost of sales

With the periodic inventory system, `GET /v1/accounting/cost_of_sales/{month}` gives the month's purchases per account (`purchases`, código agrupador 502), their returns and discounts (`purchase_returns`, 503), `net_purchases`, the inventory in the books (`book_inventory`) and `suggested_ending_inventory`, what the stock is worth at the month's end according to Inventario (null if you don't keep it in Fiscalisto). `POST` with `ending_inventory` records the entry on the month's last day: Inventario is left at that value, the purchases are cleared and the difference goes to Costo de ventas (501.01), the cost of goods sold that is deducted. Sending it again replaces it; `DELETE` removes it.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/cost_of_sales/2026-10 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "ending_inventory": 398750.5 }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const costOfSales = await fiscalisto.costOfSales.create("2026-10", { ending_inventory: 398750.5 });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

cost_of_sales = fiscalisto.cost_of_sales.create("2026-10", {"ending_inventory": 398750.5})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$costOfSales = $fiscalisto->costOfSales->create('2026-10', ['ending_inventory' => 398750.5]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	costOfSales, err := client.CostOfSales.Create(ctx, "2026-10", &fiscalisto.CreateCostOfSalesParams{
		EndingInventory: 398750.5,
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *costOfSales)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.CreateCostOfSalesParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var costOfSales = fiscalisto.costOfSales().create("2026-10", new CreateCostOfSalesParams().setEndingInventory(398750.5));
System.out.println(costOfSales);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var costOfSales = await fiscalisto.CostOfSales.CreateAsync("2026-10", new CreateCostOfSalesParams { EndingInventory = 398750.5m });
```

## Employer payroll contributions

`GET /v1/accounting/payroll_provisions/{month}` gives what the company owes IMSS (`imss`), SAR (`sar`: retiro and cesantía y vejez) and Infonavit (`infonavit`) for the month's days, calculated from its stamped payroll receipts, and the month's payroll tax (`payroll_tax`, as [`GET /v1/payroll_taxes`](https://fiscalisto.com/en/docs/api/nomina#payroll-tax)). `employees` carries each employee's calculation: their salario base de cotización and the days of each branch (absences only count in enfermedades y maternidad; disability days only in retiro and Infonavit). `POST` records the provision on the month's last day, each expense against its payable account; `employer_risk_premium` is the risk premium from your annual determination (kept for the following months) and `imss`, `sar`, `infonavit` and `payroll_tax` replace the calculated ones, for example with the SUA's. Sending it again replaces it; `DELETE` removes it. It's calculated with the 2026 rates.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/payroll_provisions/2026-03 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "employer_risk_premium": 0.0054355 }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const payrollProvision = await fiscalisto.payrollProvisions.create("2026-03", { employer_risk_premium: 0.0054355 });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

payroll_provision = fiscalisto.payroll_provisions.create("2026-03", {"employer_risk_premium": 0.0054355})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$payrollProvision = $fiscalisto->payrollProvisions->create('2026-03', ['employer_risk_premium' => 0.0054355]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	payrollProvision, err := client.PayrollProvisions.Create(ctx, "2026-03", &fiscalisto.CreatePayrollProvisionParams{
		EmployerRiskPremium: fiscalisto.Float64(0.0054355),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *payrollProvision)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.CreatePayrollProvisionParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var payrollProvision = fiscalisto.payrollProvisions().create("2026-03", new CreatePayrollProvisionParams().setEmployerRiskPremium(0.0054355));
System.out.println(payrollProvision);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var payrollProvision = await fiscalisto.PayrollProvisions.CreateAsync("2026-03", new CreatePayrollProvisionParams
{
    EmployerRiskPremium = 0.0054355m,
});
```

### Compare with the SUA

`POST /v1/accounting/payroll_provisions/{month}/sua_comparison` reads the cédula de determinación de cuotas the SUA printed for the month (the monthly IMSS one), as a PDF in base64 in `file`, and compares it worker by worker, by NSS, with the calculation: `workers` carries what the SUA says (`sua`) and what Fiscalisto calculated (`calculated`), with the enfermedades y maternidad and invalidez y vida days, the salario base de cotización and the quotas, and `differs` says what differs (`days`, `sbc`, `amount` when it's over one peso, or `missing` when the worker is in only one of the two). It's calculated at the cédula's risk premium (`employer_risk_premium`). Nothing is saved: if the SUA is right, send `totals.sua` as `imss` and its premium to the `POST` above. A cédula of another month answers an empty `workers` with `cedula_month`; a PDF without text, `unreadable: true`.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/payroll_provisions/2026-03/sua_comparison \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"file\": \"$(base64 -w0 cedula-marzo.pdf)\" }"
```

## Tax determination

Each month, `GET /v1/accounting/tax_determinations/{month}` gives the month's IVA from its journal entries: `vat_collected` (trasladado cobrado), `vat_creditable` (acreditable pagado, plus the IVA you withheld from suppliers last month and already paid to SAT, LIVA art. 5 fr. IV), `vat_withheld_by_customers` and `vat`, positive to pay or negative in your favor. The IEPS works the same: `ieps_collected` (trasladado cobrado; a PPD invoice's with each payment, LIEPS arts. 5 and 5-C), `ieps_creditable` (what your suppliers charged you and you already paid, if you credit it, art. 4) and `ieps`. It also gives `suggested_isr`, the provisional payment Impuestos calculates. `POST` with `isr` records the determination entry on the month's last day: the IVA to IVA por pagar or IVA a favor, the IEPS to IEPS por pagar or IEPS a favor, and the ISR to Pagos provisionales de ISR against ISR por pagar. Sending it again replaces it; `DELETE` removes it. When you pay, record the bank withdrawal against those accounts with [`POST /v1/accounting/bank_movements/{id}/post`](#bank-movements-without-an-invoice). A PPD invoice's withholdings reach their accounts with each payment, not with the invoice.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/tax_determinations/2026-10 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "isr": 12380 }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const taxDetermination = await fiscalisto.taxDeterminations.create("2026-10", { isr: 12380 });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

tax_determination = fiscalisto.tax_determinations.create("2026-10", {"isr": 12380})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$taxDetermination = $fiscalisto->taxDeterminations->create('2026-10', ['isr' => 12380]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	taxDetermination, err := client.TaxDeterminations.Create(ctx, "2026-10", &fiscalisto.CreateTaxDeterminationParams{ISR: 12380})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *taxDetermination)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.CreateTaxDeterminationParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var taxDetermination = fiscalisto.taxDeterminations().create("2026-10", new CreateTaxDeterminationParams().setIsr(12380));
System.out.println(taxDetermination);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var taxDetermination = await fiscalisto.TaxDeterminations.CreateAsync("2026-10", new CreateTaxDeterminationParams { Isr = 12380 });
```

## Bringing the books from another system

To move the books from CONTPAQi, COI or another system to Fiscalisto, first add the accounts of its chart that are missing with `POST /v1/accounting/accounts`. Then save the opening balances with `POST /v1/accounting/opening_balances`: `date` is the 1st of the month your books start in, and each line has the account by its number and its final debit (`debit`) or credit (`credit`) balance from the previous system's trial balance. Both columns add up to the same, or it answers `entry_unbalanced`. It replaces any there were, and with no lines it deletes them. `GET /v1/accounting/opening_balances` returns them.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/opening_balances \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2026-01-01",
    "lines": [
      { "account": "102-01", "debit": 150000 },
      { "account": "301-01", "credit": 150000 }
    ]
  }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const openingBalances = await fiscalisto.openingBalances.set({
  date: "2026-01-01",
  lines: [
    { account: "102-01", debit: 150000 },
    { account: "301-01", credit: 150000 },
  ],
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

opening_balances = fiscalisto.opening_balances.set({
    "date": "2026-01-01",
    "lines": [
        {"account": "102-01", "debit": 150000},
        {"account": "301-01", "credit": 150000},
    ],
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$openingBalances = $fiscalisto->openingBalances->set([
    'date' => '2026-01-01',
    'lines' => [
        [
            'account' => '102-01',
            'debit' => 150000,
        ],
        [
            'account' => '301-01',
            'credit' => 150000,
        ],
    ],
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	openingBalances, err := client.OpeningBalances.Set(ctx, &fiscalisto.SetOpeningBalancesParams{
		Date: "2026-01-01",
		Lines: []fiscalisto.SetOpeningBalancesParamsLine{
			{Account: "102-01", Debit: fiscalisto.Float64(150000)},
			{Account: "301-01", Credit: fiscalisto.Float64(150000)},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *openingBalances)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.SetOpeningBalancesParams;
import com.fiscalisto.model.SetOpeningBalancesParamsLine;
import java.util.List;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var openingBalances = fiscalisto.openingBalances().set(new SetOpeningBalancesParams()
        .setDate("2026-01-01")
        .setLines(List.of(
                new SetOpeningBalancesParamsLine()
                        .setAccount("102-01")
                        .setDebit(150000),
                new SetOpeningBalancesParamsLine()
                        .setAccount("301-01")
                        .setCredit(150000)
        )));
System.out.println(openingBalances);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var openingBalances = await fiscalisto.OpeningBalances.SetAsync(new SetOpeningBalancesParams
{
    Date = "2026-01-01",
    Lines = new()
    {
        new() { Account = "102-01", Debit = 150000 },
        new() { Account = "301-01", Credit = 150000 },
    },
});
```

Then import your journal entries with `POST /v1/accounting/manual_entry_imports`: up to 3,000 in `entries`, each as in `POST /v1/accounting/manual_entries` and with its `number` from the other system. All go in or none do, and the error says which one (`param` `entries[i].…`). One with the same `number`, date, type and total as one already imported is skipped and counted in `duplicates`, so you can send the same file again. The response has the import's id (`mji_…`): `DELETE /v1/accounting/manual_entry_imports/{id}` deletes all its entries. Import only the entries that don't come from a CFDI already in Fiscalisto, so they aren't counted twice.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/manual_entry_imports \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "entries": [
      {
        "date": "2026-01-05",
        "journal_type": "expense",
        "number": "Eg 1",
        "description": "Pago de renta de enero",
        "lines": [
          { "account": "205-06", "debit": 11600 },
          { "account": "102-01", "credit": 11600 }
        ]
      }
    ]
  }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const manualEntryImport = await fiscalisto.manualEntries.importEntries({
  entries: [
    {
      date: "2026-01-05",
      journal_type: "expense",
      number: "Eg 1",
      description: "Pago de renta de enero",
      lines: [
        { account: "205-06", debit: 11600 },
        { account: "102-01", credit: 11600 },
      ],
    },
  ],
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

manual_entry_import = fiscalisto.manual_entries.import_entries({
    "entries": [
        {
            "date": "2026-01-05",
            "journal_type": "expense",
            "number": "Eg 1",
            "description": "Pago de renta de enero",
            "lines": [
                {
                    "account": "205-06",
                    "debit": 11600,
                },
                {
                    "account": "102-01",
                    "credit": 11600,
                },
            ],
        },
    ],
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$manualEntryImport = $fiscalisto->manualEntries->importEntries([
    'entries' => [
        [
            'date' => '2026-01-05',
            'journal_type' => 'expense',
            'number' => 'Eg 1',
            'description' => 'Pago de renta de enero',
            'lines' => [
                [
                    'account' => '205-06',
                    'debit' => 11600,
                ],
                [
                    'account' => '102-01',
                    'credit' => 11600,
                ],
            ],
        ],
    ],
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	manualEntryImport, err := client.ManualEntries.ImportEntries(ctx, &fiscalisto.ImportManualEntriesParams{
		Entries: []fiscalisto.ImportManualEntriesParamsEntry{
			{
				Date:        "2026-01-05",
				JournalType: fiscalisto.String("expense"),
				Number:      fiscalisto.String("Eg 1"),
				Description: "Pago de renta de enero",
				Lines: []fiscalisto.ImportManualEntriesParamsEntryLine{
					{Account: "205-06", Debit: fiscalisto.Float64(11600)},
					{Account: "102-01", Credit: fiscalisto.Float64(11600)},
				},
			},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(manualEntryImport.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.ImportManualEntriesParams;
import com.fiscalisto.model.ImportManualEntriesParamsEntry;
import com.fiscalisto.model.ImportManualEntriesParamsEntryLine;
import java.util.List;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var manualEntryImport = fiscalisto.manualEntries().importEntries(new ImportManualEntriesParams()
        .setEntries(List.of(
                new ImportManualEntriesParamsEntry()
                        .setDate("2026-01-05")
                        .setJournalType("expense")
                        .setNumber("Eg 1")
                        .setDescription("Pago de renta de enero")
                        .setLines(List.of(
                                new ImportManualEntriesParamsEntryLine()
                                        .setAccount("205-06")
                                        .setDebit(11600),
                                new ImportManualEntriesParamsEntryLine()
                                        .setAccount("102-01")
                                        .setCredit(11600)
                        ))
        )));
System.out.println(manualEntryImport.getId());
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var manualEntryImport = await fiscalisto.ManualEntries.ImportEntriesAsync(new ImportManualEntriesParams
{
    Entries = new()
    {
        new()
        {
            Date = "2026-01-05",
            JournalType = "expense",
            Number = "Eg 1",
            Description = "Pago de renta de enero",
            Lines = new()
            {
                new() { Account = "205-06", Debit = 11600 },
                new() { Account = "102-01", Credit = 11600 },
            },
        },
    },
});
```

## Trial balance and chart

`GET /v1/accounting/trial_balance?month=2026-10` gives each account's opening balance, debits, credits and closing balance. Opening balances accumulate from the first CFDI, or from the opening balances you enter in the app's **Estados financieros** (income statement accounts, from January), and each previous year's results are closed to equity, so debits and credits always add up the same.

`GET /v1/accounting/chart_templates` lists the industry charts (commerce, restaurant, construction, professional services, manufacturing, transport, real estate rental, agriculture) with the accounts each would add, and `POST /v1/accounting/chart_templates/{id}/apply` adds the missing ones to your chart, like **Agregar cuentas de su giro** in the app. A grouping code that already has an account keeps it, so you can call it again without duplicates.

`POST /v1/accounting/account_renumberings` renumbers the whole chart at once, like **Renumerar catálogo**: with `separator` and `widths` (each level's digits, padded with zeros: `[4, 3]` turns 601-48 into 0601-048) or with `mapping`, each account's new number. Journal entries, opening balances and budgets stay on the same accounts. Send `dry_run: true` first to see what changes; if any account can't take its number (a level that doesn't fit, a main account's number, two accounts on one) none changes and it answers `parameter_invalid`. To undo it, send each new number with the old one in `mapping`.

## General ledger

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/general_ledger?from_month=2026-01&to_month=2026-10&account=102-01" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const generalLedger = await fiscalisto.accounting.generalLedger({
  from_month: "2026-01",
  to_month: "2026-10",
  account: "102-01",
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

general_ledger = fiscalisto.accounting.general_ledger({
    "from_month": "2026-01",
    "to_month": "2026-10",
    "account": "102-01",
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$generalLedger = $fiscalisto->accounting->generalLedger([
    'from_month' => '2026-01',
    'to_month' => '2026-10',
    'account' => '102-01',
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from 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",
		ToMonth:   fiscalisto.String("2026-10"),
		Account:   fiscalisto.String("102-01"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *generalLedger)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetGeneralLedgerParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

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

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

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

The general ledger of up to 12 months: each account's opening balance, each debit and credit with its journal entry (`journal_entry`, the same id as in `journal_entries`), its `uuid` and the `balance` it leaves, and the closing balance. Without `account` it brings every account that moved; with it, only that one even if it has no movements. `grouping_code` limits it to the accounts of one SAT grouping code (`102` brings `102.01`, `102.02`…): it's what a line of the financial statements opens. An account that isn't in the chart answers `account_missing`. In the app it's the **Auxiliar** tab of **Estados financieros**.

## Financial statements

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/financial_statements?month=2026-10" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const financialStatements = await fiscalisto.accounting.financialStatements({ month: "2026-10" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

financial_statements = fiscalisto.accounting.financial_statements({"month": "2026-10"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$financialStatements = $fiscalisto->accounting->financialStatements(['month' => '2026-10']);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	financialStatements, err := client.Accounting.FinancialStatements(ctx, &fiscalisto.GetFinancialStatementsParams{Month: "2026-10"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *financialStatements)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetFinancialStatementsParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var financialStatements = fiscalisto.accounting().financialStatements(new GetFinancialStatementsParams().setMonth("2026-10"));
System.out.println(financialStatements);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var financialStatements = await fiscalisto.Accounting.FinancialStatementsAsync(new GetFinancialStatementsParams { Month = "2026-10" });
```

The income statement for the month and the year to that month (`income_statement`), and the balance sheet at month end (`balance_sheet`), read from the same trial balance. Each income statement section (`ingresos`, `costos`, `gastos`, `financiamiento`, `otros`) adds as positive what increases profit and as negative what reduces it, and is grouped by the first level of the grouping code with its accounts. On the balance sheet, `difference` is assets minus liabilities and equity: 0 when the books balance. `missing_invoices` counts payments of invoices that aren't in Fiscalisto and weren't recorded.

## Budgets

`POST /v1/accounting/budgets/{year}` saves the year's budget: each results account (grouping codes 4 to 7) with its 12 months in `months`, January to December, in the account's nature (income as income, an expense as expense). It replaces the whole budget of that year; an empty list deletes it. With `cost_center` (`ccn_…`) it's that cost center's budget, apart from the whole company's. `GET /v1/accounting/budgets/{year}` returns it with `comparison`: the budget against the actual from your journal entries for the month (`month`, the current one by default) and January through it, with `variance`, `variance_percent` and `favorable` (the actual leaves at least the budgeted profit).

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/budgets/2026 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "lines": [{ "account": "601-84", "months": [40000, 40000, 40000, 40000, 40000, 40000, 40000, 40000, 40000, 40000, 40000, 40000] }] }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const budget = await fiscalisto.budgets.save("2026", {
  lines: [
    {
      account: "601-84",
      months: [
        40000,
        40000,
        40000,
        40000,
        40000,
        40000,
        40000,
        40000,
        40000,
        40000,
        40000,
        40000,
      ],
    },
  ],
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

budget = fiscalisto.budgets.save("2026", {
    "lines": [
        {
            "account": "601-84",
            "months": [
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
            ],
        },
    ],
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$budget = $fiscalisto->budgets->save('2026', [
    'lines' => [
        [
            'account' => '601-84',
            'months' => [
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
            ],
        ],
    ],
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	budget, err := client.Budgets.Save(ctx, "2026", &fiscalisto.SaveBudgetParams{
		Lines: []fiscalisto.SaveBudgetParamsLine{
			{
				Account: "601-84",
				Months: []float64{
					40000,
					40000,
					40000,
					40000,
					40000,
					40000,
					40000,
					40000,
					40000,
					40000,
					40000,
					40000,
				},
			},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *budget)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.SaveBudgetParams;
import com.fiscalisto.model.SaveBudgetParamsLine;
import java.math.BigDecimal;
import java.util.List;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var budget = fiscalisto.budgets().save("2026", new SaveBudgetParams()
        .setLines(List.of(
                new SaveBudgetParamsLine()
                        .setAccount("601-84")
                        .setMonths(List.of(
                                new BigDecimal("40000"),
                                new BigDecimal("40000"),
                                new BigDecimal("40000"),
                                new BigDecimal("40000"),
                                new BigDecimal("40000"),
                                new BigDecimal("40000"),
                                new BigDecimal("40000"),
                                new BigDecimal("40000"),
                                new BigDecimal("40000"),
                                new BigDecimal("40000"),
                                new BigDecimal("40000"),
                                new BigDecimal("40000")
                        ))
        )));
System.out.println(budget);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var budget = await fiscalisto.Budgets.SaveAsync("2026", new SaveBudgetParams
{
    Lines = new()
    {
        new()
        {
            Account = "601-84",
            Months = new()
            {
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
                40000,
            },
        },
    },
});
```

## Results by cost center

`GET /v1/accounting/cost_center_results/{month}` returns the income statement of each cost center for the month (`month_results`) and January through it (`year_to_date`): revenue, cost of sales, expenses, financing, other, income before taxes and the margin. Each invoice counts in the cost center it was given ([`POST /v1/cost_centers/{id}/invoices`](https://fiscalisto.com/en/docs/api/centros-de-costo)) and each manual journal entry in each line's `cost_center` ([`POST /v1/accounting/manual_entries`](#manual-journal-entries)). What has none goes with `cost_center: null`; together they add up to the company's income statement.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/cost_center_results/2026-03 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const costCenterResults = await fiscalisto.costCenterResults.get("2026-03");
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

cost_center_results = fiscalisto.cost_center_results.get("2026-03")
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$costCenterResults = $fiscalisto->costCenterResults->get('2026-03');
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	costCenterResults, err := client.CostCenterResults.Get(ctx, "2026-03", nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *costCenterResults)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var costCenterResults = fiscalisto.costCenterResults().get("2026-03");
System.out.println(costCenterResults);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var costCenterResults = await fiscalisto.CostCenterResults.GetAsync("2026-03");
```

## Cash flow

`GET /v1/accounting/cash_flow?month=YYYY-MM` returns the statement of cash flows (NIF B-2, indirect method) from January through the month, or for the month alone with `period=month`. `operating` starts from income before taxes (`net_income`), adds back what wasn't a cash outflow (`non_cash`: depreciation 171, impairment 172, amortization 183) and adjusts for the change in working capital (`working_capital`: receivables, inventory, payables, taxes). `investing` is fixed assets, land and deferred assets; `financing`, bank loans (202.01 to 202.12, 251, 252), dividends and equity. Each account goes to its activity by its SAT grouping code. `net_change` takes `cash_beginning` to `cash_end` (cash, banks and short-term investments, 101 to 103); `difference` is 0 when the trial balance adds up.

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/cash_flow?month=2026-02" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const cashFlow = await fiscalisto.accounting.cashFlow({ month: "2026-02" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

cash_flow = fiscalisto.accounting.cash_flow({"month": "2026-02"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$cashFlow = $fiscalisto->accounting->cashFlow(['month' => '2026-02']);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	cashFlow, err := client.Accounting.CashFlow(ctx, &fiscalisto.GetCashFlowParams{Month: "2026-02"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *cashFlow)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetCashFlowParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var cashFlow = fiscalisto.accounting().cashFlow(new GetCashFlowParams().setMonth("2026-02"));
System.out.println(cashFlow);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var cashFlow = await fiscalisto.Accounting.CashFlowAsync(new GetCashFlowParams { Month = "2026-02" });
```

## Changes in equity

`GET /v1/accounting/equity_changes?month=YYYY-MM` returns the statement of changes in equity (NIF B-4) from January through the month: each equity account (`accounts`, by grouping code) with its balance on January 1 (`beginning`), its contributions, withdrawals, dividends and transfers (`movements`) and its closing balance (`ending`), and the year's result (`net_income`). `ending` is the balance sheet's equity plus the year's result.

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/equity_changes?month=2026-02" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const equityChanges = await fiscalisto.accounting.equityChanges({ month: "2026-02" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

equity_changes = fiscalisto.accounting.equity_changes({"month": "2026-02"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$equityChanges = $fiscalisto->accounting->equityChanges(['month' => '2026-02']);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	equityChanges, err := client.Accounting.EquityChanges(ctx, &fiscalisto.GetEquityChangesParams{Month: "2026-02"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *equityChanges)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetEquityChangesParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var equityChanges = fiscalisto.accounting().equityChanges(new GetEquityChangesParams().setMonth("2026-02"));
System.out.println(equityChanges);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var equityChanges = await fiscalisto.Accounting.EquityChangesAsync(new GetEquityChangesParams { Month = "2026-02" });
```

## Comparative statements

`GET /v1/accounting/comparative_statements?month=YYYY-MM` puts the income statement (for the month and January through it) and the balance sheet next to those of the same month a year before (`compare_to=previous_year`, the default) or the month before (`compare_to=previous_month`). Each group of accounts has `current`, `previous`, `change` and `change_percent` (null when `previous` is 0). Costs and expenses are positive: a positive `change` is more expense. Equity includes the year's result as 305, so assets = liabilities + equity in both columns.

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/comparative_statements?month=2026-02&compare_to=previous_month" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const comparativeStatements = await fiscalisto.accounting.comparativeStatements({
  month: "2026-02",
  compare_to: "previous_month",
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

comparative_statements = fiscalisto.accounting.comparative_statements({
    "month": "2026-02",
    "compare_to": "previous_month",
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$comparativeStatements = $fiscalisto->accounting->comparativeStatements([
    'month' => '2026-02',
    'compare_to' => 'previous_month',
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	comparativeStatements, err := client.Accounting.ComparativeStatements(ctx, &fiscalisto.GetComparativeStatementsParams{
		Month:     "2026-02",
		CompareTo: fiscalisto.String("previous_month"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *comparativeStatements)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetComparativeStatementsParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var comparativeStatements = fiscalisto.accounting().comparativeStatements(new GetComparativeStatementsParams()
        .setMonth("2026-02")
        .setCompareTo("previous_month"));
System.out.println(comparativeStatements);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var comparativeStatements = await fiscalisto.Accounting.ComparativeStatementsAsync(new GetComparativeStatementsParams
{
    Month = "2026-02",
    CompareTo = "previous_month",
});
```

## Financial ratios

`GET /v1/accounting/financial_ratios?month=YYYY-MM` returns, at the close of the month, the current ratio, quick ratio, debt ratio, leverage, margins (gross, operating and before taxes), return on equity and on assets, and days sales outstanding, days payable and days of inventory. Each has its `value` (null when there's nothing to divide by), its `unit` (`times`, `percent` or `days`) and how it's worked out; `inputs` are the figures it comes from. Profitability and turnover use January through the month and the days elapsed in the year.

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/financial_ratios?month=2026-02" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const financialRatios = await fiscalisto.accounting.financialRatios({ month: "2026-02" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

financial_ratios = fiscalisto.accounting.financial_ratios({"month": "2026-02"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$financialRatios = $fiscalisto->accounting->financialRatios(['month' => '2026-02']);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	financialRatios, err := client.Accounting.FinancialRatios(ctx, &fiscalisto.GetFinancialRatiosParams{Month: "2026-02"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *financialRatios)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetFinancialRatiosParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var financialRatios = fiscalisto.accounting().financialRatios(new GetFinancialRatiosParams().setMonth("2026-02"));
System.out.println(financialRatios);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var financialRatios = await fiscalisto.Accounting.FinancialRatiosAsync(new GetFinancialRatiosParams { Month = "2026-02" });
```

## Books log

`GET /v1/accounting/books_log` lists every change to the issuer's RFC's books, newest first: manual journal entries (including those from the month close, the FX revaluation and the banks), opening balances, accounts and the chart of accounts (which the workspace's RFCs share), closing and reopening a month, consolidation eliminations, entry templates and fixed asset disposals. Each `books_log_entry` (`ble_…`) says what changed (`subject`, and `subject_id` when it has an API id), the move (`action`: `created`, `updated`, `deleted`, `restored`, `imported`, `closed` or `reopened`), who made it (`actor`: a user, an API key with its name in `label`, or an assistant through MCP) and what it was before and after (`before` and `after`, with the log's own field names). Filter with `subject`, `from` and `to` (Mexico City days) and page with `limit` and `starting_after`. Nobody can change or delete it, and saving something unchanged leaves no entry.

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/books_log?subject=manual_journal_entry&limit=20" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

for await (const item of fiscalisto.booksLog.list({ subject: "manual_journal_entry", limit: 20 })) {
  console.log(item.id);
}
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

for item in fiscalisto.books_log.list({"subject": "manual_journal_entry", "limit": 20}):
    print(item["id"])
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

foreach ($fiscalisto->booksLog->list([
    'subject' => 'manual_journal_entry',
    'limit' => 20,
]) as $item) {
    echo $item['id'], "\n";
}
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	for item, err := range client.BooksLog.ListAutoPaging(ctx, &fiscalisto.ListBooksLogParams{
		Subject: fiscalisto.String("manual_journal_entry"),
		Limit:   fiscalisto.Int64(20),
	}) {
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(item.ID)
	}
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.ListBooksLogParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

for (var item : fiscalisto.booksLog().listAutoPaging(new ListBooksLogParams()
        .setSubject("manual_journal_entry")
        .setLimit(20))) {
    System.out.println(item.getId());
}
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

await foreach (var item in fiscalisto.BooksLog.ListAutoPagingAsync(new ListBooksLogParams
{
    Subject = "manual_journal_entry",
    Limit = 20,
}))
    Console.WriteLine(item.Id);
```

## Consolidated statements

`GET /v1/accounting/consolidated_statements?rfcs=RFC1,RFC2&month=YYYY-MM` adds up, account by account, the trial balance of several RFCs in the issuer's workspace (they share the chart of accounts) and takes off the month's eliminations: it returns the consolidated income statement (`income_statement`) and balance sheet (`balance_sheet`), as `financial_statements` does; the consolidation worksheet (`worksheet`: each account's closing balance in each RFC in `by_rfc`, what the `eliminations` add or take off, and its consolidated `balance`); the eliminations applied; and what the RFCs invoiced each other before taxes in the month and the year (`intercompany`), which is what's usually eliminated. Each RFC's own books don't change. An issuer with a single RFC gets `parameter_invalid` on `rfcs`.

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/consolidated_statements?rfcs=EKU9003173C9,ICV060329BY0&month=2026-10" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const consolidatedStatements = await fiscalisto.accounting.consolidatedStatements({
  rfcs: "EKU9003173C9,ICV060329BY0",
  month: "2026-10",
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

consolidated_statements = fiscalisto.accounting.consolidated_statements({
    "rfcs": "EKU9003173C9,ICV060329BY0",
    "month": "2026-10",
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$consolidatedStatements = $fiscalisto->accounting->consolidatedStatements([
    'rfcs' => 'EKU9003173C9,ICV060329BY0',
    'month' => '2026-10',
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	consolidatedStatements, err := client.Accounting.ConsolidatedStatements(ctx, &fiscalisto.GetConsolidatedStatementsParams{
		Rfcs:  "EKU9003173C9,ICV060329BY0",
		Month: "2026-10",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *consolidatedStatements)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetConsolidatedStatementsParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var consolidatedStatements = fiscalisto.accounting().consolidatedStatements(new GetConsolidatedStatementsParams()
        .setRfcs("EKU9003173C9,ICV060329BY0")
        .setMonth("2026-10"));
System.out.println(consolidatedStatements);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var consolidatedStatements = await fiscalisto.Accounting.ConsolidatedStatementsAsync(new GetConsolidatedStatementsParams
{
    Rfcs = "EKU9003173C9,ICV060329BY0",
    Month = "2026-10",
});
```

An elimination (`cel_…`) belongs to the month at whose close it eliminates and to the RFCs it's between: it applies when all of them are in the consolidation. Its lines go on accounts of your chart and the debits add up to the credits. Each month carries its eliminations complete as of that date (the sales between them from January to that month and the balances between them at its close), as a consolidation worksheet does: a month without its own takes nothing off. `GET /v1/accounting/consolidation_eliminations?month=YYYY-MM` lists them, `POST /v1/accounting/consolidation_eliminations/{id}` replaces one and `DELETE` deletes it.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/consolidation_eliminations \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "month": "2026-10",
    "description": "Ventas entre empresas del grupo",
    "rfcs": ["EKU9003173C9", "ICV060329BY0"],
    "lines": [
      { "account": "401-01", "debit": 10000 },
      { "account": "601-84", "credit": 10000 }
    ]
  }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const consolidationElimination = await fiscalisto.consolidationEliminations.create({
  month: "2026-10",
  description: "Ventas entre empresas del grupo",
  rfcs: ["EKU9003173C9", "ICV060329BY0"],
  lines: [
    { account: "401-01", debit: 10000 },
    { account: "601-84", credit: 10000 },
  ],
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

consolidation_elimination = fiscalisto.consolidation_eliminations.create({
    "month": "2026-10",
    "description": "Ventas entre empresas del grupo",
    "rfcs": ["EKU9003173C9", "ICV060329BY0"],
    "lines": [
        {"account": "401-01", "debit": 10000},
        {"account": "601-84", "credit": 10000},
    ],
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$consolidationElimination = $fiscalisto->consolidationEliminations->create([
    'month' => '2026-10',
    'description' => 'Ventas entre empresas del grupo',
    'rfcs' => ['EKU9003173C9', 'ICV060329BY0'],
    'lines' => [
        [
            'account' => '401-01',
            'debit' => 10000,
        ],
        [
            'account' => '601-84',
            'credit' => 10000,
        ],
    ],
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	consolidationElimination, err := client.ConsolidationEliminations.Create(ctx, &fiscalisto.CreateConsolidationEliminationParams{
		Month:       "2026-10",
		Description: "Ventas entre empresas del grupo",
		Rfcs:        []string{"EKU9003173C9", "ICV060329BY0"},
		Lines: []fiscalisto.CreateConsolidationEliminationParamsLine{
			{Account: "401-01", Debit: fiscalisto.Float64(10000)},
			{Account: "601-84", Credit: fiscalisto.Float64(10000)},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(consolidationElimination.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.CreateConsolidationEliminationParams;
import com.fiscalisto.model.CreateConsolidationEliminationParamsLine;
import java.util.List;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var consolidationElimination = fiscalisto.consolidationEliminations().create(new CreateConsolidationEliminationParams()
        .setMonth("2026-10")
        .setDescription("Ventas entre empresas del grupo")
        .setRfcs(List.of("EKU9003173C9", "ICV060329BY0"))
        .setLines(List.of(
                new CreateConsolidationEliminationParamsLine()
                        .setAccount("401-01")
                        .setDebit(10000),
                new CreateConsolidationEliminationParamsLine()
                        .setAccount("601-84")
                        .setCredit(10000)
        )));
System.out.println(consolidationElimination.getId());
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var consolidationElimination = await fiscalisto.ConsolidationEliminations.CreateAsync(new CreateConsolidationEliminationParams
{
    Month = "2026-10",
    Description = "Ventas entre empresas del grupo",
    Rfcs = new() { "EKU9003173C9", "ICV060329BY0" },
    Lines = new()
    {
        new() { Account = "401-01", Debit = 10000 },
        new() { Account = "601-84", Credit = 10000 },
    },
});
```

## Annual inflation adjustment

`GET /v1/accounting/inflation_adjustments/{year}` works out a persona moral's ajuste anual por inflación (article 44 of the Ley del ISR): the sum of the month-end balances of its credits (`average_credits`) and of its debts (`average_debts`) divided by the months of the fiscal year, and the difference times the annual adjustment `factor` (December's INPC over the December before, less 1, to the ten-thousandth). `type` is `taxable` (acumulable) when debts are larger and `deductible` when credits are; `amount` is the adjustment. In the current year it's an estimate through the current month (`estimated`). With `from_month`, a fiscal year that started during the year. Each account in `accounts` has its `treatment` (`credit`, `debt` or `none`), the law's reason (`reason`) and its month-end balances.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/inflation_adjustments/2025 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const inflationAdjustment = await fiscalisto.inflationAdjustments.get("2025");
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

inflation_adjustment = fiscalisto.inflation_adjustments.get("2025")
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$inflationAdjustment = $fiscalisto->inflationAdjustments->get('2025');
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	inflationAdjustment, err := client.InflationAdjustments.Get(ctx, "2025", nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *inflationAdjustment)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var inflationAdjustment = fiscalisto.inflationAdjustments().get("2025");
System.out.println(inflationAdjustment);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var inflationAdjustment = await fiscalisto.InflationAdjustments.GetAsync("2025");
```

Each account counts by its grouping code. `POST /v1/accounting/inflation_accounts` changes the ones your accountant treats differently, for example a loan to a shareholder that is a company; `treatment: null` takes it back to its grouping code's.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/inflation_accounts \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"accounts":[{"account":"107-02","treatment":"credit"}]}'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const inflationAccounts = await fiscalisto.inflationAccounts.save({
  accounts: [{ account: "107-02", treatment: "credit" }],
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

inflation_accounts = fiscalisto.inflation_accounts.save({
    "accounts": [
        {
            "account": "107-02",
            "treatment": "credit",
        },
    ],
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$inflationAccounts = $fiscalisto->inflationAccounts->save([
    'accounts' => [
        [
            'account' => '107-02',
            'treatment' => 'credit',
        ],
    ],
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	inflationAccounts, err := client.InflationAccounts.Save(ctx, &fiscalisto.SaveInflationAccountsParams{
		Accounts: []fiscalisto.SaveInflationAccountsParamsAccount{
			{
				Account:   "107-02",
				Treatment: fiscalisto.String("credit"),
			},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *inflationAccounts)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.SaveInflationAccountsParams;
import com.fiscalisto.model.SaveInflationAccountsParamsAccount;
import java.util.List;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var inflationAccounts = fiscalisto.inflationAccounts().save(new SaveInflationAccountsParams()
        .setAccounts(List.of(
                new SaveInflationAccountsParamsAccount()
                        .setAccount("107-02")
                        .setTreatment("credit")
        )));
System.out.println(inflationAccounts);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var inflationAccounts = await fiscalisto.InflationAccounts.SaveAsync(new SaveInflationAccountsParams
{
    Accounts = new()
    {
        new() { Account = "107-02", Treatment = "credit" },
    },
});
```

## Annual return of a legal entity

`GET /v1/accounting/annual_returns/{year}` builds the annual return of a general-regime legal entity (Title II of the Income Tax Law) from its books. It starts from the book profit (`book_profit`) and reconciles it with the law in `items`: income tax and profit sharing booked as expenses, non-deductible expenses from its accounts and its CFDI, exempt payroll that isn't deductible, the annual inflation adjustment and the difference between book depreciation and the tax deduction of investments; each item carries its article (`legal_basis`) and where it comes from (`source`). From that it gives taxable income and authorized deductions, the tax profit or loss after profit sharing paid (article 9), losses from earlier years updated and applied oldest first (`losses`, article 57), from 2027 the limits of articles 78-A to 78-D (`subject_to_78a`, `limit_78b`), the tax result, the year's income tax less provisional payments and withholdings (`balance`: positive to pay, negative in your favor), the profit ratio for next year (`profit_ratio`, article 14), the profit-sharing base (`ptu`) and the net tax profit (`net_tax_profit`, article 77). In the current year it's an estimate through the current month (`estimated`); `through_month` picks another month. It's a working paper for your accountant, not the filed return. An issuer that is an individual, RESICO or a non-profit answers `regime_not_applicable`.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/annual_returns/2025 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const annualReturn = await fiscalisto.annualReturns.get("2025");
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

annual_return = fiscalisto.annual_returns.get("2025")
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$annualReturn = $fiscalisto->annualReturns->get('2025');
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	annualReturn, err := client.AnnualReturns.Get(ctx, "2025", nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *annualReturn)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var annualReturn = fiscalisto.annualReturns().get("2025");
System.out.println(annualReturn);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var annualReturn = await fiscalisto.AnnualReturns.GetAsync("2025");
```

What the books don't say is captured with `POST /v1/accounting/annual_returns/{year}`: pending losses by year with the month they're updated to (`losses`), from 2027 the deductions pending under article 78-B (`pending_deductions`), reconciliation items such as dividends from Mexican companies (`items`), whether it falls under an article 78-E exception (`exception_78e`) and the first month of the tax year (`from_month`). It replaces what was captured: send the whole list. It answers with the recalculated return.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/accounting/annual_returns/2025 \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"losses":[{"year":2023,"amount":1000,"updated_to":"2023-12"}],"items":[{"concept":"Dividendos de una SA mexicana","type":"non_taxable_income","amount":25000}]}'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const annualReturn = await fiscalisto.annualReturns.save("2025", {
  losses: [
    {
      year: 2023,
      amount: 1000,
      updated_to: "2023-12",
    },
  ],
  items: [
    {
      concept: "Dividendos de una SA mexicana",
      type: "non_taxable_income",
      amount: 25000,
    },
  ],
});
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

annual_return = fiscalisto.annual_returns.save("2025", {
    "losses": [
        {
            "year": 2023,
            "amount": 1000,
            "updated_to": "2023-12",
        },
    ],
    "items": [
        {
            "concept": "Dividendos de una SA mexicana",
            "type": "non_taxable_income",
            "amount": 25000,
        },
    ],
})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$annualReturn = $fiscalisto->annualReturns->save('2025', [
    'losses' => [
        [
            'year' => 2023,
            'amount' => 1000,
            'updated_to' => '2023-12',
        ],
    ],
    'items' => [
        [
            'concept' => 'Dividendos de una SA mexicana',
            'type' => 'non_taxable_income',
            'amount' => 25000,
        ],
    ],
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	annualReturn, err := client.AnnualReturns.Save(ctx, "2025", &fiscalisto.SaveAnnualReturnParams{
		Losses: []fiscalisto.SaveAnnualReturnParamsLoss{
			{Year: 2023, Amount: 1000, UpdatedTo: "2023-12"},
		},
		Items: []fiscalisto.SaveAnnualReturnParamsItem{
			{
				Concept: "Dividendos de una SA mexicana",
				Type:    "non_taxable_income",
				Amount:  25000,
			},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *annualReturn)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.SaveAnnualReturnParams;
import com.fiscalisto.model.SaveAnnualReturnParamsItem;
import com.fiscalisto.model.SaveAnnualReturnParamsLoss;
import java.util.List;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var annualReturn = fiscalisto.annualReturns().save("2025", new SaveAnnualReturnParams()
        .setLosses(List.of(
                new SaveAnnualReturnParamsLoss()
                        .setYear(2023)
                        .setAmount(1000)
                        .setUpdatedTo("2023-12")
        ))
        .setItems(List.of(
                new SaveAnnualReturnParamsItem()
                        .setConcept("Dividendos de una SA mexicana")
                        .setType("non_taxable_income")
                        .setAmount(25000)
        )));
System.out.println(annualReturn);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var annualReturn = await fiscalisto.AnnualReturns.SaveAsync("2025", new SaveAnnualReturnParams
{
    Losses = new()
    {
        new()
        {
            Year = 2023,
            Amount = 1000,
            UpdatedTo = "2023-12",
        },
    },
    Items = new()
    {
        new()
        {
            Concept = "Dividendos de una SA mexicana",
            Type = "non_taxable_income",
            Amount = 25000,
        },
    },
});
```

With `tax_accounts` it also keeps the CUFIN (article 77) and the CUCA (article 78): the balances at the end of the year before (`opening`, with the CUFIN of profits through 2013 separately in `cufin_2013`) and the year's dividends paid or received, capital contributions and reductions (`movements`). Each account is updated with the INPC to the month of each movement. The answer says, for each dividend, how much comes from the CUFIN (`from_cufin`, `from_cufin_2013`), the article 10 income tax on what doesn't (`dividend_tax`, multiplied by 1.4286 at 30%, due by the 17th of the next month, `dividend_tax_due`) and the 10% withheld from an individual (`withholding`, article 140); for a capital reduction, the distributed profit of sections I and II of article 78. That tax is credited against the year's (`dividend_tax_credited`) and lowers the net tax profit divided by 0.4286. `tax_accounts.year_end` gives the balances at December 31 with the year's net tax profit. Without `tax_accounts`, the saved ones stay.

When the year closes, `POST /v1/accounting/annual_returns/{year}/carry_forward` takes the losses left to next year, with this year's updated to the last month of the tax year, from 2027 the 78-B pending deductions, and the CUFIN and CUCA balances at December 31 with the dividend tax still to credit. If next year's provisional payments have no losses in Impuestos, it puts their total there (article 14, section II).

```bash tab="cURL"
curl -X POST https://api.fiscalisto.com/v1/accounting/annual_returns/2025/carry_forward \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const annualReturnCarryForward = await fiscalisto.annualReturns.carryForward("2025");
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

annual_return_carry_forward = fiscalisto.annual_returns.carry_forward("2025")
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$annualReturnCarryForward = $fiscalisto->annualReturns->carryForward('2025');
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	annualReturnCarryForward, err := client.AnnualReturns.CarryForward(ctx, "2025", nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *annualReturnCarryForward)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var annualReturnCarryForward = fiscalisto.annualReturns().carryForward("2025");
System.out.println(annualReturnCarryForward);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var annualReturnCarryForward = await fiscalisto.AnnualReturns.CarryForwardAsync("2025");
```

## Cross-check with what was filed

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/cross_checks?year=2026" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const crossChecks = await fiscalisto.accounting.crossChecks({ year: 2026 });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

cross_checks = fiscalisto.accounting.cross_checks({"year": 2026})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$crossChecks = $fiscalisto->accounting->crossChecks(['year' => 2026]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	crossChecks, err := client.Accounting.CrossChecks(ctx, &fiscalisto.GetCrossChecksParams{
		Year: fiscalisto.Int64(2026),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *crossChecks)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetCrossChecksParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var crossChecks = fiscalisto.accounting().crossChecks(new GetCrossChecksParams().setYear(2026));
System.out.println(crossChecks);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var crossChecks = await fiscalisto.Accounting.CrossChecksAsync(new GetCrossChecksParams { Year = 2026 });
```

Each month of the year whose monthly return is already due (the 17th of the following month) compares what the issuer filed with what its CFDI say: `vat_charged` (transferred IVA), `vat_creditable` (creditable IVA), `vat_withheld` (IVA withheld from it, from its issued invoices and from the withholding certificates it received) and `isr_income` (income for ISR). In months when the issuer withheld, also its withholdings: `isr_withheld_salaries` (ISR on salaries and assimilated against its payroll receipts, by payment date), `isr_withheld_suppliers` (ISR on professional fees and rent against the received invoices it paid) and `vat_withheld_suppliers` (IVA withheld from suppliers). If the month's return doesn't carry a withholding its CFDI do have, `declared` is 0 and the cross-check `differs`. What was filed comes from its [SAT tax returns](https://fiscalisto.com/en/docs/api/declaraciones-del-sat), so request `POST /v1/sat_declarations/refresh` first; this cross-check doesn't query SAT and costs no timbres.

Each cross-check says `matches` (up to $2 difference, the rounding of returns to whole pesos), `differs`, `not_filed` (there's no return for that month) or `unreadable` (the return doesn't carry the figure in a recognizable row: `declared` is `null`, never 0). A month with a complementary return takes, per tax, the most recent one that carries it. When the return separately states what came without a CFDI (in `isr_income`, the additional nominal income; in `vat_charged`, the 16% IVA above what SAT pre-filled from its invoices), that comes in `declared_without_cfdi` and only the rest is compared: `difference` is `declared` minus `declared_without_cfdi` minus `invoiced`. `vat_balance_in_favor` adds up the year's IVA in favor and what was credited afterwards, and `tax_regimes` says which regime it invoiced with and whether it's on its constancia.

### The CFDI behind a figure

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/cross_checks/cfdi?month=2026-09&key=vat_creditable" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const crossCheckCfdi = await fiscalisto.accounting.crossCheckCfdi({ month: "2026-09", key: "vat_creditable" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

cross_check_cfdi = fiscalisto.accounting.cross_check_cfdi({"month": "2026-09", "key": "vat_creditable"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$crossCheckCfdi = $fiscalisto->accounting->crossCheckCfdi([
    'month' => '2026-09',
    'key' => 'vat_creditable',
]);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	crossCheckCFDI, err := client.Accounting.CrossCheckCFDI(ctx, &fiscalisto.GetCrossCheckCfdiParams{
		Month: "2026-09",
		Key:   "vat_creditable",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *crossCheckCFDI)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetCrossCheckCfdiParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var crossCheckCfdi = fiscalisto.accounting().crossCheckCfdi(new GetCrossCheckCfdiParams()
        .setMonth("2026-09")
        .setKey("vat_creditable"));
System.out.println(crossCheckCfdi);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var crossCheckCfdi = await fiscalisto.Accounting.CrossCheckCfdiAsync(new GetCrossCheckCfdiParams
{
    Month = "2026-09",
    Key = "vat_creditable",
});
```

To see why a figure `differs`, `GET /v1/accounting/cross_checks/cfdi` with the month (`month`, whose return is already due) and the figure (`key`: `vat_charged`, `vat_creditable`, `vat_withheld`, `isr_income`, `isr_withheld_salaries`, `isr_withheld_suppliers` or `vat_withheld_suppliers`) gives the CFDI that make up what was invoiced (`invoiced`), with the same calculations as Impuestos and largest first. Each one carries its `uuid`, the counterparty (`tax_id`, `name`), the date and what it contributes (`amount`). In `isr_withheld_salaries` they're the month's payroll receipts (by payment date) with the ISR withheld from each employee, and in supplier withholdings the received invoices it paid in the month. `type` is `invoice` (PUE invoice, in its month), `credit_note` (credit note: subtracts), `payment` (what was paid in the month of a PPD invoice; `uuid` is the invoice's) or `withholding_certificate` (in `vat_withheld`, a withholding certificate it received, like lodging platforms', in the month it was issued; `uuid` is the certificate's). The sum of `cfdi` plus `adjustment` is `invoiced`. `adjustment` is what Impuestos adds on top of the CFDI: in `vat_creditable`, the common expenses proportion, the withheld IVA paid over from the previous month and imports. It also carries that figure's `status`, `declared` and `difference`, like the year's cross-check. It doesn't query SAT or cost timbres either.

### Why a figure doesn't match

When the figure `differs`, `explanation` says which CFDI would explain it (`null` if it matches): `exact` is the shortest combination (up to four) of CFDI in what was invoiced or just outside it whose `effect` adds up to the difference within $1 of rounding (`null` if none does, or if several different ones do: `ambiguous`), and `causes` groups by `reason` the ones that move what was invoiced toward what was declared. It's a possibility, not what whoever filed did.

## IVA refund

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/vat_refund?month=2026-08" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const vatRefund = await fiscalisto.accounting.vatRefund({ month: "2026-08" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

vat_refund = fiscalisto.accounting.vat_refund({"month": "2026-08"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$vatRefund = $fiscalisto->accounting->vatRefund(['month' => '2026-08']);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	vatRefund, err := client.Accounting.VatRefund(ctx, &fiscalisto.GetVatRefundParams{
		Month: fiscalisto.String("2026-08"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *vatRefund)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetVatRefundParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var vatRefund = fiscalisto.accounting().vatRefund(new GetVatRefundParams().setMonth("2026-08"));
System.out.println(vatRefund);
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var vatRefund = await fiscalisto.Accounting.VatRefundAsync(new GetVatRefundParams { Month = "2026-08" });
```

`balances` carries the IVA in favor of each month of the last five years: `amount` is the balance the month generated (from its return, with `source` set to `declaration` and its `operation_number`; without a return read, from its CFDI, with `source` set to `cfdi` and `estimated` set to `true`), `credited` what was credited in later months (`credited_in`, always taking the oldest balance first, as art. 6 of the LIVA requires) and `available` what's left to credit or request. `status` is `available`, `credited`, `in_refund`, `refunded`, `denied` or `prescribed` (the right expires five years after the return, in `prescribes_on`).

With `month`, `review` checks that month before requesting it at SAT: `amount_to_request` is what's left of the balance in whole pesos (`remainder` says whether it's a remainder) and each element of `checks` is `ok`, `warning`, `blocking` (SAT usually denies it or issues a requirement because of it) or `pending` (something you must confirm, like the month's DIOT). `suppliers.vat_at_risk` is the IVA from cancelled CFDI, from issuers on the definitive 69-B or in another RFC's name. Read your [SAT tax returns](https://fiscalisto.com/en/docs/api/declaraciones-del-sat) first with `POST /v1/sat_declarations/refresh`; this route doesn't query SAT, files nothing and costs no timbres.

## Chart of accounts

`GET /v1/accounting/accounts` is the chart of accounts, each with its Anexo 24 grouping code.

## Electronic accounting

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/electronic_accounting?month=2026-10" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" -o contabilidad.zip
```

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

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

await writeFile("contabilidad.zip", await fiscalisto.accounting.electronicAccounting({ month: "2026-10" }));
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

with open("contabilidad.zip", "wb") as f:
    f.write(fiscalisto.accounting.electronic_accounting({"month": "2026-10"}))
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

file_put_contents('contabilidad.zip', $fiscalisto->accounting->electronicAccounting(['month' => '2026-10']));
```

```go tab="Go"
package main

import (
	"context"
	"log"
	"os"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	zip, err := client.Accounting.ElectronicAccounting(ctx, &fiscalisto.GetElectronicAccountingParams{Month: "2026-10"})
	if err != nil {
		log.Fatal(err)
	}
	if err := os.WriteFile("contabilidad.zip", zip, 0o644); err != nil {
		log.Fatal(err)
	}
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetElectronicAccountingParams;
import java.nio.file.Files;
import java.nio.file.Path;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

Files.write(Path.of("contabilidad.zip"), fiscalisto.accounting().electronicAccounting(new GetElectronicAccountingParams().setMonth("2026-10")));
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

await File.WriteAllBytesAsync("contabilidad.zip", await fiscalisto.Accounting.ElectronicAccountingAsync(new GetElectronicAccountingParams { Month = "2026-10" }));
```

A ZIP with the chart (`CT`) and the trial balance (`BN`) in Anexo 24's 1.3 format, each in its own ZIP with the name the Buzón Tributario expects (`RFC` + year + month + type). The trial balance lists every account of the chart (in zeros those that didn't move) and each cuenta de mayor with the sum of its subaccounts.

- A trial balance that corrects one already sent: `type=complementary` and the day it was modified in `modified_on` (it comes out `BC`).
- Journal entries (`PL`), with the account (`XC`) and folio (`XF`) auxiliary reports, are delivered when SAT asks for them: add `journal_request` with the reason (`AF` audit act or `FC` compulsory audit, with `order_number`; `DE` refund or `CO` offset, with `procedure_number`).
- The trial balance adjusted at the year's close: `month=2025-13` (it comes out `RFC202513BN`, alone: the chart and the journal entries have no month 13). Its opening balances are December's closing ones and its only movement is the closing entry, which cancels income, costs and expenses against the year's result (`305.01` profit or `305.02` loss); with `closing_entry=false` it goes without it, with December's balances. It's due by April 20 (personas morales) or May 22 (personas físicas) of the next year (RMF regla 2.8.1.6).

## Take the books to another system

```bash tab="cURL"
curl "https://api.fiscalisto.com/v1/accounting/books_export?from_month=2026-01&to_month=2026-10" \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" -o contabilidad.zip
```

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

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

await writeFile("contabilidad.zip", await fiscalisto.accounting.booksExport({ from_month: "2026-01", to_month: "2026-10" }));
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

with open("contabilidad.zip", "wb") as f:
    f.write(fiscalisto.accounting.books_export({"from_month": "2026-01", "to_month": "2026-10"}))
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

file_put_contents('contabilidad.zip', $fiscalisto->accounting->booksExport([
    'from_month' => '2026-01',
    'to_month' => '2026-10',
]));
```

```go tab="Go"
package main

import (
	"context"
	"log"
	"os"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	zip, err := client.Accounting.BooksExport(ctx, &fiscalisto.GetBooksExportParams{
		FromMonth: "2026-01",
		ToMonth:   fiscalisto.String("2026-10"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if err := os.WriteFile("contabilidad.zip", zip, 0o644); err != nil {
		log.Fatal(err)
	}
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.GetBooksExportParams;
import java.nio.file.Files;
import java.nio.file.Path;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

Files.write(Path.of("contabilidad.zip"), fiscalisto.accounting().booksExport(new GetBooksExportParams()
        .setFromMonth("2026-01")
        .setToMonth("2026-10")));
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

await File.WriteAllBytesAsync("contabilidad.zip", await fiscalisto.Accounting.BooksExportAsync(new GetBooksExportParams
{
    FromMonth = "2026-01",
    ToMonth = "2026-10",
}));
```

All the books of a period in one ZIP, to move them to another system or hand them to a new accountant, from `from_month` to `to_month` (up to 24 months, not after the current month; without `to_month`, only `from_month`). It holds, in the order they're imported:

- `1-catalogo-RFC.xlsx`: the chart with number, name, level, the cuenta de mayor it's a subaccount of, grouping code and nature.
- `2-saldos-iniciales-RFC-YYYYMM.xlsx`: the balances on the first day of `from_month`, as debit and credit, with their sums.
- `3-polizas-RFC-YYYYMM-YYYYMM-contpaqi.txt`: the journal entries of the whole period for CONTPAQi Contabilidad, and in `3-polizas-aspel-coi/` one Excel per month for Aspel COI (its layout carries only the day). Each entry carries its invoice's folio fiscal (UUID).
- `balanzas-RFC-YYYYMM-YYYYMM.xlsx`: each month's trial balance, one sheet per month, to check that the other system gives the same balances.
- `contabilidad-electronica/`: the chart (`CT`) and each month's trial balance (`BN`) in Anexo 24's 1.3 XML, which other systems read too.
- `LEEME.txt`: the order to import them in.

They're the same books as `financial_statements` and `electronic_accounting`. In the app it's **Toda la contabilidad de un periodo**, in **Exportar**.

## DIOT

`GET /v1/accounting/diot?month=2026-09` says what was actually paid to each supplier in the month (PUE invoices and payment complements it received), with its credit notes as returns, one line per supplier and operation type. `blacklisted` flags suppliers on the definitive 69-B list, and `warnings` what's worth reviewing.

`GET /v1/accounting/diot/file?month=2026-09` is the DIOT 2025 bulk upload TXT file, ready for SAT's platform. With `group_small_suppliers=true` it groups into one global line the suppliers of up to $50,000 in the month, as long as they don't exceed 10 % of what was paid (RMF rule 4.5.2). A month without supplier payments returns `diot_empty`: that DIOT is filed without operations from SAT's portal.

The DIOT comes from received invoices: first request the month's with [POST /v1/sat_downloads](https://fiscalisto.com/en/docs/api/descargas-del-sat). It's built from January 2025, with that year's format.

## Clientes con IEPS desglosado

`GET /v1/accounting/ieps_customers?year=2026` gives, by quarter, the customers the issuer charged IEPS to separately on its income invoices not cancelled: each one's RFC, name, how many invoices and IEPS, and the total (LIEPS article 19, section II, third paragraph). Only alcoholic beverages, energy drinks, flavored beverages and high-calorie foods count; the general public and foreigners aren't included. With `quarter=1` it gives only that quarter. `due_month` is the month it's filed in the MULTI-IEPS, Annex 1 (RMF 2026 rule 5.2.2): the one after the quarter.

`GET /v1/accounting/ieps_customers/file?year=2026&quarter=1` is that quarter's list as CSV, the same one the app downloads in Impuestos.
