# List certificates

`GET https://api.fiscalisto.com/v1/retentions`

The issuer's certificates, most recent first.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `limit` | query |  | How many per page, from 1 to 100. 10 by default. |
| `starting_after` | query |  | The id of the last one on the previous page, for the next one. |
| `issuer` | query |  | The issuer (iss_…). It can be left out if the key or the account has only one. |
| `status` | query |  | valid, canceled, rejected or processing. |
| `recipient` | query |  | The recipient's RFC. |
| `year` | query |  | Fiscal year, 4 digits. |

## With the TypeScript SDK

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

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

for await (const item of fiscalisto.retentions.list()) {
  console.log(item.id);
}
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

for item in fiscalisto.retentions.list():
    print(item["id"])
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

foreach ($fiscalisto->retentions->list() as $item) {
    echo $item['id'], "\n";
}
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

await foreach (var item in fiscalisto.Retentions.ListAutoPagingAsync())
    Console.WriteLine(item.Id);
```

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

	for item, err := range client.Retentions.ListAutoPaging(ctx, nil) {
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(item.ID)
	}
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;

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

for (var item : fiscalisto.retentions().listAutoPaging()) {
    System.out.println(item.getId());
}
```

## Response 200

OK.

A `RetentionList` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"list"` | yes | What kind of object it is («invoice», «customer»…). |
| `data` | array of object | yes | The objects on this page. |
| `data[].id` | string | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `data[].livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `data[].object` | `"retention"` | yes | What kind of object it is («invoice», «customer»…). |
| `data[].issuer` | string | yes | The issuer (iss_…). |
| `data[].status` | `processing`, `valid`, `rejected`, `canceled` | yes | processing: the PAC hasn't answered. valid: stamped. rejected: the SAT or the PAC didn't accept it (see error). canceled: canceled. |
| `data[].uuid` | string or null | yes | Tax folio the SAT assigns (UUID of the Timbre Fiscal Digital), in uppercase. |
| `data[].folio` | integer or null | yes | The certificate's number in the issuer's series (internal_folio is the printed one, RET1…). |
| `data[].internal_folio` | string or null | yes | Internal folio (FolioInt): RET1, RET2… |
| `data[].date` | string or null | yes | Issue date (Fecha), Mexico City time. |
| `data[].code` | string | yes | Withholding key (CveRetenc), c_CveRetenc: 01 professional services, 05 leasing, 14 dividends, 16 interest, 18 payments abroad… Keys 06 and 14 to 24 carry their complement, as SAT's catalog asks (share_sale with 06 and 19, dividends with 14, distributable_remainder with 15, interest, trust_lease, foreign_payment, prize, trust, retirement_plan, mortgage_interest, financial_derivatives); 01, 02, 04 and 05 carry foreign_payment when the recipient is foreign; 26 (technology platforms) carries platform, and its totals and taxes are calculated from the operations. 27 and 28 can't be issued here. |
| `data[].description` | string or null | yes | Withholding description (DescRetenc). |
| `data[].recipient` | object | yes | Recipient of the certificate (Receptor): domestic with RFC and postal code, or foreign. |
| `data[].recipient.foreign` | boolean | yes | true if the recipient is foreign (without an RFC). |
| `data[].recipient.tax_id` | string or null | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `data[].recipient.legal_name` | string or null | yes | Name or razón social exactly as on the constancia de situación fiscal, without the capital regime (without «S.A. de C.V.»). |
| `data[].recipient.zip` | string |  | Postal code of the tax address, 5 digits, as on the constancia de situación fiscal. An issuer's is the place of issue (LugarExpedicion) of its CFDIs. |
| `data[].recipient.curp` | string or null |  | CURP, 18 characters. |
| `data[].period` | object | yes | Period (Periodo): start month, end month and year. |
| `data[].period.year` | integer | yes | Year (Ejercicio). (from -9007199254740991 to 9007199254740991) |
| `data[].period.from_month` | integer | yes | Start month (MesIni), 1 to 12. (from -9007199254740991 to 9007199254740991) |
| `data[].period.to_month` | integer | yes | End month (MesFin), 1 to 12, in the same year. (from -9007199254740991 to 9007199254740991) |
| `data[].totals` | object | yes | Totals (Totales). |
| `data[].totals.operation` | number or null | yes | Total amount of the operation (MontoTotOperacion). |
| `data[].totals.taxed` | number or null | yes | Taxed amount (MontoTotGrav). By default, operation minus exempt. |
| `data[].totals.exempt` | number or null | yes | Exempt amount (MontoTotExent). 0 by default. |
| `data[].totals.withheld` | number or null | yes | Total withheld (MontoTotRet). |
| `data[].taxes` | array of object | yes | The CFDI's taxes, by type. |
| `data[].taxes[].tax` | string | yes | Tax: isr, iva or ieps (ImpuestoRet 001, 002, 003). |
| `data[].taxes[].base` | number | yes | Base of the withheld tax (BaseRet). |
| `data[].taxes[].amount` | number | yes | Amount withheld (MontoRet). |
| `data[].taxes[].payment_type` | string | yes | Withholding payment type (TipoPagoRet): 01 final VAT, 02 final IEPS, 03 final ISR, 04 provisional ISR. By default the usual one for each tax. |
| `data[].dividends` | object |  | Dividends complement. |
| `data[].interest` | object |  | Interest complement. |
| `data[].foreign_payment` | object |  | Payments to foreigners complement: required with code 18, and with 01, 02, 04 and 05 when the recipient is foreign. |
| `data[].distributable_remainder` | object |  | Dividends complement with its Remanente node (distributable remainder), required with code 15. If you don't send it, it goes without a share. |
| `data[].trust_lease` | object |  | Lease in trust complement (Arrendamientoenfideicomiso 1.0), required with code 17. |
| `data[].share_sale` | object |  | Sale of shares or securities transactions complement (EnajenaciondeAcciones 1.0), required with code 06 and 19. |
| `data[].prize` | object |  | Prizes complement (Premios 1.0), required with code 20. Its amounts are those of totals. |
| `data[].trust` | object |  | Complement for trusts that don't carry out business activities (Fideicomisonoempresarial 1.0), required with code 21. |
| `data[].retirement_plan` | object |  | Personal retirement plans complement (Planesderetiro 1.1), required with code 22: the previous year's figures. |
| `data[].mortgage_interest` | object |  | Deductible real interest on mortgage loans complement (Intereseshipotecarios 1.0), required with code 23. |
| `data[].financial_derivatives` | object |  | Equity derivative financial operations complement (Operacionesconderivados 1.0), required with code 24. |
| `data[].platform` | object |  | Technology platform services complement (ServiciosPlataformasTecnologicas 1.0), required with code 26: one certificate per month, recipient and service type. totals and taxes are calculated from services with SAT's rates (ISR from LISR 113-A and LIF 2026 art. 25; VAT 50% or 100%; IEPS on betting); if you send them, they must match. |
| `data[].cancellation` | object or null | yes | The cancellation, if requested: status, reason, replacement and when. |
| `data[].cancellation.status` | string | yes | pending (the SAT has it: it finishes it in minutes or waits for the customer's answer), accepted (canceled), rejected (the customer rejected it), lapsed (it expired; you can request it again), scheduled (Fiscalisto requests it again on its own) or failed (Fiscalisto stopped trying; request it again). |
| `data[].cancellation.motive` | string or null | yes | Cancellation reason (c_MotivoCancelacion): 01 with errors, related (carries substitution), 02 with errors, not related (the default), 03 didn't take place, 04 only on a global invoice, when an included sale was invoiced in the customer's name. |
| `data[].cancellation.canceled_at` | string (date-time) or null | yes | When it was canceled. |
| `data[].email` | object or null | yes | The email send: to whom, cc to whom and when (null if it hasn't been sent). |
| `data[].email.to` | string or null | yes | To whom (emails separated by commas). |
| `data[].email.sent_at` | string (date-time) or null | yes | When it was sent. |
| `data[].error` | object or null | yes | Why the SAT or the PAC didn't accept it: message, SAT code and original text. |
| `data[].error.message` | string | yes | What happened and how to fix it, for a person. |
| `data[].error.sat_code` | string or null | yes | SAT or PAC code (CFDI40xxx). |
| `data[].error.raw` | string | yes | The PAC's original text. |
| `data[].created_at` | string (date-time) or null | yes | When it was created, ISO 8601 with Mexico City time (-06:00). |
| `data[].metadata` | object | yes | Your own data: up to 50 keys of 40 characters with text values of up to 500. They don't go into the CFDI; they come back in the object and in webhooks. |
| `data[].warnings` | array of string |  | Warnings that didn't prevent stamping (for example, the XML will be saved later). |
| `data[].email_error` | string |  | Why the email couldn't be sent; the receipt was stamped. |
| `data[].replaced` | object |  | Only when stamping with `replaces`: the certificate it corrects and whether it was canceled (reason 01). If not, `error` says why and it is canceled with POST /v1/sat_retentions/{id}/cancel. |
| `data[].replaced.uuid` | string | yes | Tax folio the SAT assigns (UUID of the Timbre Fiscal Digital), in uppercase. |
| `data[].replaced.canceled` | boolean | yes | true if the replaced one is already canceled. false isn't final: see substitutes.cancellation. |
| `data[].replaced.error` | string or null | yes | Why the previous one couldn't be canceled; `null` if it was canceled. |
| `has_more` | boolean | yes | true if there are more: request the next one with starting_after set to the id of the last one. |
| `url` | string | yes | This list's path. |

```json
{
  "object": "list",
  "data": [
    {
      "id": "ret_OufpKqnrvx9p5tENFcmUXpXJ58XxnF67kv",
      "object": "retention",
      "livemode": false,
      "issuer": "iss_OufpKqnrvx9p",
      "status": "valid",
      "uuid": "9A6F6BF3-6786-4747-800A-C9964E6509AE",
      "folio": 1,
      "internal_folio": "RET1",
      "date": "2026-10-24T10:15:42",
      "code": "01",
      "description": null,
      "recipient": {
        "foreign": false,
        "tax_id": "MASO451221PM4",
        "legal_name": "MARIA OLIVIA MARTINEZ SAGAZ",
        "zip": "80290",
        "curp": null
      },
      "period": {
        "year": 2026,
        "from_month": 9,
        "to_month": 9
      },
      "totals": {
        "operation": 10000,
        "taxed": 10000,
        "exempt": 0,
        "withheld": 2066.67
      },
      "taxes": [
        {
          "tax": "isr",
          "base": 10000,
          "amount": 1000,
          "payment_type": "04"
        },
        {
          "tax": "iva",
          "base": 10000,
          "amount": 1066.67,
          "payment_type": "01"
        }
      ],
      "cancellation": null,
      "email": null,
      "error": null,
      "created_at": "2026-10-24T10:15:42-06:00",
      "metadata": {
        "proveedor": "42"
      }
    }
  ],
  "has_more": false,
  "url": "/v1/retentions"
}
```

## 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.
