# Get the VAT in your favor and prepare its refund

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

The VAT in your favor for each month of the last five years (from the tax returns read with POST /v1/sat_declarations/refresh or, without them, from its CFDIs, with estimated set to true), how much was credited later (oldest balance first), how much is left, what's in a refund and when it expires. With `month`, that month's checklist before requesting it at SAT: tax return, cross-check with CFDIs, DIOT, compliance opinion, Buzón Tributario, e.firma, SAT lists, supplier CFDIs with findings and CLABE, with the amount to request. It doesn't file anything with SAT. Free.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `month` | query |  | The month of the balance to check (YYYY-MM). Without it, just the balances. |
| `issuer` | query |  | The issuer (iss_…). It can be left out if the key or the account has only one. |

## With the TypeScript SDK

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

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

const vatRefund = await fiscalisto.accounting.vatRefund();
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

vat_refund = fiscalisto.accounting.vat_refund()
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

$vatRefund = $fiscalisto->accounting->vatRefund();
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

var vatRefund = await fiscalisto.Accounting.VatRefundAsync();
```

## With the Go SDK

```go
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// La llave viene de FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	vatRefund, err := client.Accounting.VatRefund(ctx, nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *vatRefund)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;

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

var vatRefund = fiscalisto.accounting().vatRefund();
System.out.println(vatRefund);
```

## Response 200

OK.

A `VatRefund` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"vat_refund"` | yes | What kind of object it is («invoice», «customer»…). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer` | string | yes | The issuer. |
| `available` | number | yes | The IVA in favor you can still claim back: what is left of each balance not credited, without a request and not lapsed. |
| `in_refund` | number | yes | What was requested in refund requests still in process or already resolved without a deposit. |
| `refunded` | number | yes | What the SAT already deposited. |
| `estimated` | boolean | yes | true if some month comes from its CFDIs because its return hasn't been read (POST /v1/sat_declarations/refresh). |
| `balances` | array of object | yes | Each month with IVA in favor in the last five years, from newest to oldest. |
| `balances[].month` | string | yes | The balance's month (YYYY-MM). |
| `balances[].source` | `declaration`, `cfdi` | yes | declaration if it comes from the return read; cfdi if it was calculated from its CFDIs. |
| `balances[].amount` | number | yes | The month's balance in favor. |
| `balances[].operation_number` | string or null | yes | The return's operation number, or null. |
| `balances[].credited` | number | yes | What of this balance was credited in later months, oldest balance first. |
| `balances[].credited_in` | array of object | yes | In which month each part was credited and how much. |
| `balances[].credited_in[].month` | string | yes | The month that part was credited in (YYYY-MM). |
| `balances[].credited_in[].amount` | number | yes | What was credited that month. |
| `balances[].available` | number | yes | What is left of this balance to claim back. |
| `balances[].status` | `available`, `credited`, `in_refund`, `refunded`, `denied`, `prescribed` | yes | available (can be requested), credited (already credited), in_refund (with a request), refunded (deposited), denied or prescribed (five years passed). |
| `balances[].prescribes_on` | string | yes | When the right to claim it lapses: five years from its return (YYYY-MM-DD). |
| `review` | object or null | yes | With month, that month's review before requesting it; null without month. |
| `review.month` | string | yes | The month reviewed (YYYY-MM). |
| `review.amount_to_request` | number | yes | What is worth requesting, in pesos without cents as the SAT asks for it. |
| `review.remainder` | boolean | yes | true if part of the balance was already credited and what is requested is the remainder. |
| `review.ready` | boolean | yes | true if no check blocks the request. |
| `review.checks` | array of object | yes | Each check, from the most serious to the ones that are fine. |
| `review.checks[].key` | string | yes | What was checked, stable for your code. |
| `review.checks[].result` | `ok`, `warning`, `blocking`, `pending` | yes | ok, warning (worth reviewing), blocking (the SAT would reject it) or pending (a piece of data is missing). |
| `review.checks[].title` | string | yes | The check, in one line. |
| `review.checks[].detail` | string | yes | What it found and what to do. |
| `review.checks[].amount` | number or null | yes | The pesos it affects, such as the IVA at risk, or null. |
| `review.suppliers` | object | yes | The month's suppliers, for the list the SAT asks for. |
| `review.suppliers.count` | integer | yes | How many suppliers it had in the month. (from -9007199254740991 to 9007199254740991) |
| `review.suppliers.cfdi` | integer | yes | How many received CFDIs add to the creditable IVA. (from -9007199254740991 to 9007199254740991) |
| `review.suppliers.main` | integer | yes | How many suppliers account for 80% of the creditable IVA. (from -9007199254740991 to 9007199254740991) |
| `review.suppliers.vat_at_risk` | number | yes | The IVA from supplier CFDIs the SAT wouldn't recognize: canceled, from EFOS or with other findings. |
| `review.customers` | object | yes | The month's customers. |
| `review.customers.count` | integer | yes | How many customers it had in the month. (from -9007199254740991 to 9007199254740991) |
| `review.customers.cfdi` | integer | yes | How many issued CFDIs add to the IVA collected. (from -9007199254740991 to 9007199254740991) |

```json
{
  "object": "vat_refund",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "available": 18450,
  "in_refund": 0,
  "refunded": 0,
  "estimated": false,
  "balances": [
    {
      "month": "2026-08",
      "source": "declaration",
      "amount": 24450,
      "operation_number": "260917004512",
      "credited": 6000,
      "credited_in": [
        {
          "month": "2026-09",
          "amount": 6000
        }
      ],
      "available": 18450,
      "status": "available",
      "prescribes_on": "2031-09-15"
    }
  ],
  "review": {
    "month": "2026-08",
    "amount_to_request": 18450,
    "remainder": true,
    "ready": false,
    "checks": [
      {
        "key": "proveedores",
        "result": "blocking",
        "title": "$1,280.00 de IVA de CFDI que el SAT rechaza",
        "detail": "Un CFDI acreditado tiene hallazgos (cancelado en el sat). El SAT descuenta el IVA de CFDI cancelados, de emisores en 69-B definitivo o a nombre de otro RFC: pida la devolución sin él o corrija la declaración.",
        "amount": 1280
      },
      {
        "key": "diot",
        "result": "pending",
        "title": "Confirme que presentó la DIOT",
        "detail": "La regla 2.3.4 pide presentar la DIOT de agosto de 2026 antes de la solicitud. Márquela como presentada cuando la presente.",
        "amount": null
      },
      {
        "key": "declaracion",
        "result": "ok",
        "title": "Declaración con saldo a favor",
        "detail": "La declaración de agosto de 2026 (operación 260917004512, del 2026-09-15) muestra $24,450.00 a favor.",
        "amount": null
      }
    ],
    "suppliers": {
      "count": 42,
      "cfdi": 188,
      "main": 9,
      "vat_at_risk": 1280
    },
    "customers": {
      "count": 12,
      "cfdi": 64
    }
  }
}
```

## Errors

- `feature_not_in_plan` (403): Live, this part of the API (inventario, portal de proveedores, pedidos, comprobación de gastos) follows the empresa's plan, as in the app: it comes with Operaciones (added to any paid plan; included in Corporativo). The books (the /v1/accounting routes except DIOT, cross checks, IVA refunds and fixed assets) come with Contabilidad (added to Independiente, Emprendedor or Negocio; included in Despacho and Corporativo): without it, changing the books answers this error, and reading them works only up to the last month it had it. Add either in Ajustes › Plan y pagos; test mode has everything.
- `issuer_archived` (400): The issuer is archived and no longer stamps. Its documents can still be read and canceled.
- `issuer_linked_empresa` (403): That issuer is an empresa of the app connected to your account: through the API it only offers its Portal de proveedores (/v1/portal_suppliers and /v1/supplier_invoices) and, once someone who may pay suppliers and change Configurar pagos turned them on, its supplier payouts (/v1/payouts and /v1/payroll_payouts). It also stops when whoever connected it (or turned its payouts on) no longer has that permission in the empresa: message_es says which. Do everything else in the app.
- `issuer_missing` (404): There is no such issuer in the account (or it belongs to the other mode).
- `issuer_not_allowed` (403): This key can't use that issuer.
- `issuer_required` (400): The account has several issuers and the request doesn't say which: send `issuer` (iss_…).
- `livemode_mismatch` (400): The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.

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