# Verify documents

> Ask SAT whether any CFDI exists and is still current, whether it can be cancelled, and whether its issuer and receiver are on the blacklists. With the XML, the QR or its data. It uses no timbres.

Before paying a supplier, deducting an expense or accepting an invoice on your platform, it's worth knowing that SAT has it and nobody cancelled it. [`POST /v1/cfdi_verifications`](https://fiscalisto.com/en/docs/api/referencia/verificar-comprobantes/verify-cfdi) asks SAT about any CFDI, yours or anyone else's, and answers in a single response:

- whether it exists and is current or cancelled (`sat_status`),
- whether it can be cancelled and how (`cancellable`), and whether a cancellation is in progress (`cancellation_status`),
- whether the issuer is on the 69-B list as definitive (`issuer_efos`),
- the issuer and the receiver on [SAT's lists](https://fiscalisto.com/en/docs/api/listas-del-sat) (`issuer_sat_lists`, `receiver_sat_lists`),
- and, with the XML, whether its seals are authentic (`seals`): that nobody changed it after sealing it and that the timbre is SAT's.

It uses SAT's public service, the same as the [Verificar factura](https://fiscalisto.com/verificar-factura-sat) page: it needs nobody's e.firma and the document doesn't have to be one of your issuers'. It uses no timbres, not even in production.

## With the XML

Send the XML as text. Fiscalisto reads the UUID, both RFCs and the total from it, and also returns what the XML says (`xml`: version, type, dates, names and currency).

```bash
curl https://api.fiscalisto.com/v1/cfdi_verifications \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile xml factura.xml '{xml: $xml}')"
```

## The XML's seals

SAT says whether a UUID is current, but not whether the XML you have is the one that was stamped: someone can change the total, the line item or the name of a current invoice and SAT will keep answering «Vigente» for its UUID. With the XML, `seals` checks its seals the way SAT does:

- `issuer_seal_valid`: whether the `Sello` signs this XML's cadena original (the one SAT's XSLTs build, in `original_string`) with the key of the `Certificado` it carries.
- `certificate`: that certificate, which must be a digital seal (CSD, not the e.firma) of the issuer's RFC, numbered `NoCertificado` and valid on the document's `Fecha`.
- `stamp`: whether the timbre's `SelloCFD` is this document's `Sello` (a timbre copied from another isn't) and whether its `SelloSAT` was signed by SAT's certificate (`sat_seal_valid`; `null` if SAT didn't serve its certificate at that moment).

`valid` is `true` when everything checks out; otherwise, `problems` says what failed, with its code:

| `code` | What it means |
| --- | --- |
| `seal_mismatch` | The `Sello` doesn't match the data: the XML was modified after sealing, or the seal isn't from that certificate. |
| `stamp_not_for_this_seal` | The timbre belongs to another document: its `SelloCFD` isn't this `Sello`. |
| `sat_seal_mismatch` | The `SelloSAT` doesn't match the timbre: it was modified or SAT didn't issue it. |
| `certificate_not_issuer` | The certificate belongs to another RFC. |
| `certificate_not_csd` | It was sealed with an e.firma, not a digital seal. |
| `certificate_not_valid_at_issue` | The certificate wasn't valid on the document's date. |
| `certificate_number_mismatch` | `NoCertificado` isn't the number of the certificate it carries. |
| `certificate_unreadable` | The `Certificado` can't be read. |
| `missing_seal` | The XML has no `Sello` or `Certificado`. |
| `malformed_xml` | The XML couldn't be read to build the cadena (for example, it has a DOCTYPE). |

```json
"seals": {
  "valid": false,
  "issuer_seal_valid": false,
  "certificate": { "number": "30001000000500003416", "tax_id": "EKU9003173C9", "kind": "csd", … },
  "stamp": { "sat_seal_valid": true, "sat_certificate_number": "30001000000500003456", "pac_tax_id": "SPR190613I52" },
  "problems": [{ "code": "seal_mismatch", "message": "El Sello no corresponde a los datos del XML: …" }],
  "original_string": "||4.0|A|101|2026-11-14T10:20:31|…||"
}
```

If `sat_status` is `active` but `seals.valid` is `false`, the document exists at SAT but the XML you were sent isn't the one that was stamped: ask the issuer for the original before paying or deducting. Seals are checked on CFDI 4.0; with a 3.3, `seals` is `null`. With `qr` or with the data, it's also `null`, because there's no XML to check.

An XML without `TimbreFiscalDigital` returns `400`: it isn't stamped, so SAT doesn't have it. A withholding certificate also returns `400`; this route verifies CFDI (income, expense, payment, payroll and transfer).

## With the QR or its data

If you only have the PDF, send its QR text in `qr`. And if you have the loose data, send `uuid`, `issuer_tax_id`, `receiver_tax_id` and `total`:

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/cfdi_verifications \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "uuid": "5FB2822E-396D-4725-8521-CDC4BDD20CCF", "issuer_tax_id": "EKU9003173C9", "receiver_tax_id": "XIA190128J61", "total": 1160 }'
```

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

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

const cfdiVerification = await fiscalisto.cfdiVerifications.create({
  uuid: "5FB2822E-396D-4725-8521-CDC4BDD20CCF",
  issuer_tax_id: "EKU9003173C9",
  receiver_tax_id: "XIA190128J61",
  total: 1160,
});
```

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

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

cfdi_verification = fiscalisto.cfdi_verifications.create({
    "uuid": "5FB2822E-396D-4725-8521-CDC4BDD20CCF",
    "issuer_tax_id": "EKU9003173C9",
    "receiver_tax_id": "XIA190128J61",
    "total": 1160,
})
```

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

use Fiscalisto\Fiscalisto;

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

$cfdiVerification = $fiscalisto->cfdiVerifications->create([
    'uuid' => '5FB2822E-396D-4725-8521-CDC4BDD20CCF',
    'issuer_tax_id' => 'EKU9003173C9',
    'receiver_tax_id' => 'XIA190128J61',
    'total' => 1160,
]);
```

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

	cfdiVerification, err := client.CfdiVerifications.Create(ctx, &fiscalisto.VerifyCfdiParams{
		UUID:          fiscalisto.String("5FB2822E-396D-4725-8521-CDC4BDD20CCF"),
		IssuerTaxID:   fiscalisto.String("EKU9003173C9"),
		ReceiverTaxID: fiscalisto.String("XIA190128J61"),
		Total:         fiscalisto.Float64(1160),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *cfdiVerification)
}
```

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

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

var cfdiVerification = fiscalisto.cfdiVerifications().create(new VerifyCfdiParams()
        .setUuid("5FB2822E-396D-4725-8521-CDC4BDD20CCF")
        .setIssuerTaxId("EKU9003173C9")
        .setReceiverTaxId("XIA190128J61")
        .setTotal(1160));
System.out.println(cfdiVerification);
```

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

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

var cfdiVerification = await fiscalisto.CfdiVerifications.CreateAsync(new VerifyCfdiParams
{
    Uuid = "5FB2822E-396D-4725-8521-CDC4BDD20CCF",
    IssuerTaxId = "EKU9003173C9",
    ReceiverTaxId = "XIA190128J61",
    Total = 1160,
});
```

Send only one of the three forms; two at once return `400`.

## What it answers

| `sat_status` | What it means | What to do |
| --- | --- | --- |
| `active` | SAT has it as current. | Go ahead. Check `issuer_sat_lists.risk` before deducting it. |
| `canceled` | SAT has it as cancelled. | Don't pay or deduct it; ask for the one that replaces it. |
| `not_found` | SAT doesn't have it. | If it was stamped a few minutes ago, wait: SAT takes a while to record it. Otherwise, it doesn't exist or it's a test one. |
| `data_mismatch` | The UUID exists, but the RFCs or the total don't match. | Check that the total is the document's (SAT compares it as a number) and both RFCs. |

`cancellable` says how a current one is cancelled: `without_acceptance` (without the receiver accepting), `with_acceptance` (the receiver has 3 business days to accept or reject) or `not_cancellable` (for example, it has current related payments or credit notes). `cancellation_status` follows a cancellation someone requested: `in_process` while the receiver decides, `rejected` if they rejected it, and `accepted`, `without_acceptance` or `deadline_passed` once it's cancelled. To cancel your own see [Cancellation](https://fiscalisto.com/en/docs/api/cancelacion).

The lists only come when SAT has the document (`active` or `canceled`) and at no cost; otherwise, `issuer_sat_lists` and `receiver_sat_lists` come as `null`. To check an RFC without a document use [SAT lists](https://fiscalisto.com/en/docs/api/listas-del-sat). `sat` carries SAT's answer as is, in case you keep it as evidence.

## In test mode

With an `fk_test_` key the real SAT is also queried, because it's public information. Documents you stamped in test mode aren't at SAT, so they return `not_found`: to try `active`, verify a real invoice you have at hand.

## Limits

Up to 20,000 documents a day in production and 500 in test mode (see [Limits](https://fiscalisto.com/en/docs/api/limites)). If SAT doesn't answer it returns `502` `sat_unavailable` and it doesn't count toward the daily limit: retry in a few minutes.
