# Change the self-invoicing rules

`POST https://api.fiscalisto.com/v1/issuers/{id}/self_invoicing`

Until when a receipt can be invoiced and how often the global invoice is stamped.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | The object's id. |
| `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 |
| --- | --- | --- | --- |
| `window` | `month`, `days` |  | Until when a receipt can be invoiced: `month`, until the end of the sale's month (the usual with SAT); `days`, `window_days` days later. |
| `window_days` | integer |  | Days to invoice with `window: days`. (from 1 to 365) |
| `global_periodicity` | `01`, `02`, `03`, `04` |  | c_Periodicidad of the global invoice with the receipts nobody invoiced: 01 daily, 02 weekly, 03 every two weeks, 04 monthly. |
| `global_invoice` | `auto`, `off` |  | `auto` (the default): the receipts nobody invoiced go on their own into the global invoice when their period ends. `off`: Fiscalisto doesn't make a global invoice of the receipts (for example, because your point of sale already makes it); they stay pending and you answer for them before SAT. |
| `ask_total` | boolean |  | `true` (the default): the buyer finds their receipt with the code and the total. `false`: with the code only (its 4 random characters; each receipt locks after several failed attempts). |
| `portal_title` | string or null |  | The portal's title, instead of «Facture su ticket». `null` removes it. |
| `portal_message` | string or null |  | A message under the title (instructions, hours, whom to write to). `null` removes it. |
| `code_hint` | string or null |  | Where the buyer finds their code, under the field («Viene en su correo de salida»). `null` sets Fiscalisto's. |
| `portal_theme` | `auto`, `light`, `dark` |  | The portal's theme: `auto` (the default), that of the buyer's device, which they can change; `light` or `dark`, always that one. It applies on its page, its QRs and inside your site (unless the embed code picks another). |
| `portal_accent` | string or null |  | The color of the portal's buttons, like `#0b7c77`. `null` sets Fiscalisto's. |
| `portal_radius` | integer or null |  | How rounded the portal's corners are, in pixels (0 to 24). `null` sets Fiscalisto's (10). |
| `portal_style` | object or null |  | Everything else about how the portal looks (Autofactura › Cómo se ve el portal): layout, header, colors, font, borders, texts in Spanish and English, the ways to give the data, the button to go back to your site and custom CSS. Send only what changes: `colors`, `ways` and `texts` are merged by key (a text set to `null` removes it); the rest is replaced. `null` takes everything back to Fiscalisto's design. The «Facturado con Fiscalisto» legend can't be hidden. |
| `portal_style.layout` | `checkout`, `compact`, `card` |  | `checkout` (the default): the invoice fills in next to the form. `compact`: just the form, the invoice folded. `card`: the form in a card in the center. |
| `portal_style.density` | `comfortable`, `compact` |  | `comfortable` or `compact`. |
| `portal_style.header` | `logo`, `name`, `name_rfc`, `logo_name` |  | What it says at the top: `name_rfc` (the default), `name`, `logo_name` or `logo`. The logo and the name come from Marca y documentos. |
| `portal_style.logo_size` | `s`, `m`, `l` |  | The logo's size: `s`, `m` or `l`. |
| `portal_style.logo_shape` | `square`, `rounded`, `circle` |  | The logo's shape: `square`, `rounded` or `circle`. |
| `portal_style.colors` | object |  | The page's colors; each one is merged with what's saved. |
| `portal_style.colors.background` | string or null |  | The page's background, like `#f5f1e8`; `null` uses the theme's. |
| `portal_style.colors.card` | string or null |  | The background of fields and cards, like `#f5f1e8`; `null` uses the theme's. |
| `portal_style.colors.text` | string or null |  | The text, like `#f5f1e8`; `null` uses the theme's. |
| `portal_style.colors.button_text` | string or null |  | The buttons' text, like `#f5f1e8`; `null` uses the theme's. |
| `portal_style.font` | `system`, `inter`, `manrope`, `dm-sans`, `work-sans`, `nunito`, `space-grotesk`, `montserrat`, `lora`, `merriweather`, `playfair-display`, `cormorant-garamond` |  | The font: `system` (the default) or one from Google Fonts. |
| `portal_style.heading_font` | `system`, `inter`, `manrope`, `dm-sans`, `work-sans`, `nunito`, `space-grotesk`, `montserrat`, `lora`, `merriweather`, `playfair-display`, `cormorant-garamond` or null |  | The titles' font; `null`, the same as the text. |
| `portal_style.heading_size` | `s`, `m`, `l` |  | The title's size: `s`, `m` or `l`. |
| `portal_style.borders` | `none`, `subtle`, `strong` |  | The borders: `none`, `subtle` (the default) or `strong`. |
| `portal_style.shadow` | `none`, `soft`, `strong` |  | The shadow: `none`, `soft` (the default) or `strong`. |
| `portal_style.noun` | `ticket`, `nota`, `cuenta`, `compra`, `pedido`, `orden`, `reservacion`, `estancia`, `boleto` |  | What the portal calls what's invoiced, in all its texts: `ticket` (the default), `nota`, `cuenta`, `compra`, `pedido`, `orden`, `reservacion`, `estancia` or `boleto`. A hotel uses `reservacion`: «Esta reservación ya se facturó». |
| `portal_style.texts` | object |  | The texts, each with `es` and `en`, merged by key with what's saved. The Spanish title, message and where the code comes are `portal_title`, `portal_message` and `code_hint`; here they go in English. |
| `portal_style.texts.title` | object or null |  | The title (in Spanish it's `portal_title`); `null` goes back to Fiscalisto's. |
| `portal_style.texts.title.en` | string |  | The title (in Spanish it's `portal_title`) in English. (up to 300 characters) |
| `portal_style.texts.message` | object or null |  | The message under the title (in Spanish it's `portal_message`); `null` goes back to Fiscalisto's. |
| `portal_style.texts.message.en` | string |  | The message under the title (in Spanish it's `portal_message`) in English. (up to 300 characters) |
| `portal_style.texts.code_hint` | object or null |  | Where the code comes (in Spanish it's `code_hint`); `null` goes back to Fiscalisto's. |
| `portal_style.texts.code_hint.en` | string |  | Where the code comes (in Spanish it's `code_hint`) in English. (up to 300 characters) |
| `portal_style.texts.step_ticket` | object or null |  | The name of step 1; `null` goes back to Fiscalisto's. |
| `portal_style.texts.step_ticket.es` | string |  | The name of step 1 in Spanish. (up to 300 characters) |
| `portal_style.texts.step_ticket.en` | string |  | The name of step 1 in English. (up to 300 characters) |
| `portal_style.texts.step_data` | object or null |  | The name of step 2; `null` goes back to Fiscalisto's. |
| `portal_style.texts.step_data.es` | string |  | The name of step 2 in Spanish. (up to 300 characters) |
| `portal_style.texts.step_data.en` | string |  | The name of step 2 in English. (up to 300 characters) |
| `portal_style.texts.step_invoice` | object or null |  | The name of step 3; `null` goes back to Fiscalisto's. |
| `portal_style.texts.step_invoice.es` | string |  | The name of step 3 in Spanish. (up to 300 characters) |
| `portal_style.texts.step_invoice.en` | string |  | The name of step 3 in English. (up to 300 characters) |
| `portal_style.texts.find_button` | object or null |  | The button to find the receipt; `null` goes back to Fiscalisto's. |
| `portal_style.texts.find_button.es` | string |  | The button to find the receipt in Spanish. (up to 300 characters) |
| `portal_style.texts.find_button.en` | string |  | The button to find the receipt in English. (up to 300 characters) |
| `portal_style.texts.how_question` | object or null |  | The question about how to give the data; `null` goes back to Fiscalisto's. |
| `portal_style.texts.how_question.es` | string |  | The question about how to give the data in Spanish. (up to 300 characters) |
| `portal_style.texts.how_question.en` | string |  | The question about how to give the data in English. (up to 300 characters) |
| `portal_style.texts.submit` | object or null |  | The button to invoice; `null` goes back to Fiscalisto's. |
| `portal_style.texts.submit.es` | string |  | The button to invoice in Spanish. (up to 300 characters) |
| `portal_style.texts.submit.en` | string |  | The button to invoice in English. (up to 300 characters) |
| `portal_style.texts.success_title` | object or null |  | The title when finished; `null` goes back to Fiscalisto's. |
| `portal_style.texts.success_title.es` | string |  | The title when finished in Spanish. (up to 300 characters) |
| `portal_style.texts.success_title.en` | string |  | The title when finished in English. (up to 300 characters) |
| `portal_style.texts.success_message` | object or null |  | The message when finished; `null` goes back to Fiscalisto's. |
| `portal_style.texts.success_message.es` | string |  | The message when finished in Spanish. (up to 300 characters) |
| `portal_style.texts.success_message.en` | string |  | The message when finished in English. (up to 300 characters) |
| `portal_style.texts.error_help` | object or null |  | What the portal says before your email and phone when the invoice couldn't be made («¿Sigue con problemas?»); `null` goes back to Fiscalisto's. |
| `portal_style.texts.error_help.es` | string |  | What the portal says before your email and phone when the invoice couldn't be made («¿Sigue con problemas?») in Spanish. (up to 300 characters) |
| `portal_style.texts.error_help.en` | string |  | What the portal says before your email and phone when the invoice couldn't be made («¿Sigue con problemas?») in English. (up to 300 characters) |
| `portal_style.texts.concepts_title` | object or null |  | The title of the line item choice («Conceptos en su factura»; see `invoice_concepts`); `null` goes back to Fiscalisto's. |
| `portal_style.texts.concepts_title.es` | string |  | The title of the line item choice («Conceptos en su factura»; see `invoice_concepts`) in Spanish. (up to 300 characters) |
| `portal_style.texts.concepts_title.en` | string |  | The title of the line item choice («Conceptos en su factura»; see `invoice_concepts`) in English. (up to 300 characters) |
| `portal_style.texts.concepts_itemized` | object or null |  | The itemized line items option («Desglosados»); `null` goes back to Fiscalisto's. |
| `portal_style.texts.concepts_itemized.es` | string |  | The itemized line items option («Desglosados») in Spanish. (up to 300 characters) |
| `portal_style.texts.concepts_itemized.en` | string |  | The itemized line items option («Desglosados») in English. (up to 300 characters) |
| `portal_style.texts.concepts_single` | object or null |  | The single line item option («Un solo concepto»); `null` goes back to Fiscalisto's. |
| `portal_style.texts.concepts_single.es` | string |  | The single line item option («Un solo concepto») in Spanish. (up to 300 characters) |
| `portal_style.texts.concepts_single.en` | string |  | The single line item option («Un solo concepto») in English. (up to 300 characters) |
| `portal_style.texts.concepts_grouped` | object or null |  | The line items by category option («Por categoría»); `null` goes back to Fiscalisto's. |
| `portal_style.texts.concepts_grouped.es` | string |  | The line items by category option («Por categoría») in Spanish. (up to 300 characters) |
| `portal_style.texts.concepts_grouped.en` | string |  | The line items by category option («Por categoría») in English. (up to 300 characters) |
| `portal_style.texts.detail_label` | object or null |  | The line item detail checkbox («Incluir el detalle en la descripción…»; see `invoice_concepts.line_detail`); `null` goes back to Fiscalisto's. |
| `portal_style.texts.detail_label.es` | string |  | The line item detail checkbox («Incluir el detalle en la descripción…»; see `invoice_concepts.line_detail`) in Spanish. (up to 300 characters) |
| `portal_style.texts.detail_label.en` | string |  | The line item detail checkbox («Incluir el detalle en la descripción…»; see `invoice_concepts.line_detail`) in English. (up to 300 characters) |
| `portal_style.ways` | object |  | The ways to give their data besides typing it. All `true` by default except `norfc`. |
| `portal_style.ways.constancia` | boolean |  | Offer uploading the constancia (PDF). |
| `portal_style.ways.qr` | boolean |  | Offer scanning the constancia's QR. |
| `portal_style.ways.cif` | boolean |  | Offer looking up the data with RFC and idCIF. |
| `portal_style.ways.recall` | boolean |  | Offer «Ya le hemos facturado antes» (RFC and email). |
| `portal_style.ways.abroad` | boolean |  | Offer invoicing customers abroad (the tax ID is optional). |
| `portal_style.ways.norfc` | boolean |  | Offer «No tengo RFC»: invoice in the person's name with XAXX010101000, regime 616, use S01 and the issuer's postal code. `false` by default. |
| `portal_style.email_required` | boolean |  | `true`: no invoice without an email. `false` by default. |
| `portal_style.show_deadline` | boolean |  | Say until when it can be invoiced. `true` by default. |
| `portal_style.back` | object or null |  | A button when finished to go back to your site; `null` removes it. |
| `portal_style.back.label` | string | yes | The button's text. (up to 60 characters) |
| `portal_style.back.url` | string (uri) | yes | Where it goes (https). (up to 500 characters) |
| `portal_style.css` | string |  | Custom CSS, inside the portal and without reaching its footer. @import, url() and whatever loads or runs something are stripped; the «Facturado con Fiscalisto» legend stays. (up to 10000 characters) |
| `retention_mode` | `keep_total`, `subtract` |  | When a persona moral invoices and withholds (1.25% ISR to an issuer in RESICO, article 113-J of the LISR, or whatever the product says): `keep_total` (the default), the base grows so the invoice adds up to what was paid; `subtract`, the base is the receipt's and the withholding is subtracted, so the invoice's total is less than what was paid. |
| `invoice_series` | string or null |  | The series of the invoices buyers make themselves on the portal (and those issued from a receipt), like `AF`: up to 25 characters, without `\|`. `null` or an empty one uses the issuer's invoice series. The global invoice keeps the usual series. |
| `customer_notes` | boolean |  | `true`: the portal asks the buyer for a note for their invoice's PDF (up to 500 characters; Autofactura › Nota del cliente). It only shows on the PDF, never in the XML. `false` by default. |
| `failure_email` | boolean |  | `true` (default): when a buyer can't invoice because of something on the issuer's side (its CSD, its data, the PAC), the owners and admins get an email. `false`: it only stays in Alertas, no email. An error in the buyer's own data never alerts: the portal tells them how to fix it. |
| `split_max` | integer |  | Splitting a receipt into several invoices (Autofactura › Reglas de los tickets): the most invoices one receipt can have, from 2 to 50, counting the one that takes all that's left. `0` (the default): the buyer can't split it. Each invoice uses a stamp. (from 0 to 50) |
| `split_min` | number |  | The least each invoice of a split receipt can be, taxes included (100 by default). Less than this can't be left to invoice either, except by the invoice that takes all that's left. (from 0.01 to 1000000) |
| `split_same` | boolean |  | `true` (the default): a buyer can make several invoices with the same details at once (4 of 250 from a 1,000 receipt). `false`: one per person. |
| `invoice_concepts` | object or null |  | The line items of the invoice the buyer makes (Autofactura › Conceptos de la factura): itemized or in one, and whether the buyer can choose. Send only what changes; `null` goes back to itemized without a choice. |
| `invoice_concepts.mode` | `itemized`, `single`, `grouped` |  | `itemized` (the default): one line item per receipt row (Hospedaje, Restaurante, Bar…). `single`: just one, with `description`. `grouped`: the line items of `groups`. A line item carries a single set of taxes, so rows with others (a night with ISH, 0% VAT, withholdings) go separately. The total and the taxes don't change. |
| `invoice_concepts.customer_choice` | boolean |  | `true`: the buyer chooses on the portal (also inside your site) among `customer_options`, starting at `mode`. |
| `invoice_concepts.customer_options` | array of `itemized`, `single`, `grouped` |  | What the buyer can choose from, by default `itemized` and `single`. `mode` always goes; `grouped` needs `groups`. (up to 3) |
| `invoice_concepts.description` | string |  | The single line item's description, like «Consumo» (the default) or «Servicios de hospedaje y alimentos». (up to 200 characters) |
| `invoice_concepts.product_key` | string or null |  | The single line item's ClaveProdServ. `null` (the default): that of the receipt's largest row. |
| `invoice_concepts.unit_key` | string or null |  | Its ClaveUnidad, with `product_key`, like `E48`. `null`: that of the largest row. |
| `invoice_concepts.groups` | array of object |  | The line items of `grouped`, up to 12: each row goes to the first one that takes it, by its SAT key (`sat_keys`) or its product's category (`categories`). Replaces the saved list. (up to 12) |
| `invoice_concepts.groups[].name` | string | yes | The line item's description, like «Alimentos y bebidas». (up to 200 characters) |
| `invoice_concepts.groups[].product_key` | string or null |  | Its ClaveProdServ. `null` (the default): that of its largest row. |
| `invoice_concepts.groups[].unit_key` | string or null |  | Its ClaveUnidad, with `product_key`, like `E48`. |
| `invoice_concepts.groups[].sat_keys` | array of string |  | The rows whose SAT key starts like this: `9010` takes 90101501 (restaurant) and 90101503 (bar); `90111800`, lodging only. (up to 40) |
| `invoice_concepts.groups[].categories` | array of string |  | The rows of the products in these categories and their subcategories, by their path as the product's `category` gives it («Alimentos › Bebidas»). (up to 40) |
| `invoice_concepts.ungrouped` | `itemized`, `group` |  | With `grouped`, the rows no group takes: `itemized` (the default) as they come, or `group` in one more line item called `ungrouped_name`. |
| `invoice_concepts.ungrouped_name` | string |  | That line item's name, «Otros» by default. (up to 200 characters) |
| `invoice_concepts.line_detail` | `customer`, `always`, `never` |  | What happens to each ticket line's `detail` (a stay's nights, dates and reservation): `customer` (default), the buyer sees the «Incluir el detalle en la descripción» checkbox unticked and ticks it if they want it; `always`, it always goes after the description, no checkbox; `never`, it never goes, no checkbox. |
| `global_concepts` | `ticket`, `summary` |  | The global invoice's line items: `ticket` (the default), one «Venta» per receipt with its folio as `NoIdentificacion`; `summary`, only the period's total amount, one per combination of taxes with `NoIdentificacion` «Resumen» (rule 2.7.1.21 of the RMF 2026). `summary` is only for a persona física issuer in RESICO (626); another one answers `invalid_request`. |

Example:

```json
{
  "window": "month",
  "global_periodicity": "04"
}
```

## With the TypeScript SDK

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

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

const selfInvoicing = await fiscalisto.issuers.updateSelfInvoicing("id", { window: "month", global_periodicity: "04" }, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

self_invoicing = fiscalisto.issuers.update_self_invoicing("id", {"window": "month", "global_periodicity": "04"}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

$selfInvoicing = $fiscalisto->issuers->updateSelfInvoicing('id', [
    'window' => 'month',
    'global_periodicity' => '04',
], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

var selfInvoicing = await fiscalisto.Issuers.UpdateSelfInvoicingAsync("id", new UpdateSelfInvoicingParams
{
    Window = "month",
    GlobalPeriodicity = "04",
}, 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()

	selfInvoicing, err := client.Issuers.UpdateSelfInvoicing(ctx, "id", &fiscalisto.UpdateSelfInvoicingParams{
		Window:            fiscalisto.String("month"),
		GlobalPeriodicity: fiscalisto.String("04"),
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *selfInvoicing)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.UpdateSelfInvoicingParams;

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

var selfInvoicing = fiscalisto.issuers().updateSelfInvoicing("id", new UpdateSelfInvoicingParams()
        .setWindow("month")
        .setGlobalPeriodicity("04"), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(selfInvoicing);
```

## Response 200

OK.

A `SelfInvoicing` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"self_invoicing"` | yes | What kind of object it is («invoice», «customer»…). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer` | string | yes | The issuer. |
| `portal_url` | string | yes | The issuer's permanent portal: there any buyer invoices with their code and total. |
| `window` | `month`, `days` | yes | month: it can be invoiced until the end of the sale's month. days: until window_days days after. |
| `window_days` | integer | yes | Days to invoice with window: days. (from -9007199254740991 to 9007199254740991) |
| `global_periodicity` | `01`, `02`, `03`, `04` | yes | How often the global invoice is stamped on its own with what nobody invoiced: 01 daily, 02 weekly, 03 biweekly, 04 monthly. |
| `global_invoice` | `auto`, `off` | yes | auto: tickets nobody invoiced go on their own to their period's global invoice. off: Fiscalisto doesn't make a global invoice for these tickets (you make it elsewhere). |
| `ask_total` | boolean | yes | Whether the portal asks for the total to find the ticket (true) or only its code (false). |
| `portal_title` | string or null | yes | The portal's title, or null for «Facture su ticket». |
| `portal_message` | string or null | yes | The message under the title, or null. |
| `code_hint` | string or null | yes | Where the buyer finds their code, under the field; null for Fiscalisto's text. |
| `portal_theme` | `auto`, `light`, `dark` | yes | auto: the theme of the buyer's device, which they can change. light or dark: always that one, on the portal page, its QRs and inside your site. |
| `portal_accent` | string or null | yes | The portal's button color («#rrggbb»), or null for Fiscalisto's. |
| `portal_radius` | integer or null | yes | The portal's corners in pixels (0 to 24), or null for Fiscalisto's. |
| `portal_style` | object | yes | How the portal looks besides its theme, color and corners (Autofactura › Cómo se ve el portal). |
| `portal_style.layout` | `checkout`, `compact`, `card` | yes | checkout: the invoice fills in next to the form. compact: only the form, the invoice collapsed. card: the form in a centered card. |
| `portal_style.density` | `comfortable`, `compact` | yes | comfortable or compact. |
| `portal_style.header` | `logo`, `name`, `name_rfc`, `logo_name` | yes | What the top says: name_rfc, name, logo_name or logo. |
| `portal_style.logo_size` | `s`, `m`, `l` | yes | The logo size: s, m or l. |
| `portal_style.logo_shape` | `square`, `rounded`, `circle` | yes | The logo shape: square, rounded or circle. |
| `portal_style.font` | string | yes | The font: system or one from Google Fonts. |
| `portal_style.heading_font` | string or null | yes | The headings font, or null for the same as the body text. |
| `portal_style.heading_size` | `s`, `m`, `l` | yes | The title size: s, m or l. |
| `portal_style.borders` | `none`, `subtle`, `strong` | yes | The borders: none, subtle or strong. |
| `portal_style.shadow` | `none`, `soft`, `strong` | yes | The shadow: none, soft or strong. |
| `portal_style.ways` | object | yes | The ways to give their details besides typing them. |
| `portal_style.ways.constancia` | boolean | yes | Upload the constancia (PDF). |
| `portal_style.ways.qr` | boolean | yes | Scan the constancia's QR. |
| `portal_style.ways.cif` | boolean | yes | Look up the details with RFC and idCIF. |
| `portal_style.ways.recall` | boolean | yes | «Ya le hemos facturado antes»: RFC and email. |
| `portal_style.ways.abroad` | boolean | yes | Invoice customers abroad. |
| `portal_style.ways.norfc` | boolean | yes | «No tengo RFC»: in the person's name, with XAXX010101000. |
| `portal_style.email_required` | boolean | yes | Whether invoicing without an email is not allowed. |
| `portal_style.show_deadline` | boolean | yes | Whether it says until when it can be invoiced. |
| `portal_style.back` | object or null | yes | The button at the end to go back to your site, or null. |
| `portal_style.back.label` | string | yes | The button's text. |
| `portal_style.back.url` | string | yes | Where it goes (https). |
| `portal_style.css` | string | yes | Your own CSS, already sanitized. |
| `portal_style.colors` | object | yes | The page colors; null uses the theme's. |
| `portal_style.colors.background` | string or null | yes | The page background, or null. |
| `portal_style.colors.card` | string or null | yes | The background of fields and cards, or null. |
| `portal_style.colors.text` | string or null | yes | The text, or null. |
| `portal_style.colors.button_text` | string or null | yes | The button text, or null. |
| `portal_style.noun` | `ticket`, `nota`, `cuenta`, `compra`, `pedido`, `orden`, `reservacion`, `estancia`, `boleto` | yes | What the portal calls what is invoiced («reservacion» in a hotel). |
| `portal_style.texts` | object | yes | Your own texts by key (step_ticket, submit, success_title, concepts_title…), each with es and en. A missing one uses Fiscalisto's. |
| `invoice_concepts` | object | yes | The line items of the invoice the buyer makes in the portal. |
| `invoice_concepts.mode` | `itemized`, `single`, `grouped` | yes | itemized: one line item per ticket line; single: just one; grouped: one per group in groups. Anything with another set of taxes (like a night with ISH) always goes in its own line item. |
| `invoice_concepts.customer_choice` | boolean | yes | Whether the buyer can choose in the portal among the customer_options. |
| `invoice_concepts.customer_options` | array of `itemized`, `single`, `grouped` | yes | The options the buyer sees when they can choose (always includes mode, which arrives selected). |
| `invoice_concepts.description` | string | yes | The single line item's description, like «Consumo». |
| `invoice_concepts.product_key` | string or null | yes | The single line item's ClaveProdServ, or null for the largest line's. |
| `invoice_concepts.unit_key` | string or null | yes | Its ClaveUnidad, or null for the largest line's. |
| `invoice_concepts.groups` | array of object | yes | The «Por categoría» groups, in order: each line goes in the first one that takes it. |
| `invoice_concepts.groups[].name` | string | yes | The line item's name, like «Alimentos y bebidas». |
| `invoice_concepts.groups[].product_key` | string or null | yes | Its ClaveProdServ, or null for the largest line in the group. |
| `invoice_concepts.groups[].unit_key` | string or null | yes | Its ClaveUnidad, or null for the largest line's. |
| `invoice_concepts.groups[].sat_keys` | array of string | yes | The SAT codes it takes, complete or their start (2 to 8 digits, like 9010). |
| `invoice_concepts.groups[].categories` | array of string | yes | The product categories it takes, by their path («Hotel › Habitaciones»); a category also takes the ones inside it. |
| `invoice_concepts.ungrouped` | `itemized`, `group` | yes | What no group takes: itemized, broken down; group, in one more line item called ungrouped_name. |
| `invoice_concepts.ungrouped_name` | string | yes | The line item name for what no group takes. |
| `invoice_concepts.line_detail` | `customer`, `always`, `never` | yes | What happens to each ticket line's detail: customer, the buyer sees the checkbox unticked and ticks it if they want it; always, it always goes after the description; never, it never goes. |
| `retention_mode` | `keep_total`, `subtract` | yes | When invoicing a persona moral that withholds (1.25% ISR in RESICO, or the product's). keep_total: the base grows and the invoice adds up to what was paid. subtract: the base is the ticket's and the total is what was paid minus the withholding. |
| `invoice_series` | string or null | yes | The series for invoices issued from the portal and from a ticket, like AF, or null for the issuer's invoice series. The global invoice doesn't use it. |
| `customer_notes` | boolean | yes | true: the portal asks the buyer for a note for their invoice's PDF (up to 500 characters). It only appears on the PDF, never in the XML. |
| `failure_email` | boolean | yes | true: when a buyer can't invoice because of something on the issuer's side, an email goes out; false: it only stays in Alertas. |
| `split_max` | integer | yes | The most invoices a receipt can have (splitting a receipt into several invoices), counting the one that takes all that's left; 0: it can't be split. (from -9007199254740991 to 9007199254740991) |
| `split_min` | number | yes | The least each invoice of a split receipt can be, taxes included; less can't be left to invoice either, except by the invoice that takes all that's left. |
| `split_same` | boolean | yes | true: a buyer can make several invoices with the same details at once (4 of 250 from a 1,000 receipt). |
| `global_concepts` | `ticket`, `summary` | yes | ticket: the global invoice carries one «Venta» line item per ticket, with its folio. summary: only the period's total amount, one per tax combination (NoIdentificacion «Resumen»), for a persona física in RESICO (rule 2.7.1.21 of the RMF 2026). |

```json
{
  "object": "self_invoicing",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "portal_url": "https://fiscalisto.com/autofactura/Tx8mQ2vLp9WnR4c",
  "window": "month",
  "window_days": 7,
  "global_periodicity": "04",
  "global_invoice": "auto",
  "ask_total": true,
  "portal_title": null,
  "portal_message": null,
  "code_hint": null,
  "portal_theme": "auto",
  "portal_accent": "#0b7c77",
  "portal_radius": null,
  "portal_style": {
    "layout": "checkout",
    "density": "comfortable",
    "header": "name_rfc",
    "logo_size": "m",
    "logo_shape": "rounded",
    "font": "system",
    "heading_font": null,
    "heading_size": "m",
    "borders": "subtle",
    "shadow": "soft",
    "ways": {
      "constancia": true,
      "qr": true,
      "cif": true,
      "recall": true,
      "abroad": true,
      "norfc": false
    },
    "email_required": false,
    "show_deadline": true,
    "back": null,
    "css": "",
    "colors": {
      "background": null,
      "card": null,
      "text": null,
      "button_text": null
    },
    "noun": "ticket",
    "texts": {}
  },
  "retention_mode": "keep_total",
  "invoice_series": null,
  "customer_notes": false,
  "failure_email": true,
  "split_max": 4,
  "split_min": 100,
  "split_same": true,
  "global_concepts": "ticket",
  "invoice_concepts": {
    "mode": "itemized",
    "customer_choice": true,
    "customer_options": [
      "itemized",
      "single",
      "grouped"
    ],
    "description": "Consumo",
    "product_key": null,
    "unit_key": null,
    "groups": [
      {
        "name": "Alimentos y bebidas",
        "product_key": "90101501",
        "unit_key": "E48",
        "sat_keys": [
          "901015"
        ],
        "categories": []
      },
      {
        "name": "Hospedaje",
        "product_key": null,
        "unit_key": null,
        "sat_keys": [],
        "categories": [
          "Hotel › Habitaciones"
        ]
      }
    ],
    "ungrouped": "group",
    "ungrouped_name": "Otros servicios",
    "line_detail": "customer"
  }
}
```

## 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.
- `ticket_invalid` (400): The ticket couldn't be registered (invalid folio, a sale date in the future or over a year ago, a product no longer in the catalog…). `message_es` says which.

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