# Ver el catálogo de cuentas

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

Las cuentas que usan las pólizas, con su código agrupador del SAT.

## Parámetros

| Nombre | Dónde | Obligatorio | Descripción |
| --- | --- | --- | --- |
| `issuer` | consulta |  | El emisor (iss_…). Puede omitirse si la llave o la cuenta tienen uno solo. |

## Con el SDK de TypeScript

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

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

const { data } = await fiscalisto.accounting.accounts();
```

## Con el SDK de Python

```python
from fiscalisto import Fiscalisto

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

data = fiscalisto.accounting.accounts()["data"]
```

## Con el SDK de PHP

```php
<?php

use Fiscalisto\Fiscalisto;

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

$data = $fiscalisto->accounting->accounts()['data'];
```

## Con el SDK de .NET

```csharp
using Fiscalisto;

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

var ledgerAccountList = await fiscalisto.Accounting.AccountsAsync();
```

## Con el SDK de Go

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

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

## Con el SDK de Java

```java
import com.fiscalisto.FiscalistoClient;

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

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

## Respuesta 200

Correcto.

Un objeto `LedgerAccountList`:

| Campo | Tipo | Siempre viene | Descripción |
| --- | --- | --- | --- |
| `object` | `"list"` | sí | Qué tipo de objeto es («invoice», «customer»…). |
| `data` | arreglo de objeto | sí | Los objetos de esta página. |
| `data[].object` | `"ledger_account"` | sí | Qué tipo de objeto es («invoice», «customer»…). |
| `data[].number` | string | sí | El número de cuenta (NumCta). |
| `data[].name` | string | sí | Su nombre. |
| `data[].grouping_code` | string | sí | El código agrupador del SAT (Anexo 24). |
| `data[].nature` | `debit`, `credit` | sí | debit (deudora) o credit (acreedora). |
| `has_more` | boolean | sí | true si hay más: pida la siguiente con starting_after igual al id del último. |
| `url` | string | sí | La ruta de esta lista. |

```json
{
  "object": "list",
  "data": [
    {
      "object": "ledger_account",
      "number": "105-01",
      "name": "Clientes nacionales",
      "grouping_code": "105.01",
      "nature": "debit"
    }
  ],
  "has_more": false,
  "url": "/v1/accounting/accounts"
}
```

## Errores

Puede responder 400, 401, 403, 404, 429, 500 con el cuerpo de error de siempre; cada código está en https://fiscalisto.com/docs/api/errores.md.
