Eme2App’s fiscal configuration is built around a set of master-data catalogs, each scoped to the active empresa and referenced by clients, articles, and documents at creation time. Getting these catalogs right before you start issuing invoices ensures that tax rates, IRPF retentions, due-date schedules, and series numbering are all applied consistently and automatically. All read endpoints require authentication with a validDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/eme2dev/Eme2App/llms.txt
Use this file to discover all available pages before exploring further.
empresa_id in the JWT; write operations (create, update, delete) additionally require the admin role.
Catalog Overview
IVA
VAT rates assigned to articles and invoice lines. Supports toggling rates active/inactive without deletion.
IRPF
Withholding tax regimes assigned per client. Drive automatic IRPF deduction on invoices.
Régimen Fiscal
Fiscal regime codes (e.g., régimen general, simplificado) assigned to clients for tax reporting.
Territorio Fiscal
Fiscal territories (Peninsular, Canarias, Ceuta, Melilla, Extranjero) controlling applicable tax rules.
Series de Facturas
Prefix and sequence control for invoice numbering. Supports rectificative series.
Formas de Pago
Payment terms that define installment schedules and drive automatic due-date generation on invoices.
Instrumentos de Pago
Payment instruments (transfer, cash, cheque, etc.) used when registering cobros and configuring installments.
IVA
Route:/api/iva
IVA records define the VAT rates available across the empresa. Each article is linked to one IVA record; invoice lines inherit the rate from the article or can override it at line level. Rates can be toggled active/inactive independently—inactive rates are hidden from selectors but preserved on historical lines.
Schema fields (iva model):
| Field | Type | Description |
|---|---|---|
codigo | string (20) | Short code, unique per empresa (e.g., "IVA21") |
nombre | string (100) | Display name (e.g., "IVA General 21%") |
porcentaje | decimal (5,2) | Tax rate as a number (e.g., 21.00) |
descripcion | string | null | Optional free-text note |
estado | boolean | true = active, false = inactive |
API Operations
IRPF Regimes
Route:/api/regimenes-irpf
IRPF retention regimes are assigned to clients and determine the withholding percentage applied automatically on invoices. The GET endpoint returns only active regimes (estado = true).
Schema fields (regimenes_irpf model):
| Field | Type | Description |
|---|---|---|
codigo | string (10) | Short code, unique per empresa (e.g., "IRPF15") |
descripcion | string (200) | Human-readable description |
porcentaje_irpf | decimal (5,2) | Retention percentage (e.g., 15.00) |
estado | boolean | Active/inactive |
API Operations
The IRPF catalog is read-only through the public API. Create and manage records through the admin configuration panel or directly in the database as part of initial setup.
Régimen Fiscal
Route:/api/regimen-fiscal
Fiscal regimes are assigned to clients and appear on invoice XML exports and tax reports. Each regime has a short codigo (e.g., "01" for régimen general) and a nombre. They support toggle-estado for soft deactivation.
Schema fields (regimenes_fiscales model):
| Field | Type | Description |
|---|---|---|
codigo | string (10) | Unique code per empresa |
nombre | string (100) | Display name |
descripcion | string | null | Optional description |
estado | boolean | Active/inactive |
API Operations
Territorio Fiscal
Route:/api/territorio-fiscal
Fiscal territories determine which VAT rules apply to a client or supplier. Eme2App ships with standard Spanish territories; the read-only GET endpoint returns only active territories for the empresa.
Schema fields (territorios_fiscales model):
| Field | Type | Description |
|---|---|---|
codigo | string (10) | Unique code per empresa (e.g., "PEN", "CAN", "CEU", "MEL", "INT") |
nombre | string (100) | Display name (e.g., "Peninsular e Islas Baleares") |
estado | boolean | Active/inactive |
API Operations
Invoice Series
Route:/api/series-facturas
Series let you maintain separate sequential numbering streams per document type, year, or business unit. Each series has a short codigo (the prefix) and a nombre. One series can be flagged as es_rectificativa to mark it as the series for credit notes. Series must be enabled at the empresa level (usa_series: true in the empresa profile) for the series selector to appear on invoice forms.
Schema fields (series_facturas model):
| Field | Type | Description |
|---|---|---|
codigo | string (20) | Prefix code, unique per empresa (e.g., "A", "2025") |
nombre | string (120) | Display name (e.g., "Serie General 2025") |
es_rectificativa | boolean | true = this series is used for rectificative invoices (credit notes) |
es_predeterminada | boolean | true = default series for new invoices |
estado | boolean | Active/inactive |
API Operations
Invoice uniqueness is enforced at the database level on
(empresa_id, numero, serie). Two invoices can share the same numero only if they belong to different series.Formas de Pago
Route:/api/formas-pago
Payment terms define how and when a client is expected to pay. Each forma de pago can have one or more vencimientos (installment schedules) that specify the number of days to the due date, the percentage of the total, and the payment instrument. When an invoice is saved, Eme2App automatically generates facturas_vencimientos records from the active forma de pago configuration.
Schema fields (formas_pago model):
| Field | Type | Description |
|---|---|---|
codigo | string (30) | Unique code per empresa (e.g., "CONTADO", "30D") |
nombre | string (120) | Display name (e.g., "Contado", "30 días fecha factura") |
descripcion | string | null | Optional description |
activo | boolean | Active/inactive |
API Operations
Configuring Installment Schedules (Vencimientos)
Each forma de pago can have multiple installments. The sum ofporcentaje values across all installments must equal 100.
Instrumentos de Pago
Route:/api/instrumentos-pago
Payment instruments represent the physical or digital mechanism used to settle an invoice: bank transfer, cash, cheque, direct debit, etc. They are referenced both in forma de pago installment configuration and when recording a cobro (payment receipt). Instruments with remesable: true can be included in payment batches.
Schema fields (instrumentos_pago model):
| Field | Type | Description |
|---|---|---|
nombre | string (120) | Display name, unique per empresa (e.g., "Transferencia bancaria") |
codigo | string (20) | null | Short code, unique per empresa |
remesable | boolean | Whether this instrument supports payment batching |
activo | boolean | Active/inactive |
API Operations
Deleting an instrument that is referenced by existing
cobros or facturas_vencimientos records does not raise an error—instead, the instrument is deactivated (activo = false) and the record is preserved for historical integrity. The response indicates whether the record was hard-deleted or soft-deactivated.