# Create an issuer

`POST https://api.fiscalisto.com/v1/issuers`

Adds an RFC that will stamp. Then upload its CSD (POST /v1/issuers/{id}/certificates) and, in production only, sign the contract with the PAC once with its e.firma (POST /v1/issuers/{id}/efirma).

## Before you call

- **A key for the whole account**: not limited to some issuers or to a test environment.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | header |  | Optional (the SDKs send it on their own). If the response is lost, repeat the request with the same value within 24 hours: it answers the same, with idempotent-replayed: true, and doesn't do it twice (it doesn't create, send emails or charge). |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `tax_id` | string | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `legal_name` | string | 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.»). (up to 300 characters) |
| `tax_system` | string | yes | Tax regime (RegimenFiscal), a c_RegimenFiscal key: 601, 612, 626… |
| `zip` | string | yes | 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. |
| `employer_registration` | string or null |  | Employer registration with IMSS (RegistroPatronal), 11 characters. Required to stamp payroll. |
| `curp` | string or null |  | CURP, 18 characters. |
| `donation_authorization` | object or null |  | Authorized donee (regime 603): SAT's letter that authorizes it to receive deductible donations (or its renewal). It goes on each donation receipt (`donation` in POST /v1/invoices); null removes it. The issuer must have tax_system 603. In test mode any number and a past date work. |
| `donation_authorization.number` | string | yes | Number of the authorization letter, up to 100 characters. (up to 100 characters) |
| `donation_authorization.date` | string | yes | Date of the letter, YYYY-MM-DD; it can't be in the future. |
| `metadata` | object |  | 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. |

Example:

```json
{
  "tax_id": "TOL190312KT4",
  "legal_name": "TOLPI",
  "tax_system": "601",
  "zip": "64000",
  "metadata": {
    "cliente": "42"
  }
}
```

## With the TypeScript SDK

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

// La llave viene de 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" },
}, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

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

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

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

## With the .NET SDK

```csharp
using Fiscalisto;

// La llave viene de 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" },
}, new RequestOptions { IdempotencyKey = "pedido-A-1042" });
```

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

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

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.CreateIssuerParams;
import java.util.Map;

// La llave viene de 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")), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(issuer.getId());
```

## Response 201

OK.

A `Issuer` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `object` | `"issuer"` | yes | What kind of object it is («invoice», «customer»…). |
| `source` | `api`, `empresa` | yes | api if you created it with the API or in Desarrolladores; empresa if it is an app empresa connected to your account (Desarrolladores › Emisores › Conectar una empresa): with it only its Portal de proveedores and, if they were turned on, its supplier payouts are used, and status is always active. |
| `type` | `own`, `connected`, `portal` | yes | own: an RFC of this API's empresa (the empresa adds it in the app; it isn't archived through the API). connected: a connected issuer, which your platform added with POST /v1/issuers. portal: another Fiscalisto empresa connected through your Portal de proveedores. |
| `tax_id` | string | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `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.»). |
| `tax_system` | string or null | yes | Tax regime (RegimenFiscal), a c_RegimenFiscal key: 601, 612, 626… |
| `zip` | string or null | yes | 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. |
| `status` | `active`, `needs_certificate`, `certificate_expired`, `needs_efirma`, `archived` | yes | active: it can stamp. needs_certificate: its CSD is missing. needs_efirma: it still has to sign the contract with the PAC once with its e.firma (production only). certificate_expired: its CSD expired. archived: archived. |
| `requirement` | string or null | yes | What the issuer is missing to stamp, and how to provide it. |
| `certificate` | object or null | yes | The uploaded digital seal (CSD): serial number and expiry. |
| `certificate.serial_number` | string or null | yes | Serial number (NoCertificado). |
| `certificate.expires_at` | string (date-time) or null | yes | When it expires. |
| `sat_downloads` | object | yes | Whether it can ask the SAT for its invoices (POST /v1/sat_downloads): available is true in test mode, and in production while its saved e.firma is valid (efirma_expires_at); an RFC of your empresa (type own) uses the one the empresa saved in the app. In test mode, efirma_expires_at shows the one for the same RFC in production, or the one you send in test mode. |
| `sat_downloads.available` | boolean | yes | true if it can request downloads from the SAT now: always in test mode; in production with its e.firma saved and valid (the app's, for an RFC of your empresa). |
| `sat_downloads.efirma_expires_at` | string (date-time) or null | yes | When the e.firma saved for downloads expires, or null if there isn't one. In test mode, the one you sent in test mode or, otherwise, the one saved in production for the same RFC. |
| `employer_registration` | string or null | yes | Employer registration with IMSS (RegistroPatronal), 11 characters. Required to stamp payroll. |
| `curp` | string or null | yes | CURP, 18 characters. |
| `donation_authorization` | object or null | yes | Authorized donee (regime 603): SAT's letter that authorizes it to receive deductible donations (or its renewal). It goes on each donation receipt (`donation` in POST /v1/invoices); null removes it. The issuer must have tax_system 603. In test mode any number and a past date work. |
| `donation_authorization.number` | string | yes | Number of the authorization letter, up to 100 characters. |
| `donation_authorization.date` | string or null | yes | Date of the letter, YYYY-MM-DD; it can't be in the future. |
| `stamps_as` | string | yes | RFC it stamps with: the issuer's in production and, in test mode, the SAT test taxpayer of its type: EKU9003173C9 for a persona moral, CACX7605101P8 for a persona física (with its CURP on payroll). It stamps with the issuer's tax regime and postal code. |
| `sandbox` | string or null | yes | The sandbox (sbx_…) it belongs to, or null if it belongs to the account. See /v1/sandboxes. |
| `test_clock` | object or null | yes | Its test clock (test issuers only): the time that is «today» for it, or null if it follows real time. See POST /v1/issuers/{id}/test_clock. |
| `test_clock.frozen_time` | string (date-time) | yes | The clock's time. |
| `created_at` | string (date-time) or null | yes | When it was created, ISO 8601 with Mexico City time (-06:00). |
| `archived_at` | string (date-time) or null | yes | When it was archived (it no longer stamps), or null. |
| `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. |

```json
{
  "id": "iss_OufpKqnrvx9p",
  "object": "issuer",
  "livemode": false,
  "source": "api",
  "type": "connected",
  "tax_id": "TOL190312KT4",
  "legal_name": "TOLPI",
  "tax_system": "601",
  "zip": "64000",
  "status": "active",
  "requirement": null,
  "certificate": {
    "serial_number": "30001000000500003416",
    "expires_at": "2027-05-18T05:43:51-06:00"
  },
  "sat_downloads": {
    "available": true,
    "efirma_expires_at": null
  },
  "employer_registration": null,
  "curp": null,
  "donation_authorization": null,
  "stamps_as": "EKU9003173C9",
  "sandbox": null,
  "test_clock": null,
  "created_at": "2026-10-24T10:15:42-06:00",
  "archived_at": null,
  "metadata": {
    "cliente": "42"
  }
}
```

## Errors

- `issuer_creation_limit` (429): 500 issuers were created in 24 hours. Write to us if you need more.
- `issuer_exists` (400): That RFC is already an issuer of the account in this mode.
- `key_restricted` (403): This key is limited to some issuers and the request touches another one (or creates one, or uses something of the whole account, like webhooks).

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