# Bank reconciliation

> Send the deposits of the issuer's account and Fiscalisto tells you which invoice each one paid; once reconciled, its invoices are paid.

Send the deposits of the issuer's bank account, from your bank's API or from a statement you already read. Fiscalisto suggests the invoice each one paid (by amount, RFC, folio in the description and date), and once reconciled the invoice is paid in [Accounts receivable](https://fiscalisto.com/en/docs/api/cuentas-por-cobrar) and `invoice.paid` arrives.

## Send deposits

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/bank_transactions \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account": "012180001234567891",
    "transactions": [
      {
        "date": "2026-10-24",
        "amount": 5800,
        "description": "SPEI RECIBIDO INMOBILIARIA CVA",
        "reference": "F-1024",
        "payer_tax_id": "ICV060329BY0"
      }
    ]
  }'
```

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

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

const bankImport = await fiscalisto.bankTransactions.create({
  account: "012180001234567891",
  transactions: [
    {
      date: "2026-10-24",
      amount: 5800,
      description: "SPEI RECIBIDO INMOBILIARIA CVA",
      reference: "F-1024",
      payer_tax_id: "ICV060329BY0",
    },
  ],
});
```

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

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

bank_import = fiscalisto.bank_transactions.create({
    "account": "012180001234567891",
    "transactions": [
        {
            "date": "2026-10-24",
            "amount": 5800,
            "description": "SPEI RECIBIDO INMOBILIARIA CVA",
            "reference": "F-1024",
            "payer_tax_id": "ICV060329BY0",
        },
    ],
})
```

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

use Fiscalisto\Fiscalisto;

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

$bankImport = $fiscalisto->bankTransactions->create([
    'account' => '012180001234567891',
    'transactions' => [
        [
            'date' => '2026-10-24',
            'amount' => 5800,
            'description' => 'SPEI RECIBIDO INMOBILIARIA CVA',
            'reference' => 'F-1024',
            'payer_tax_id' => 'ICV060329BY0',
        ],
    ],
]);
```

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

	bankImport, err := client.BankTransactions.Create(ctx, &fiscalisto.CreateBankTransactionsParams{
		Account: fiscalisto.String("012180001234567891"),
		Transactions: []fiscalisto.CreateBankTransactionsParamsTransaction{
			{
				Date:        "2026-10-24",
				Amount:      5800,
				Description: "SPEI RECIBIDO INMOBILIARIA CVA",
				Reference:   fiscalisto.String("F-1024"),
				PayerTaxID:  fiscalisto.String("ICV060329BY0"),
			},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *bankImport)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.CreateBankTransactionsParams;
import com.fiscalisto.model.CreateBankTransactionsParamsTransaction;
import java.util.List;

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

var bankImport = fiscalisto.bankTransactions().create(new CreateBankTransactionsParams()
        .setAccount("012180001234567891")
        .setTransactions(List.of(
                new CreateBankTransactionsParamsTransaction()
                        .setDate("2026-10-24")
                        .setAmount(5800)
                        .setDescription("SPEI RECIBIDO INMOBILIARIA CVA")
                        .setReference("F-1024")
                        .setPayerTaxId("ICV060329BY0")
        )));
System.out.println(bankImport);
```

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

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

var bankImport = await fiscalisto.BankTransactions.CreateAsync(new CreateBankTransactionsParams
{
    Account = "012180001234567891",
    Transactions = new()
    {
        new()
        {
            Date = "2026-10-24",
            Amount = 5800,
            Description = "SPEI RECIBIDO INMOBILIARIA CVA",
            Reference = "F-1024",
            PayerTaxId = "ICV060329BY0",
        },
    },
});
```

Up to 1,000 deposits per request, credits only and in pesos. One you already sent (same day, amount, reference and description) is skipped, so you can send the last 7 days every day without repeating anything: the response says how many were added (`added`) and how many were already there (`duplicates`), with the new ones in `data`.

Each open deposit (`btx_…`) carries `suggested_match`: the invoices it seems to pay, how much goes to each, whether they're PUE or PPD and how sure it is (`confidence`: `high` or `medium`), with its reasons. `payer_tax_id` helps a lot: the payer's RFC almost never comes in the description.

## Reconcile

| If the deposit… | Do |
| --- | --- |
| Paid PUE invoices | `POST /v1/bank_transactions/{id}/match`, with no body to accept the suggestion or with `invoices` (`inv_…` or UUID, of the same customer). |
| Paid PPD invoices | [POST /v1/payments](https://fiscalisto.com/en/docs/api/pagos-y-notas-de-credito) with `"bank_transaction": "btx_…"`: it stamps the payment complement, with the deposit's date, and reconciles it. Repeating the request with the same `Idempotency-Key` returns the same complement; another with the same deposit is refused. |
| Isn't from an invoice | `POST /v1/bank_transactions/{id}/classify` with `classification`: `venta` (not yet invoiced), `prestamo` (loan), `traspaso` (transfer) or `devolucion` (refund). |

An unexplained deposit can be taken as income in a SAT review (article 59 section III of the CFF): classify the ones that don't come from an invoice.

`POST /v1/bank_transactions/{id}/reopen` undoes the reconciliation or the classification, and its invoices owe again. If it was paid with a current complement, cancel the complement first (`400 bank_transaction_invalid`).

## Look them up

`GET /v1/bank_transactions` lists the deposits, newest first; with `status=open` only the ones left. Each reconciled one says which invoices it paid (`invoices`) and, if it was paid with a complement, which one (`payment`).

An account sends up to 100,000 deposits a day in production and 5,000 in test mode ([Limits](https://fiscalisto.com/en/docs/api/limites)).
