# Issuers

> Add the RFCs that stamp from your account, with their CSD and e.firma, and know at all times whether they can stamp yet.

An issuer is an RFC your account stamps for. Your company's RFCs are already production issuers (`type: "own"`): the company registers them in the app, with their CSD and e.firma, and the API reads them from there, so they aren't created or archived through the API. A platform that invoices on behalf of its customers adds a connected issuer for each one (`type: "connected"`), with `POST /v1/issuers`. All of them use the company's API timbres.

In a company with several RFCs, each `own` issuer sees its invoices, its withholdings and its SAT downloads, not those of the other RFCs; the catalogs (customers, products, series) belong to the whole company, as in the app.

## 1. Create the issuer

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/issuers \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tax_id": "TOL190312KT4",
    "legal_name": "TOLPI",
    "tax_system": "601",
    "zip": "64000",
    "metadata": { "cliente": "42" }
  }'
```

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

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

const issuer = await fiscalisto.issuers.create({
  tax_id: "TOL190312KT4",
  legal_name: "TOLPI",
  tax_system: "601",
  zip: "64000",
  metadata: { cliente: "42" },
});
```

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

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

issuer = fiscalisto.issuers.create({
    "tax_id": "TOL190312KT4",
    "legal_name": "TOLPI",
    "tax_system": "601",
    "zip": "64000",
    "metadata": {"cliente": "42"},
})
```

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

use Fiscalisto\Fiscalisto;

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

$issuer = $fiscalisto->issuers->create([
    'tax_id' => 'TOL190312KT4',
    'legal_name' => 'TOLPI',
    'tax_system' => '601',
    'zip' => '64000',
    'metadata' => ['cliente' => '42'],
]);
```

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

	issuer, err := client.Issuers.Create(ctx, &fiscalisto.CreateIssuerParams{
		TaxID:     "TOL190312KT4",
		LegalName: "TOLPI",
		TaxSystem: "601",
		Zip:       "64000",
		Metadata:  map[string]string{"cliente": "42"},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(issuer.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.CreateIssuerParams;
import java.util.Map;

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

var issuer = fiscalisto.issuers().create(new CreateIssuerParams()
        .setTaxId("TOL190312KT4")
        .setLegalName("TOLPI")
        .setTaxSystem("601")
        .setZip("64000")
        .setMetadata(Map.of("cliente", "42")));
System.out.println(issuer.getId());
```

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

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

var issuer = await fiscalisto.Issuers.CreateAsync(new CreateIssuerParams
{
    TaxId = "TOL190312KT4",
    LegalName = "TOLPI",
    TaxSystem = "601",
    Zip = "64000",
    Metadata = new() { ["cliente"] = "42" },
});
```

Write `legal_name`, `tax_system` and `zip` exactly as on the RFC's constancia de situación fiscal: SAT rejects documents if they don't match. The legal name goes without the capital regime (no «S.A. de C.V.»). The postal code is also the place of issue of its documents.

The response is the issuer with `status: "needs_certificate"` and, in `requirement`, what's missing.

## 2. Upload the CSD

The digital seal certificate (CSD) is what seals each document. It's requested from SAT with the e.firma and it's two files, `.cer` and `.key`, with their password. Send them in base64:

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/issuers/iss_OufpKqnrvx9p/certificates \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"cer\": \"$(base64 < CSD.cer | tr -d '\n')\",
    \"key\": \"$(base64 < CSD.key | tr -d '\n')\",
    \"password\": \"$CSD_PASSWORD\"
  }"
```

```ts tab="TypeScript"
import { readFile } from "node:fs/promises";
import { Fiscalisto } from "fiscalisto";

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

const issuer = await fiscalisto.issuers.uploadCertificate("iss_OufpKqnrvx9p", {
  cer: (await readFile("CSD.cer")).toString("base64"),
  key: (await readFile("CSD.key")).toString("base64"),
  password: process.env.CSD_PASSWORD!,
});
```

```python tab="Python"
import base64
import os

from fiscalisto import Fiscalisto

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

issuer = fiscalisto.issuers.upload_certificate("iss_OufpKqnrvx9p", {
    "cer": base64.b64encode(open("CSD.cer", "rb").read()).decode(),
    "key": base64.b64encode(open("CSD.key", "rb").read()).decode(),
    "password": os.environ["CSD_PASSWORD"],
})
```

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

use Fiscalisto\Fiscalisto;

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

$issuer = $fiscalisto->issuers->uploadCertificate('iss_OufpKqnrvx9p', [
    'cer' => base64_encode(file_get_contents('CSD.cer')),
    'key' => base64_encode(file_get_contents('CSD.key')),
    'password' => getenv('CSD_PASSWORD'),
]);
```

```go tab="Go"
package main

import (
	"encoding/base64"
	"context"
	"fmt"
	"log"
	"os"

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

	issuer, err := client.Issuers.UploadCertificate(ctx, "iss_OufpKqnrvx9p", &fiscalisto.UploadCertificateParams{
		Cer:      readBase64("CSD.cer"),
		Key:      readBase64("CSD.key"),
		Password: os.Getenv("CSD_PASSWORD"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(issuer.ID)
}

func readBase64(path string) string {
	b, err := os.ReadFile(path)
	if err != nil {
		log.Fatal(err)
	}
	return base64.StdEncoding.EncodeToString(b)
}
```

```java tab="Java"
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Base64;
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.UploadCertificateParams;

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

var issuer = fiscalisto.issuers().uploadCertificate("iss_OufpKqnrvx9p", new UploadCertificateParams()
        .setCer(Base64.getEncoder().encodeToString(Files.readAllBytes(Path.of("CSD.cer"))))
        .setKey(Base64.getEncoder().encodeToString(Files.readAllBytes(Path.of("CSD.key"))))
        .setPassword(System.getenv("CSD_PASSWORD")));
System.out.println(issuer.getId());
```

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

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

var issuer = await fiscalisto.Issuers.UploadCertificateAsync("iss_OufpKqnrvx9p", new UploadCertificateParams
{
    Cer = Convert.ToBase64String(File.ReadAllBytes("CSD.cer")),
    Key = Convert.ToBase64String(File.ReadAllBytes("CSD.key")),
    Password = Environment.GetEnvironmentVariable("CSD_PASSWORD")!,
});
```

Fiscalisto checks that it's a CSD (not an e.firma), that it belongs to that RFC, that it hasn't expired, that the `.key` matches and that the password opens it; if anything fails, it returns `certificate_invalid` with the reason. The files are stored encrypted and only used for sealing. When the CSD expires, upload the new one to the same path: the issuer keeps its documents and folios.

## 3. Sign with the e.firma (production only)

Before its first production timbre, each RFC signs the service contract with the PAC once, using its e.firma (formerly FIEL):

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/issuers/iss_OufpKqnrvx9p/efirma \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"cer\": \"$(base64 < efirma.cer | tr -d '\n')\",
    \"key\": \"$(base64 < efirma.key | tr -d '\n')\",
    \"password\": \"$EFIRMA_PASSWORD\"
  }"
```

```ts tab="TypeScript"
import { readFile } from "node:fs/promises";
import { Fiscalisto } from "fiscalisto";

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

const issuer = await fiscalisto.issuers.signEfirma("iss_OufpKqnrvx9p", {
  cer: (await readFile("efirma.cer")).toString("base64"),
  key: (await readFile("efirma.key")).toString("base64"),
  password: process.env.EFIRMA_PASSWORD!,
});
```

```python tab="Python"
import base64
import os

from fiscalisto import Fiscalisto

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

issuer = fiscalisto.issuers.sign_efirma("iss_OufpKqnrvx9p", {
    "cer": base64.b64encode(open("efirma.cer", "rb").read()).decode(),
    "key": base64.b64encode(open("efirma.key", "rb").read()).decode(),
    "password": os.environ["EFIRMA_PASSWORD"],
})
```

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

use Fiscalisto\Fiscalisto;

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

$issuer = $fiscalisto->issuers->signEfirma('iss_OufpKqnrvx9p', [
    'cer' => base64_encode(file_get_contents('efirma.cer')),
    'key' => base64_encode(file_get_contents('efirma.key')),
    'password' => getenv('EFIRMA_PASSWORD'),
]);
```

```go tab="Go"
package main

import (
	"encoding/base64"
	"context"
	"fmt"
	"log"
	"os"

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

	issuer, err := client.Issuers.SignEfirma(ctx, "iss_OufpKqnrvx9p", &fiscalisto.SignEfirmaParams{
		Cer:      readBase64("efirma.cer"),
		Key:      readBase64("efirma.key"),
		Password: os.Getenv("EFIRMA_PASSWORD"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(issuer.ID)
}

func readBase64(path string) string {
	b, err := os.ReadFile(path)
	if err != nil {
		log.Fatal(err)
	}
	return base64.StdEncoding.EncodeToString(b)
}
```

```java tab="Java"
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Base64;
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.SignEfirmaParams;

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

var issuer = fiscalisto.issuers().signEfirma("iss_OufpKqnrvx9p", new SignEfirmaParams()
        .setCer(Base64.getEncoder().encodeToString(Files.readAllBytes(Path.of("efirma.cer"))))
        .setKey(Base64.getEncoder().encodeToString(Files.readAllBytes(Path.of("efirma.key"))))
        .setPassword(System.getenv("EFIRMA_PASSWORD")));
System.out.println(issuer.getId());
```

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

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

var issuer = await fiscalisto.Issuers.SignEfirmaAsync("iss_OufpKqnrvx9p", new SignEfirmaParams
{
    Cer = Convert.ToBase64String(File.ReadAllBytes("efirma.cer")),
    Key = Convert.ToBase64String(File.ReadAllBytes("efirma.key")),
    Password = Environment.GetEnvironmentVariable("EFIRMA_PASSWORD")!,
});
```

The e.firma is used at that moment to sign and isn't stored. If you send the CSD instead of the e.firma, or another RFC's, it returns `efirma_invalid`. To ask SAT for the issuer's invoices, add `"keep_for_downloads": true` and it's stored encrypted (see [SAT downloads](https://fiscalisto.com/en/docs/api/descargas-del-sat)).

## Let your customer upload their files

If you invoice on behalf of your customers, the easiest way is not to ask them for their files: send them to a Fiscalisto page where they upload their CSD and sign with their e.firma. Neither the files nor the passwords go through your platform.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/issuers/iss_OufpKqnrvx9p/onboarding_links \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "return_url": "https://miplataforma.mx/configuracion/facturas" }'
```

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

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

const issuerOnboardingLink = await fiscalisto.issuers.createOnboardingLink("iss_OufpKqnrvx9p", {
  return_url: "https://miplataforma.mx/configuracion/facturas",
});
```

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

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

issuer_onboarding_link = fiscalisto.issuers.create_onboarding_link("iss_OufpKqnrvx9p", {
    "return_url": "https://miplataforma.mx/configuracion/facturas",
})
```

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

use Fiscalisto\Fiscalisto;

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

$issuerOnboardingLink = $fiscalisto->issuers->createOnboardingLink('iss_OufpKqnrvx9p', [
    'return_url' => 'https://miplataforma.mx/configuracion/facturas',
]);
```

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

	issuerOnboardingLink, err := client.Issuers.CreateOnboardingLink(ctx, "iss_OufpKqnrvx9p", &fiscalisto.CreateIssuerOnboardingLinkParams{
		ReturnURL: fiscalisto.String("https://miplataforma.mx/configuracion/facturas"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *issuerOnboardingLink)
}
```

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

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

var issuerOnboardingLink = fiscalisto.issuers().createOnboardingLink("iss_OufpKqnrvx9p", new CreateIssuerOnboardingLinkParams()
        .setReturnUrl("https://miplataforma.mx/configuracion/facturas"));
System.out.println(issuerOnboardingLink);
```

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

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

var issuerOnboardingLink = await fiscalisto.Issuers.CreateOnboardingLinkAsync("iss_OufpKqnrvx9p", new CreateIssuerOnboardingLinkParams
{
    ReturnUrl = "https://miplataforma.mx/configuracion/facturas",
});
```

```json
{
  "object": "issuer_onboarding_link",
  "issuer": "iss_OufpKqnrvx9p",
  "url": "https://fiscalisto.com/alta/fko_…",
  "return_url": "https://miplataforma.mx/configuracion/facturas",
  "keep_efirma": false,
  "expires_at": "2026-10-25T10:15:00-06:00"
}
```

Open `url` in your customer's browser (with a link or a redirect, not inside an iframe). The page asks only for what's missing: the CSD, the contract signature or both, checks them before sending (that they belong to that RFC, are current and the password opens the key) and when done shows **Volver a** (back to) your platform, which goes to `return_url`. At that moment the `issuer.ready` event arrives.

### Also keep their e.firma

If your platform queries SAT for your customer, create the link with `"keep_efirma": true`. The page explains what their e.firma brings (their issued and received invoices, their tax returns up to 5 years back with their payments, their compliance opinion, their tax status certificate, their SAT mailbox and their annual return preload), that it's stored encrypted and only used to query, and asks them to confirm they're the holder or have the holder's authorization. The same e.firma signs the PAC's contract and is kept as with `keep_for_downloads`, so you can use [SAT downloads](https://fiscalisto.com/en/docs/api/descargas-del-sat), [SAT tax returns](https://fiscalisto.com/en/docs/api/declaraciones-del-sat) and [SAT compliance](https://fiscalisto.com/en/docs/api/cumplimiento-sat) without touching their files.

```json
{ "return_url": "https://miplataforma.mx/configuracion/facturas", "keep_efirma": true }
```

If you'll only query SAT for your customer and not stamp for them, use `"efirma_only": true`: the page asks only for the e.firma, without the CSD, and stores it the same way (it implies `keep_efirma`). The issuer stays `needs_certificate` until it uploads its CSD, and `issuer.ready` doesn't arrive.

The e.firma step stays pending until it's stored, even if the contract is already signed. `issuer.ready` tells you when the issuer can stamp; to know whether their e.firma is stored, check the issuer's `sat_downloads.available`. To erase it later, use `DELETE /v1/issuers/{id}/efirma`.

The link works for 24 hours (up to 168 with `expires_in_hours`) and only for that issuer; create another when you need it, for example when its CSD is about to expire. After 20 attempts with wrong files or passwords it stops working. In test mode the page checks the files without storing them and has **Completar en pruebas**, so you can try the whole flow without a real CSD.

## Statuses

| `status` | What it means | What to do |
| --- | --- | --- |
| `active` | It can stamp. | Nothing. |
| `needs_certificate` | Its CSD is missing. | Step 2. |
| `needs_efirma` | The PAC contract isn't signed yet. | Step 3. |
| `certificate_expired` | Its CSD expired. | Upload the new one (step 2). |
| `archived` | It no longer stamps. | Create another issuer if you need it. |

`certificate.expires_at` says when the CSD expires: warn your customer before that date. When a production issuer becomes `active` (through the API, the dashboard or an onboarding link) the `issuer.ready` event arrives.

## Test mode

In test mode you need neither the CSD nor the e.firma: a test issuer is born `active` and stamps as SAT's test taxpayer of its kind (`stamps_as`: `EKU9003173C9` if its RFC is a company's, `CACX7605101P8` if it's an individual's), with the regime you give it and its postal code as the place of issue. A test issuer that is an individual stamps its payroll with the test CURP `CACX760510MGTSHC04`, even if you send another. If you upload a CSD in test mode it's checked as in production, so you can test your flow, but stamping still uses the test one.

## Payroll

To stamp payroll receipts, the issuer needs its employer registration (`employer_registration`) and, if it's an individual, its `curp`:

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/issuers/iss_OufpKqnrvx9p \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "employer_registration": "Y5412345109" }'
```

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

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

const issuer = await fiscalisto.issuers.update("iss_OufpKqnrvx9p", { employer_registration: "Y5412345109" });
```

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

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

issuer = fiscalisto.issuers.update("iss_OufpKqnrvx9p", {"employer_registration": "Y5412345109"})
```

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

use Fiscalisto\Fiscalisto;

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

$issuer = $fiscalisto->issuers->update('iss_OufpKqnrvx9p', ['employer_registration' => 'Y5412345109']);
```

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

	issuer, err := client.Issuers.Update(ctx, "iss_OufpKqnrvx9p", &fiscalisto.UpdateIssuerParams{
		EmployerRegistration: fiscalisto.String("Y5412345109"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(issuer.ID)
}
```

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

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

var issuer = fiscalisto.issuers().update("iss_OufpKqnrvx9p", new UpdateIssuerParams().setEmployerRegistration("Y5412345109"));
System.out.println(issuer.getId());
```

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

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

var issuer = await fiscalisto.Issuers.UpdateAsync("iss_OufpKqnrvx9p", new UpdateIssuerParams
{
    EmployerRegistration = "Y5412345109",
});
```

## Authorized donees

An authorized donee issues donation receipts (`donation` in `POST /v1/invoices`, see [Complements](https://fiscalisto.com/en/docs/api/complementos#example-donation-receipt)). For that the issuer uses regime `603` (non-profit companies) and SAT's authorization letter, or its renewal, in `donation_authorization`: the number and the date (YYYY-MM-DD, not in the future). It goes on each receipt; `null` removes it.

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/issuers/iss_OufpKqnrvx9p \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "tax_system": "603", "donation_authorization": { "number": "600-04-02-2026-12345", "date": "2026-01-15" } }'
```

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

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

const issuer = await fiscalisto.issuers.update("iss_OufpKqnrvx9p", {
  tax_system: "603",
  donation_authorization: {
    number: "600-04-02-2026-12345",
    date: "2026-01-15",
  },
});
```

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

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

issuer = fiscalisto.issuers.update("iss_OufpKqnrvx9p", {
    "tax_system": "603",
    "donation_authorization": {
        "number": "600-04-02-2026-12345",
        "date": "2026-01-15",
    },
})
```

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

use Fiscalisto\Fiscalisto;

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

$issuer = $fiscalisto->issuers->update('iss_OufpKqnrvx9p', [
    'tax_system' => '603',
    'donation_authorization' => [
        'number' => '600-04-02-2026-12345',
        'date' => '2026-01-15',
    ],
]);
```

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

	issuer, err := client.Issuers.Update(ctx, "iss_OufpKqnrvx9p", &fiscalisto.UpdateIssuerParams{
		TaxSystem: fiscalisto.String("603"),
		DonationAuthorization: &fiscalisto.UpdateIssuerParamsDonationAuthorization{
			Number: "600-04-02-2026-12345",
			Date:   "2026-01-15",
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(issuer.ID)
}
```

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

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

var issuer = fiscalisto.issuers().update("iss_OufpKqnrvx9p", new UpdateIssuerParams()
        .setTaxSystem("603")
        .setDonationAuthorization(new UpdateIssuerParamsDonationAuthorization()
                .setNumber("600-04-02-2026-12345")
                .setDate("2026-01-15")));
System.out.println(issuer.getId());
```

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

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

var issuer = await fiscalisto.Issuers.UpdateAsync("iss_OufpKqnrvx9p", new UpdateIssuerParams
{
    TaxSystem = "603",
    DonationAuthorization = new()
    {
        Number = "600-04-02-2026-12345",
        Date = "2026-01-15",
    },
});
```

You can also send them when creating the issuer. In test mode any number and a past date work: a test issuer with `tax_system: "603"` stamps as a donee (SAT's test taxpayer with regime 603), so you can test your donation receipts end to end before going to production. If you stamp a donation without the authorization, the response is `invoice_invalid` and says what to send.

## Your PDF's design

Each issuer has its own design, the same as **Ajustes › Marca y documentos** in the app: its trade name, one of four styles (`clasico`, `moderno`, `compacto` or `minimalista`), its color and its logo. It goes on the PDF of its invoices, credit notes, payments, payroll receipts and quotes, in its emails and on the invoice page your customer sees, including what it already stamped. Change it with [`POST /v1/issuers/{id}/branding`](https://fiscalisto.com/en/docs/api/referencia/emisores/update-issuer-branding); what you don't send stays as it is, and `null` goes back to the default:

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/issuers/iss_OufpKqnrvx9p/branding \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "trade_name": "Tolpi", "pdf_style": "moderno", "pdf_color": "#0F766E" }'
```

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

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

const issuerBranding = await fiscalisto.issuers.updateBranding("iss_OufpKqnrvx9p", {
  trade_name: "Tolpi",
  pdf_style: "moderno",
  pdf_color: "#0F766E",
});
```

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

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

issuer_branding = fiscalisto.issuers.update_branding("iss_OufpKqnrvx9p", {
    "trade_name": "Tolpi",
    "pdf_style": "moderno",
    "pdf_color": "#0F766E",
})
```

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

use Fiscalisto\Fiscalisto;

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

$issuerBranding = $fiscalisto->issuers->updateBranding('iss_OufpKqnrvx9p', [
    'trade_name' => 'Tolpi',
    'pdf_style' => 'moderno',
    'pdf_color' => '#0F766E',
]);
```

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

	issuerBranding, err := client.Issuers.UpdateBranding(ctx, "iss_OufpKqnrvx9p", &fiscalisto.UpdateIssuerBrandingParams{
		TradeName: fiscalisto.String("Tolpi"),
		PDFStyle:  fiscalisto.String("moderno"),
		PDFColor:  fiscalisto.String("#0F766E"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *issuerBranding)
}
```

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

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

var issuerBranding = fiscalisto.issuers().updateBranding("iss_OufpKqnrvx9p", new UpdateIssuerBrandingParams()
        .setTradeName("Tolpi")
        .setPdfStyle("moderno")
        .setPdfColor("#0F766E"));
System.out.println(issuerBranding);
```

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

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

var issuerBranding = await fiscalisto.Issuers.UpdateBrandingAsync("iss_OufpKqnrvx9p", new UpdateIssuerBrandingParams
{
    TradeName = "Tolpi",
    PdfStyle = "moderno",
    PdfColor = "#0F766E",
});
```

Upload the logo (PNG or JPG up to 1 MB, in base64) with [`POST /v1/issuers/{id}/logo`](https://fiscalisto.com/en/docs/api/referencia/emisores/upload-issuer-logo), and remove it with `DELETE`. One with many pixels is scaled down so the PDF stays light. A test issuer has its design apart from production's, so you can try styles without changing what your customers see. A [branch](https://fiscalisto.com/en/docs/api/sucursales) can carry its own name, style and color (`trade_name`, `pdf_style`, `pdf_color`), which replace the issuer's on what's invoiced from it. The PDF's language is chosen on each invoice with `pdf_language`.

## Setting changes

Each change to the company's automatic collections or schedule settings is recorded, whether it came from the app, the API or an assistant, like **Ajustes › Cambios** in the app: which setting (`setting`), from what to what (`before`, `after`, as the app writes them), who (`changed_by`) and through where (`source`). [`GET /v1/setting_changes`](https://fiscalisto.com/en/docs/api/referencia/emisores/list-setting-changes) lists them newest first; `setting` keeps only one setting's:

```bash tab="cURL"
curl -G https://api.fiscalisto.com/v1/setting_changes \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -d setting=cobranza.dias-credito
```

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

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

for await (const item of fiscalisto.settingChanges.list({ setting: "cobranza.dias-credito" })) {
  console.log(item.id);
}
```

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

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

for item in fiscalisto.setting_changes.list({"setting": "cobranza.dias-credito"}):
    print(item["id"])
```

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

use Fiscalisto\Fiscalisto;

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

foreach ($fiscalisto->settingChanges->list(['setting' => 'cobranza.dias-credito']) as $item) {
    echo $item['id'], "\n";
}
```

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

	for item, err := range client.SettingChanges.ListAutoPaging(ctx, &fiscalisto.ListSettingChangesParams{
		Setting: fiscalisto.String("cobranza.dias-credito"),
	}) {
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(item.ID)
	}
}
```

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

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

for (var item : fiscalisto.settingChanges().listAutoPaging(new ListSettingChangesParams().setSetting("cobranza.dias-credito"))) {
    System.out.println(item.getId());
}
```

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

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

await foreach (var item in fiscalisto.SettingChanges.ListAutoPagingAsync(new ListSettingChangesParams
{
    Setting = "cobranza.dias-credito",
}))
    Console.WriteLine(item.Id);
```

`undoable` says whether a change can still be undone: only each setting's newest. [`POST /v1/setting_changes/{id}/undo`](https://fiscalisto.com/en/docs/api/referencia/emisores/undo-setting-change) puts the setting back and returns the new change that made, which can be undone too. If the setting changed again since, it answers `400 setting_change_not_undoable`:

```bash tab="cURL"
curl -X POST https://api.fiscalisto.com/v1/setting_changes/scg_8d2KxQ4bZ1mN7pR3/undo \
  -H "Authorization: Bearer $FISCALISTO_API_KEY"
```

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

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

const settingChange = await fiscalisto.settingChanges.undo("scg_8d2KxQ4bZ1mN7pR3");
```

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

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

setting_change = fiscalisto.setting_changes.undo("scg_8d2KxQ4bZ1mN7pR3")
```

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

use Fiscalisto\Fiscalisto;

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

$settingChange = $fiscalisto->settingChanges->undo('scg_8d2KxQ4bZ1mN7pR3');
```

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

	settingChange, err := client.SettingChanges.Undo(ctx, "scg_8d2KxQ4bZ1mN7pR3")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(settingChange.ID)
}
```

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

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

var settingChange = fiscalisto.settingChanges().undo("scg_8d2KxQ4bZ1mN7pR3");
System.out.println(settingChange.getId());
```

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

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

var settingChange = await fiscalisto.SettingChanges.UndoAsync("scg_8d2KxQ4bZ1mN7pR3");
```

## Archive

[`DELETE /v1/issuers/{id}`](https://fiscalisto.com/en/docs/api/referencia/emisores/archive-issuer) archives the issuer: it stops stamping, but its documents remain available and can be cancelled. An issuer's RFC doesn't change; if you made a mistake, archive it and create another.
