# Stamp a receipt calculated by your system

`POST https://api.fiscalisto.com/v1/payroll_receipts/external`

For a payroll system that already calculated the receipt: stamps exactly its perceptions (taxed and exempt), deductions, other payments, overtime, disabilities, separation or retirement, ordinary (type O) or extraordinary (type E: aguinaldo, PTU, settlement). Fiscalisto doesn't recalculate or round anything: it checks the XSD, SAT's catalogs, the error matrix and that its totals add up, and if something fails it answers payroll_invalid with every problem in errors[] (each with its param). One ordinary receipt per employee (RFC) and period; one extraordinary per employee and payroll_run_id. Repeating it with the same amounts returns the same receipt; with other amounts, 409 payroll_receipt_exists (correct it with replaces). It's kept as a type N invoice.

## Before you call

- **An issuer that already stamps.** In production, with its digital seal (CSD) current: [`POST /v1/issuers/{id}/certificates`](https://fiscalisto.com/en/docs/api/referencia/emisores/upload-certificate). In test mode it stamps with SAT's test CSD.
- **The `Idempotency-Key` header**, a new one for each call (for example, the order's id in your system). If the response is lost, repeat the call with the same one and it isn't done twice: [Idempotency](https://fiscalisto.com/en/docs/api/idempotencia).

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | yes | A new one per CFDI (8 to 255 characters; your order id works). If the response is lost, repeat the request with the same value: it answers the same and never stamps twice. |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `issuer` | string |  | The receipt's issuer (employer); without it, the only issuer in your account in this mode. |
| `type` | `O`, `E` | yes | TipoNomina: O ordinary (frequency 01–10) or E extraordinary (frequency 99). |
| `periodicity` | string | yes | PeriodicidadPago (c_PeriodicidadPago). (up to 2 characters) |
| `period` | object | yes | FechaInicialPago, FechaFinalPago and FechaPago. |
| `period.start` | string | yes | First day of the period (FechaInicialPago), YYYY-MM-DD. |
| `period.end` | string | yes | Last day of the period (FechaFinalPago), YYYY-MM-DD. |
| `period.payment_date` | string | yes | Payment date (FechaPago), YYYY-MM-DD. The last day of the period by default. |
| `days` | number | yes | NumDiasPagados: from 0.001 to 36160, up to 3 decimals. |
| `employer` | object |  | The employer (Emisor of the complement): employer registration and CURP if it is a persona física. |
| `employer.registration` | string or null |  | Employer registration. Without the field: the issuer's when the contract is 01–08. null: without employer registration. |
| `employer.curp` | string or null |  | CURP of the persona física employer. Without the field: the one saved on the issuer. |
| `employer.origin_tax_id` | string |  | RfcPatronOrigen. (up to 13 characters) |
| `employer.sncf` | object |  | EntidadSNCF, only for entities that belong to the SNCF. |
| `employer.sncf.resource_origin` | string | yes | OrigenRecurso: IP, IF or IM. (up to 2 characters) |
| `employer.sncf.own_resource_amount` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `employee` | object | yes | The employee (Receptor and Nomina/Receptor) with the data from your payroll system; it doesn't use or change Fiscalisto's employees. |
| `employee.tax_id` | string | yes | Employee's RFC. XAXX010101000 if deceased: with their name and CURP. (up to 13 characters) |
| `employee.name` | string | yes | Name. (up to 300 characters) |
| `employee.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. (up to 5 characters) |
| `employee.curp` | string | yes | CURP, 18 characters. (up to 18 characters) |
| `employee.number` | string | yes | NumEmpleado. (up to 15 characters) |
| `employee.email` | string or null |  | For send_email; it doesn't go in the XML. |
| `employee.social_security_number` | string |  | Social security number (NumSeguridadSocial), 11 digits. (up to 15 characters) |
| `employee.start_date` | string |  | FechaInicioRelLaboral. |
| `employee.seniority` | string |  | Seniority (P52W or P1Y2M3D). Without the field and with employer registration: weeks from start_date to the end of the period (days if under a week, P3D). (up to 20 characters) |
| `employee.contract_type` | string | yes | Contract type (TipoContrato), c_TipoContrato. 01 by default, permanent. (up to 2 characters) |
| `employee.regime_type` | string | yes | Regime type (TipoRegimen): 02 wages and salaries. (up to 2 characters) |
| `employee.unionized` | boolean |  | true if they're unionized (Sindicalizado). |
| `employee.workday_type` | string |  | Shift type (TipoJornada), c_TipoJornada. 01 by default, day shift. (up to 2 characters) |
| `employee.risk_class` | string |  | The position's risk class with IMSS (RiesgoPuesto), 1 to 5. 1 by default. (up to 2 characters) |
| `employee.department` | string |  | Department (Departamento). (up to 100 characters) |
| `employee.position` | string |  | Position (Puesto). (up to 100 characters) |
| `employee.contribution_base_salary` | number |  | SalarioBaseCotApor. |
| `employee.integrated_daily_salary` | number |  | SalarioDiarioIntegrado. |
| `employee.state` | string | yes | ClaveEntFed (c_Estado): JAL, CMX, NLE… (up to 3 characters) |
| `employee.bank` | string |  | Bank (c_Banco); it doesn't go with a CLABE. (up to 3 characters) |
| `employee.bank_account` | string |  | CuentaBancaria: 18-digit CLABE, card or account. (up to 18 characters) |
| `employee.subcontracting` | array of object |  | SubContratacion: the percentage adds up to 100. (up to 50) |
| `employee.subcontracting[].tax_id` | string | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. (up to 13 characters) |
| `employee.subcontracting[].percentage` | number | yes | PorcentajeTiempo. |
| `perceptions` | array of object |  | Earnings (Percepcion): wages and the rest, taxable and exempt. (up to 500) |
| `perceptions[].type` | string | yes | TipoPercepcion (c_TipoPercepcion): 001 wages, 002 year-end bonus… (up to 3 characters) |
| `perceptions[].key` | string | yes | Employer's code (3 to 15 characters). (up to 15 characters) |
| `perceptions[].concept` | string | yes | Payment concept (ConceptoPago), c_TipoContribuyenteSujetoRetencion. (up to 100 characters) |
| `perceptions[].taxed` | number | yes | ImporteGravado. |
| `perceptions[].exempt` | number | yes | ImporteExento. |
| `perceptions[].overtime` | array of object |  | HorasExtra: only with earning 019. (up to 100) |
| `perceptions[].overtime[].days` | number | yes | Days with overtime (Dias). |
| `perceptions[].overtime[].hours_type` | string | yes | c_TipoHoras: 01 double, 02 triple, 03 single. (up to 2 characters) |
| `perceptions[].overtime[].hours` | number | yes | Overtime hours (HorasExtra). |
| `perceptions[].overtime[].amount_paid` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `perceptions[].stock_options` | object |  | AccionesOTitulos: only with earning 045. |
| `perceptions[].stock_options.market_value` | number | yes | Market value (ValorMercado). |
| `perceptions[].stock_options.grant_price` | number | yes | Price when granted (PrecioAlOtorgarse). |
| `separation` | object |  | SeparacionIndemnizacion: with earnings 022, 023 or 025. |
| `separation.total_paid` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `separation.years_of_service` | number | yes | NumAñosServicio. |
| `separation.last_monthly_salary` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `separation.accumulable_income` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `separation.non_accumulable_income` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `retirement` | object |  | JubilacionPensionRetiro: with earnings 039 or 044. |
| `retirement.total_one_payment` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `retirement.total_installment` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `retirement.daily_amount` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `retirement.accumulable_income` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `retirement.non_accumulable_income` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `deductions` | array of object |  | Deductions (Deduccion): ISR, IMSS contributions and the rest. (up to 500) |
| `deductions[].type` | string | yes | TipoDeduccion (c_TipoDeduccion): 001 IMSS, 002 ISR, 010 Infonavit… (up to 3 characters) |
| `deductions[].key` | string | yes | The .key file in base64 (it can carry the data: prefix). (up to 15 characters) |
| `deductions[].concept` | string | yes | Concept of the outflows (IntegracEgresos/ConceptoS), up to 100 characters. (up to 100 characters) |
| `deductions[].amount` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `other_payments` | array of object |  | Other payments (OtroPago): employment subsidy. (up to 100) |
| `other_payments[].type` | string | yes | TipoOtroPago (c_TipoOtroPago): 002 employment subsidy… (up to 3 characters) |
| `other_payments[].key` | string | yes | The .key file in base64 (it can carry the data: prefix). (up to 15 characters) |
| `other_payments[].concept` | string | yes | Payment concept (ConceptoPago), c_TipoContribuyenteSujetoRetencion. (up to 100 characters) |
| `other_payments[].amount` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `other_payments[].subsidy_caused` | number |  | SubsidioCausado: only with 002. |
| `other_payments[].balance_compensation` | object |  | CompensacionSaldosAFavor: only with 004. |
| `other_payments[].balance_compensation.balance` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `other_payments[].balance_compensation.year` | number | yes | Year (Ejercicio). |
| `other_payments[].balance_compensation.remaining` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `disabilities` | array of object |  | Incapacidades: with earning 014 or deduction 006. (up to 100) |
| `disabilities[].days` | number | yes | Days paid (NumDiasPagados). By default, all the period's days that apply to them. |
| `disabilities[].type` | string | yes | Receipt type (TipoDeComprobante): I income, E expense, P payment, T transfer, N payroll. (up to 2 characters) |
| `disabilities[].amount` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `totals` | object | yes | The totals your system calculated: Fiscalisto compares them to the cent with the lines and rejects the receipt if they don't match. |
| `totals.perceptions` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `totals.deductions` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `totals.other_payments` | number | yes | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `totals.net` | number | yes | Net: earnings plus other payments minus deductions. |
| `totals.salaries` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `totals.separation` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `totals.retirement` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `totals.taxed` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `totals.exempt` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `totals.taxes_withheld` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `totals.other_deductions` | number |  | Pesos with up to 2 decimals, as they are stamped: Fiscalisto doesn't round them. |
| `references` | object |  | Your ids: the employee and the payroll run. payroll_run_id is mandatory on an extraordinary receipt. |
| `references.employee_id` | string |  | The employee's id in your system. (up to 100 characters) |
| `references.payroll_run_id` | string |  | The payroll run's id in your system. (up to 100 characters) |
| `replaces` | string |  | The valid receipt (inv_… or UUID) this one replaces: relation 04, and it is canceled with reason 01. |
| `send_email` | boolean |  | true to send the PDF and the XML by email when stamping, with Fiscalisto's design. Not sent by default. |
| `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
{
  "issuer": "iss_OufpKqnrvx9p",
  "type": "O",
  "periodicity": "04",
  "period": {
    "start": "2026-10-01",
    "end": "2026-10-15",
    "payment_date": "2026-10-15"
  },
  "days": 15,
  "employee": {
    "tax_id": "MASO451221PM4",
    "name": "MARIA OLIVIA MARTINEZ SAGAZ",
    "zip": "80290",
    "curp": "MASO451221MSLRGL08",
    "number": "123",
    "social_security_number": "12345678903",
    "start_date": "2024-03-04",
    "contract_type": "01",
    "regime_type": "02",
    "unionized": false,
    "workday_type": "01",
    "risk_class": "1",
    "department": "Ventas",
    "position": "Ejecutiva de cuenta",
    "contribution_base_salary": 525.4,
    "integrated_daily_salary": 525.4,
    "state": "SIN",
    "bank_account": "002180700601234561"
  },
  "perceptions": [
    {
      "type": "001",
      "key": "SUELDO",
      "concept": "Sueldo",
      "taxed": 7500,
      "exempt": 0
    },
    {
      "type": "019",
      "key": "HEXTRA",
      "concept": "Horas extra dobles",
      "taxed": 450,
      "exempt": 450,
      "overtime": [
        {
          "days": 2,
          "hours_type": "01",
          "hours": 6,
          "amount_paid": 900
        }
      ]
    },
    {
      "type": "028",
      "key": "COMISION",
      "concept": "Comisiones de octubre",
      "taxed": 1200,
      "exempt": 0
    }
  ],
  "deductions": [
    {
      "type": "001",
      "key": "IMSS",
      "concept": "Cuotas obreras IMSS",
      "amount": 260.15
    },
    {
      "type": "002",
      "key": "ISR",
      "concept": "ISR",
      "amount": 1203.72
    },
    {
      "type": "010",
      "key": "INFONAVIT",
      "concept": "Crédito Infonavit",
      "amount": 950
    },
    {
      "type": "004",
      "key": "PRESTAMO",
      "concept": "Préstamo personal",
      "amount": 500
    }
  ],
  "other_payments": [
    {
      "type": "002",
      "key": "SUBSIDIO",
      "concept": "Subsidio para el empleo",
      "amount": 0,
      "subsidy_caused": 0
    }
  ],
  "totals": {
    "perceptions": 9600,
    "deductions": 2913.87,
    "other_payments": 0,
    "net": 6686.13
  },
  "references": {
    "employee_id": "nom-000123",
    "payroll_run_id": "2026-Q19"
  },
  "metadata": {
    "corrida": "2026-Q19"
  }
}
```

## With the TypeScript SDK

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

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

const invoice = await fiscalisto.payrollReceipts.createExternal({
  issuer: "iss_OufpKqnrvx9p",
  type: "O",
  periodicity: "04",
  period: {
    start: "2026-10-01",
    end: "2026-10-15",
    payment_date: "2026-10-15",
  },
  days: 15,
  employee: {
    tax_id: "MASO451221PM4",
    name: "MARIA OLIVIA MARTINEZ SAGAZ",
    zip: "80290",
    curp: "MASO451221MSLRGL08",
    number: "123",
    social_security_number: "12345678903",
    start_date: "2024-03-04",
    contract_type: "01",
    regime_type: "02",
    unionized: false,
    workday_type: "01",
    risk_class: "1",
    department: "Ventas",
    position: "Ejecutiva de cuenta",
    contribution_base_salary: 525.4,
    integrated_daily_salary: 525.4,
    state: "SIN",
    bank_account: "002180700601234561",
  },
  perceptions: [
    {
      type: "001",
      key: "SUELDO",
      concept: "Sueldo",
      taxed: 7500,
      exempt: 0,
    },
    {
      type: "019",
      key: "HEXTRA",
      concept: "Horas extra dobles",
      taxed: 450,
      exempt: 450,
      overtime: [
        {
          days: 2,
          hours_type: "01",
          hours: 6,
          amount_paid: 900,
        },
      ],
    },
    {
      type: "028",
      key: "COMISION",
      concept: "Comisiones de octubre",
      taxed: 1200,
      exempt: 0,
    },
  ],
  deductions: [
    {
      type: "001",
      key: "IMSS",
      concept: "Cuotas obreras IMSS",
      amount: 260.15,
    },
    {
      type: "002",
      key: "ISR",
      concept: "ISR",
      amount: 1203.72,
    },
    {
      type: "010",
      key: "INFONAVIT",
      concept: "Crédito Infonavit",
      amount: 950,
    },
    {
      type: "004",
      key: "PRESTAMO",
      concept: "Préstamo personal",
      amount: 500,
    },
  ],
  other_payments: [
    {
      type: "002",
      key: "SUBSIDIO",
      concept: "Subsidio para el empleo",
      amount: 0,
      subsidy_caused: 0,
    },
  ],
  totals: {
    perceptions: 9600,
    deductions: 2913.87,
    other_payments: 0,
    net: 6686.13,
  },
  references: {
    employee_id: "nom-000123",
    payroll_run_id: "2026-Q19",
  },
  metadata: { corrida: "2026-Q19" },
}, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

invoice = fiscalisto.payroll_receipts.create_external({
    "issuer": "iss_OufpKqnrvx9p",
    "type": "O",
    "periodicity": "04",
    "period": {
        "start": "2026-10-01",
        "end": "2026-10-15",
        "payment_date": "2026-10-15",
    },
    "days": 15,
    "employee": {
        "tax_id": "MASO451221PM4",
        "name": "MARIA OLIVIA MARTINEZ SAGAZ",
        "zip": "80290",
        "curp": "MASO451221MSLRGL08",
        "number": "123",
        "social_security_number": "12345678903",
        "start_date": "2024-03-04",
        "contract_type": "01",
        "regime_type": "02",
        "unionized": False,
        "workday_type": "01",
        "risk_class": "1",
        "department": "Ventas",
        "position": "Ejecutiva de cuenta",
        "contribution_base_salary": 525.4,
        "integrated_daily_salary": 525.4,
        "state": "SIN",
        "bank_account": "002180700601234561",
    },
    "perceptions": [
        {
            "type": "001",
            "key": "SUELDO",
            "concept": "Sueldo",
            "taxed": 7500,
            "exempt": 0,
        },
        {
            "type": "019",
            "key": "HEXTRA",
            "concept": "Horas extra dobles",
            "taxed": 450,
            "exempt": 450,
            "overtime": [
                {
                    "days": 2,
                    "hours_type": "01",
                    "hours": 6,
                    "amount_paid": 900,
                },
            ],
        },
        {
            "type": "028",
            "key": "COMISION",
            "concept": "Comisiones de octubre",
            "taxed": 1200,
            "exempt": 0,
        },
    ],
    "deductions": [
        {
            "type": "001",
            "key": "IMSS",
            "concept": "Cuotas obreras IMSS",
            "amount": 260.15,
        },
        {
            "type": "002",
            "key": "ISR",
            "concept": "ISR",
            "amount": 1203.72,
        },
        {
            "type": "010",
            "key": "INFONAVIT",
            "concept": "Crédito Infonavit",
            "amount": 950,
        },
        {
            "type": "004",
            "key": "PRESTAMO",
            "concept": "Préstamo personal",
            "amount": 500,
        },
    ],
    "other_payments": [
        {
            "type": "002",
            "key": "SUBSIDIO",
            "concept": "Subsidio para el empleo",
            "amount": 0,
            "subsidy_caused": 0,
        },
    ],
    "totals": {
        "perceptions": 9600,
        "deductions": 2913.87,
        "other_payments": 0,
        "net": 6686.13,
    },
    "references": {
        "employee_id": "nom-000123",
        "payroll_run_id": "2026-Q19",
    },
    "metadata": {"corrida": "2026-Q19"},
}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

$invoice = $fiscalisto->payrollReceipts->createExternal([
    'issuer' => 'iss_OufpKqnrvx9p',
    'type' => 'O',
    'periodicity' => '04',
    'period' => [
        'start' => '2026-10-01',
        'end' => '2026-10-15',
        'payment_date' => '2026-10-15',
    ],
    'days' => 15,
    'employee' => [
        'tax_id' => 'MASO451221PM4',
        'name' => 'MARIA OLIVIA MARTINEZ SAGAZ',
        'zip' => '80290',
        'curp' => 'MASO451221MSLRGL08',
        'number' => '123',
        'social_security_number' => '12345678903',
        'start_date' => '2024-03-04',
        'contract_type' => '01',
        'regime_type' => '02',
        'unionized' => false,
        'workday_type' => '01',
        'risk_class' => '1',
        'department' => 'Ventas',
        'position' => 'Ejecutiva de cuenta',
        'contribution_base_salary' => 525.4,
        'integrated_daily_salary' => 525.4,
        'state' => 'SIN',
        'bank_account' => '002180700601234561',
    ],
    'perceptions' => [
        [
            'type' => '001',
            'key' => 'SUELDO',
            'concept' => 'Sueldo',
            'taxed' => 7500,
            'exempt' => 0,
        ],
        [
            'type' => '019',
            'key' => 'HEXTRA',
            'concept' => 'Horas extra dobles',
            'taxed' => 450,
            'exempt' => 450,
            'overtime' => [
                [
                    'days' => 2,
                    'hours_type' => '01',
                    'hours' => 6,
                    'amount_paid' => 900,
                ],
            ],
        ],
        [
            'type' => '028',
            'key' => 'COMISION',
            'concept' => 'Comisiones de octubre',
            'taxed' => 1200,
            'exempt' => 0,
        ],
    ],
    'deductions' => [
        [
            'type' => '001',
            'key' => 'IMSS',
            'concept' => 'Cuotas obreras IMSS',
            'amount' => 260.15,
        ],
        [
            'type' => '002',
            'key' => 'ISR',
            'concept' => 'ISR',
            'amount' => 1203.72,
        ],
        [
            'type' => '010',
            'key' => 'INFONAVIT',
            'concept' => 'Crédito Infonavit',
            'amount' => 950,
        ],
        [
            'type' => '004',
            'key' => 'PRESTAMO',
            'concept' => 'Préstamo personal',
            'amount' => 500,
        ],
    ],
    'other_payments' => [
        [
            'type' => '002',
            'key' => 'SUBSIDIO',
            'concept' => 'Subsidio para el empleo',
            'amount' => 0,
            'subsidy_caused' => 0,
        ],
    ],
    'totals' => [
        'perceptions' => 9600,
        'deductions' => 2913.87,
        'other_payments' => 0,
        'net' => 6686.13,
    ],
    'references' => [
        'employee_id' => 'nom-000123',
        'payroll_run_id' => '2026-Q19',
    ],
    'metadata' => ['corrida' => '2026-Q19'],
], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

var invoice = await fiscalisto.PayrollReceipts.CreateExternalAsync(new ExternalPayrollReceiptCreate
{
    Issuer = "iss_OufpKqnrvx9p",
    Type = "O",
    Periodicity = "04",
    Period = new()
    {
        Start = "2026-10-01",
        End = "2026-10-15",
        PaymentDate = "2026-10-15",
    },
    Days = 15,
    Employee = new()
    {
        TaxId = "MASO451221PM4",
        Name = "MARIA OLIVIA MARTINEZ SAGAZ",
        Zip = "80290",
        Curp = "MASO451221MSLRGL08",
        Number = "123",
        SocialSecurityNumber = "12345678903",
        StartDate = "2024-03-04",
        ContractType = "01",
        RegimeType = "02",
        Unionized = false,
        WorkdayType = "01",
        RiskClass = "1",
        Department = "Ventas",
        Position = "Ejecutiva de cuenta",
        ContributionBaseSalary = 525.4m,
        IntegratedDailySalary = 525.4m,
        State = "SIN",
        BankAccount = "002180700601234561",
    },
    Perceptions = new()
    {
        new()
        {
            Type = "001",
            Key = "SUELDO",
            Concept = "Sueldo",
            Taxed = 7500,
            Exempt = 0,
        },
        new()
        {
            Type = "019",
            Key = "HEXTRA",
            Concept = "Horas extra dobles",
            Taxed = 450,
            Exempt = 450,
            Overtime = new()
            {
                new()
                {
                    Days = 2,
                    HoursType = "01",
                    Hours = 6,
                    AmountPaid = 900,
                },
            },
        },
        new()
        {
            Type = "028",
            Key = "COMISION",
            Concept = "Comisiones de octubre",
            Taxed = 1200,
            Exempt = 0,
        },
    },
    Deductions = new()
    {
        new()
        {
            Type = "001",
            Key = "IMSS",
            Concept = "Cuotas obreras IMSS",
            Amount = 260.15m,
        },
        new()
        {
            Type = "002",
            Key = "ISR",
            Concept = "ISR",
            Amount = 1203.72m,
        },
        new()
        {
            Type = "010",
            Key = "INFONAVIT",
            Concept = "Crédito Infonavit",
            Amount = 950,
        },
        new()
        {
            Type = "004",
            Key = "PRESTAMO",
            Concept = "Préstamo personal",
            Amount = 500,
        },
    },
    OtherPayments = new()
    {
        new()
        {
            Type = "002",
            Key = "SUBSIDIO",
            Concept = "Subsidio para el empleo",
            Amount = 0,
            SubsidyCaused = 0,
        },
    },
    Totals = new()
    {
        Perceptions = 9600,
        Deductions = 2913.87m,
        OtherPayments = 0,
        Net = 6686.13m,
    },
    References = new()
    {
        EmployeeId = "nom-000123",
        PayrollRunId = "2026-Q19",
    },
    Metadata = new() { ["corrida"] = "2026-Q19" },
}, 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()

	invoice, err := client.PayrollReceipts.CreateExternal(ctx, &fiscalisto.ExternalPayrollReceiptCreate{
		Issuer:      fiscalisto.String("iss_OufpKqnrvx9p"),
		Type:        "O",
		Periodicity: "04",
		Period: fiscalisto.ExternalPayrollReceiptCreatePeriod{
			Start:       "2026-10-01",
			End:         "2026-10-15",
			PaymentDate: "2026-10-15",
		},
		Days: 15,
		Employee: fiscalisto.ExternalPayrollReceiptCreateEmployee{
			TaxID:                  "MASO451221PM4",
			Name:                   "MARIA OLIVIA MARTINEZ SAGAZ",
			Zip:                    "80290",
			CURP:                   "MASO451221MSLRGL08",
			Number:                 "123",
			SocialSecurityNumber:   fiscalisto.String("12345678903"),
			StartDate:              fiscalisto.String("2024-03-04"),
			ContractType:           "01",
			RegimeType:             "02",
			Unionized:              fiscalisto.Bool(false),
			WorkdayType:            fiscalisto.String("01"),
			RiskClass:              fiscalisto.String("1"),
			Department:             fiscalisto.String("Ventas"),
			Position:               fiscalisto.String("Ejecutiva de cuenta"),
			ContributionBaseSalary: fiscalisto.Float64(525.4),
			IntegratedDailySalary:  fiscalisto.Float64(525.4),
			State:                  "SIN",
			BankAccount:            fiscalisto.String("002180700601234561"),
		},
		Perceptions: []fiscalisto.ExternalPayrollReceiptCreatePerception{
			{
				Type:    "001",
				Key:     "SUELDO",
				Concept: "Sueldo",
				Taxed:   7500,
				Exempt:  0,
			},
			{
				Type:    "019",
				Key:     "HEXTRA",
				Concept: "Horas extra dobles",
				Taxed:   450,
				Exempt:  450,
				Overtime: []fiscalisto.ExternalPayrollReceiptCreatePerceptionOvertimeItem{
					{Days: 2, HoursType: "01", Hours: 6, AmountPaid: 900},
				},
			},
			{
				Type:    "028",
				Key:     "COMISION",
				Concept: "Comisiones de octubre",
				Taxed:   1200,
				Exempt:  0,
			},
		},
		Deductions: []fiscalisto.ExternalPayrollReceiptCreateDeduction{
			{
				Type:    "001",
				Key:     "IMSS",
				Concept: "Cuotas obreras IMSS",
				Amount:  260.15,
			},
			{
				Type:    "002",
				Key:     "ISR",
				Concept: "ISR",
				Amount:  1203.72,
			},
			{
				Type:    "010",
				Key:     "INFONAVIT",
				Concept: "Crédito Infonavit",
				Amount:  950,
			},
			{
				Type:    "004",
				Key:     "PRESTAMO",
				Concept: "Préstamo personal",
				Amount:  500,
			},
		},
		OtherPayments: []fiscalisto.ExternalPayrollReceiptCreateOtherPayment{
			{
				Type:          "002",
				Key:           "SUBSIDIO",
				Concept:       "Subsidio para el empleo",
				Amount:        0,
				SubsidyCaused: fiscalisto.Float64(0),
			},
		},
		Totals: fiscalisto.ExternalPayrollReceiptCreateTotals{
			Perceptions:   9600,
			Deductions:    2913.87,
			OtherPayments: 0,
			Net:           6686.13,
		},
		References: &fiscalisto.ExternalPayrollReceiptCreateReferences{
			EmployeeID:   fiscalisto.String("nom-000123"),
			PayrollRunID: fiscalisto.String("2026-Q19"),
		},
		Metadata: map[string]string{"corrida": "2026-Q19"},
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(invoice.ID)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.ExternalPayrollReceiptCreate;
import com.fiscalisto.model.ExternalPayrollReceiptCreateDeduction;
import com.fiscalisto.model.ExternalPayrollReceiptCreateEmployee;
import com.fiscalisto.model.ExternalPayrollReceiptCreateOtherPayment;
import com.fiscalisto.model.ExternalPayrollReceiptCreatePerception;
import com.fiscalisto.model.ExternalPayrollReceiptCreatePerceptionOvertimeItem;
import com.fiscalisto.model.ExternalPayrollReceiptCreatePeriod;
import com.fiscalisto.model.ExternalPayrollReceiptCreateReferences;
import com.fiscalisto.model.ExternalPayrollReceiptCreateTotals;
import java.util.List;
import java.util.Map;

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

var invoice = fiscalisto.payrollReceipts().createExternal(new ExternalPayrollReceiptCreate()
        .setIssuer("iss_OufpKqnrvx9p")
        .setType("O")
        .setPeriodicity("04")
        .setPeriod(new ExternalPayrollReceiptCreatePeriod()
                .setStart("2026-10-01")
                .setEnd("2026-10-15")
                .setPaymentDate("2026-10-15"))
        .setDays(15)
        .setEmployee(new ExternalPayrollReceiptCreateEmployee()
                .setTaxId("MASO451221PM4")
                .setName("MARIA OLIVIA MARTINEZ SAGAZ")
                .setZip("80290")
                .setCurp("MASO451221MSLRGL08")
                .setNumber("123")
                .setSocialSecurityNumber("12345678903")
                .setStartDate("2024-03-04")
                .setContractType("01")
                .setRegimeType("02")
                .setUnionized(false)
                .setWorkdayType("01")
                .setRiskClass("1")
                .setDepartment("Ventas")
                .setPosition("Ejecutiva de cuenta")
                .setContributionBaseSalary(525.4)
                .setIntegratedDailySalary(525.4)
                .setState("SIN")
                .setBankAccount("002180700601234561"))
        .setPerceptions(List.of(
                new ExternalPayrollReceiptCreatePerception()
                        .setType("001")
                        .setKey("SUELDO")
                        .setConcept("Sueldo")
                        .setTaxed(7500)
                        .setExempt(0),
                new ExternalPayrollReceiptCreatePerception()
                        .setType("019")
                        .setKey("HEXTRA")
                        .setConcept("Horas extra dobles")
                        .setTaxed(450)
                        .setExempt(450)
                        .setOvertime(List.of(
                                new ExternalPayrollReceiptCreatePerceptionOvertimeItem()
                                        .setDays(2)
                                        .setHoursType("01")
                                        .setHours(6)
                                        .setAmountPaid(900)
                        )),
                new ExternalPayrollReceiptCreatePerception()
                        .setType("028")
                        .setKey("COMISION")
                        .setConcept("Comisiones de octubre")
                        .setTaxed(1200)
                        .setExempt(0)
        ))
        .setDeductions(List.of(
                new ExternalPayrollReceiptCreateDeduction()
                        .setType("001")
                        .setKey("IMSS")
                        .setConcept("Cuotas obreras IMSS")
                        .setAmount(260.15),
                new ExternalPayrollReceiptCreateDeduction()
                        .setType("002")
                        .setKey("ISR")
                        .setConcept("ISR")
                        .setAmount(1203.72),
                new ExternalPayrollReceiptCreateDeduction()
                        .setType("010")
                        .setKey("INFONAVIT")
                        .setConcept("Crédito Infonavit")
                        .setAmount(950),
                new ExternalPayrollReceiptCreateDeduction()
                        .setType("004")
                        .setKey("PRESTAMO")
                        .setConcept("Préstamo personal")
                        .setAmount(500)
        ))
        .setOtherPayments(List.of(
                new ExternalPayrollReceiptCreateOtherPayment()
                        .setType("002")
                        .setKey("SUBSIDIO")
                        .setConcept("Subsidio para el empleo")
                        .setAmount(0)
                        .setSubsidyCaused(0)
        ))
        .setTotals(new ExternalPayrollReceiptCreateTotals()
                .setPerceptions(9600)
                .setDeductions(2913.87)
                .setOtherPayments(0)
                .setNet(6686.13))
        .setReferences(new ExternalPayrollReceiptCreateReferences()
                .setEmployeeId("nom-000123")
                .setPayrollRunId("2026-Q19"))
        .setMetadata(Map.of("corrida", "2026-Q19")), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(invoice.getId());
```

## Response 201

OK. Repeating the request with the same Idempotency-Key answers the same, with the same status and the idempotent-replayed: true header.

A `Invoice` 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` | `"invoice"` | yes | What kind of object it is («invoice», «customer»…). |
| `issuer` | string | yes | The issuer (iss_…). |
| `branch` | string or null | yes | The branch (brn_…) it was stamped from, or null (the issuer's tax address). Its payments and credit notes follow it. |
| `cost_center` | string or null | yes | Its cost center (ccn_…), or null. The one sent when creating it, or the one set or changed later with POST /v1/invoices/{id}. |
| `type` | `I`, `E`, `P`, `T`, `N` | yes | Receipt type (TipoDeComprobante): I income, E expense, P payment, T transfer, N payroll. |
| `status` | `processing`, `pending`, `valid`, `rejected`, `canceled` | yes | processing: the PAC hasn't answered (it resolves on its own; listen for invoice.stamped). valid: stamped. pending: stamped, without the UUID yet (it resolves on its own, like processing). A cancellation waiting on the customer doesn't change status: it stays valid, with cancellation.status pending. rejected: the SAT or the PAC didn't accept it (see error). canceled: canceled. |
| `uuid` | string or null | yes | Tax folio the SAT assigns (UUID of the Timbre Fiscal Digital), in uppercase. |
| `series` | string or null | yes | The series (Serie) it was stamped with, or null. |
| `folio` | string or null | yes | Internal folio. On a rejected one it is the one attempted: it isn't used up, and the series' next CFDI uses it. |
| `date` | string or null | yes | Issue date (Fecha), Mexico City time. |
| `customer` | object | yes | The customer (Receptor) as it ended up in the CFDI: RFC, name, tax regime and postal code (and foreign if they are abroad). |
| `customer.tax_id` | string or null | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `customer.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.»). |
| `customer.tax_system` | string |  | Tax regime (RegimenFiscal), a c_RegimenFiscal key: 601, 612, 626… |
| `customer.zip` | string |  | Postal code of the customer's tax address (DomicilioFiscalReceptor), 5 digits. |
| `customer.foreign` | object |  | If they're foreign: their country of residence (ResidenciaFiscal, c_Pais) and their tax registration number (NumRegIdTrib), with the generic RFC XEXX010101000. |
| `use` | string or null | yes | CFDI use (UsoCFDI), a c_UsoCFDI key. G03 by default, or S01 with regime 616. |
| `payment_form` | string or null | yes | Payment form (FormaPago), a c_FormaPago key: 01 cash, 03 transfer, 04 credit card, 28 debit, 99 to be defined… Required with PUE; with PPD it's 99. |
| `payment_method` | string or null | yes | Payment method (MetodoPago): PUE (a single payment, the default) or PPD (in installments or deferred, collected with payment complements). |
| `payment_terms` | string or null | yes | Payment terms (CondicionesDePago), up to 1,000 characters without «\|»: «Crédito a 30 días», «50 % anticipo». They go in the XML and the PDF; income and expense receipts only. They don't change when it is due (due_date uses the customer's credit days). |
| `notes` | string or null | yes | Note for the customer: it appears on the PDF, not in the XML. Changed after stamping with POST /v1/invoices/{id} (the XML doesn't change; the next PDF carries it). |
| `currency` | string | yes | Currency, an ISO 4217 key from c_Moneda (MXN, USD, EUR…). MXN by default. |
| `exchange_rate` | number or null | yes | Exchange rate to pesos (TipoCambio). Required if the currency isn't MXN; use the DOF's from the previous day. |
| `items` | array of object | yes | Line items (Conceptos), at least one. |
| `subtotal` | number or null | yes | Sum of the amounts before taxes and discounts (SubTotal). |
| `discount` | number or null | yes | Discount (Descuento). |
| `taxes` | object or null | yes | The receipt's taxes summed by type: IVA and IEPS transferred, IVA and ISR withheld and local taxes; null on a payment complement. |
| `taxes.iva` | number or null | yes | IVA transferred. |
| `taxes.ieps` | number or null | yes | IEPS transferred. |
| `taxes.iva_withheld` | number or null | yes | IVA withheld. |
| `taxes.isr_withheld` | number or null | yes | ISR withheld. |
| `taxes.local_transferred` | number or null | yes | Local taxes transferred. |
| `taxes.local_withheld` | number or null | yes | Local taxes withheld. |
| `total` | number or null | yes | Total in the receipt's currency (Total). |
| `payment_status` | `paid`, `partial`, `unpaid` or null | yes | Whether it has been collected (Cuentas por cobrar): paid, partial (payment complements or credit notes for part of it) or unpaid. A PUE is paid, except with paid_later until POST /v1/invoices/{id}/mark_paid. null if it isn't income or isn't valid. |
| `amount_due` | number or null | yes | What is left to collect, in its currency, or null. |
| `amount_paid` | number or null | yes | What was collected: valid payment complements and credit notes, or everything if it is a paid PUE. null if it doesn't apply. |
| `paid_on` | string or null | yes | A PUE that was pending collection (paid_later or mark_unpaid): the day the customer paid (YYYY-MM-DD), the one given to POST /v1/invoices/{id}/mark_paid or that of the deposit reconciled with it. null if there is no recorded payment date (a PUE paid when stamped), if it hasn't been paid or if it is PPD (its payments are in its complements). |
| `due_date` | string or null | yes | While it is still to be collected (unpaid or partial): the day it is due (YYYY-MM-DD), its date plus the credit days on the customer's record (or their customer group's) or, without them, the empresa's (30 if you didn't change them); a PUE with paid_later, the last day of its month. These are the days Cuentas por cobrar and the collection reminders use. null if it was already paid or doesn't apply. |
| `related` | object or null | yes | Related CFDIs (CfdiRelacionados): relation type from c_TipoRelacion and the UUIDs. |
| `payment` | object or null |  | Only on a payment complement (type P). |
| `payment.date` | string or null | yes | Payment date (FechaPago). |
| `payment.payment_form` | string or null | yes | Payment form (FormaPago), a c_FormaPago key: 01 cash, 03 transfer, 04 credit card, 28 debit, 99 to be defined… Required with PUE; with PPD it's 99. |
| `payment.currency` | string | yes | Payment currency (MonedaP). |
| `payment.exchange_rate` | number or null | yes | Exchange rate to pesos (TipoCambio). Required if the currency isn't MXN; use the DOF's from the previous day. |
| `payment.amount` | number | yes | Payment amount (Monto). |
| `payment.operation_number` | string or null | yes | Payment's operation number (NumOperacion), like the SPEI tracking key. |
| `payment.documents` | array of object | yes | The invoices it pays (DoctoRelacionado). |
| `payment.documents[].uuid` | string | yes | Tax folio the SAT assigns (UUID of the Timbre Fiscal Digital), in uppercase. |
| `payment.documents[].series` | string or null | yes | Series of the invoice paid. |
| `payment.documents[].folio` | string or null | yes | Folio of the invoice paid. |
| `payment.documents[].currency` | string | yes | Currency of the invoice paid (MonedaDR). |
| `payment.documents[].partiality` | integer | yes | Installment number (NumParcialidad). (from -9007199254740991 to 9007199254740991) |
| `payment.documents[].previous_balance` | number | yes | Previous balance of the invoice (ImpSaldoAnt). |
| `payment.documents[].amount` | number | yes | What is paid of that invoice (ImpPagado), in the invoice's currency. |
| `payment.documents[].remaining` | number | yes | Outstanding balance after this payment (ImpSaldoInsoluto). |
| `payroll` | object |  | The payroll complement 1.2 as stamped: type, period, employer, employee, earnings, deductions, other payments, their nodes and the totals. |
| `payroll.type` | `O`, `E` | yes | TipoNomina: O ordinary, E extraordinary. |
| `payroll.calculation` | `fiscalisto`, `external` | yes | fiscalisto: Fiscalisto calculated it (POST /v1/payroll_receipts); external: your payroll system calculated it and it was stamped as is (POST /v1/payroll_receipts/external). |
| `payroll.periodicity` | string | yes | Pay frequency (PeriodicidadPago): 02 weekly, 03 every 14 days, 04 every two weeks (the default), 05 monthly. |
| `payroll.period` | object | yes | Period paid: FechaInicialPago, FechaFinalPago and FechaPago. |
| `payroll.period.start` | string | yes | First day of the period (FechaInicialPago), YYYY-MM-DD. |
| `payroll.period.end` | string | yes | Last day of the period (FechaFinalPago), YYYY-MM-DD. |
| `payroll.period.payment_date` | string | yes | Payment date (FechaPago), YYYY-MM-DD. The last day of the period by default. |
| `payroll.days` | number | yes | Days paid (NumDiasPagados). By default, all the period's days that apply to them. |
| `payroll.references` | object or null | yes | Your payroll system's ids (external receipts only). |
| `payroll.references.employee_id` | string or null | yes | The employee's id in your payroll system. |
| `payroll.references.payroll_run_id` | string or null | yes | The payroll run's id in your system. |
| `payroll.employer` | object | yes | The employer (Emisor of the complement): employer registration and CURP if it is a persona física. |
| `payroll.employer.employer_registration` | string or null | yes | Employer registration with IMSS (RegistroPatronal), 11 characters. Required to stamp payroll. |
| `payroll.employer.curp` | string or null | yes | CURP, 18 characters. |
| `payroll.employer.origin_tax_id` | string |  | Origin employer's RFC (RfcPatronOrigen). |
| `payroll.employer.sncf` | object |  | SNCF entity (EntidadSNCF). |
| `payroll.employer.sncf.resource_origin` | string | yes | Source of funds (OrigenRecurso): IP, IF or IM. |
| `payroll.employer.sncf.own_resource_amount` | number or null | yes | Own funds amount (MontoRecursoPropio), with IM. |
| `payroll.employee` | object | yes | The employee (Nomina/Receptor), as stamped. |
| `payroll.employee.id` | string or null | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `payroll.employee.number` | string | yes | Employee number (NumEmpleado). |
| `payroll.employee.curp` | string | yes | CURP, 18 characters. |
| `payroll.employee.social_security_number` | string or null | yes | Social security number (NumSeguridadSocial), 11 digits. |
| `payroll.employee.start_date` | string or null | yes | Start date of the employment relationship (FechaInicioRelLaboral), YYYY-MM-DD. |
| `payroll.employee.seniority` | string or null | yes | Seniority (P52W, P1Y2M3D). |
| `payroll.employee.contract_type` | string | yes | Contract type (TipoContrato), c_TipoContrato. 01 by default, permanent. |
| `payroll.employee.unionized` | boolean or null | yes | true if they're unionized (Sindicalizado). |
| `payroll.employee.workday_type` | string or null | yes | Shift type (TipoJornada), c_TipoJornada. 01 by default, day shift. |
| `payroll.employee.regime_type` | string | yes | Regime type (TipoRegimen): 02 wages and salaries. |
| `payroll.employee.department` | string or null | yes | Department (Departamento). |
| `payroll.employee.position` | string or null | yes | Position (Puesto). |
| `payroll.employee.risk_class` | string or null | yes | The position's risk class with IMSS (RiesgoPuesto), 1 to 5. 1 by default. |
| `payroll.employee.contribution_base_salary` | number or null | yes | Contribution base salary (SalarioBaseCotApor). |
| `payroll.employee.integrated_daily_salary` | number or null | yes | Integrated daily salary (SalarioDiarioIntegrado): not lower than the daily salary. |
| `payroll.employee.state` | string | yes | State where they work (ClaveEntFed): JAL, CMX, NLE… |
| `payroll.employee.bank` | string |  | Bank (Banco), c_Banco. |
| `payroll.employee.bank_account` | string |  | Bank account or CLABE (CuentaBancaria). |
| `payroll.employee.subcontracting` | array of object |  | Subcontracting (SubContratacion). |
| `payroll.employee.subcontracting[].tax_id` | string | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `payroll.employee.subcontracting[].percentage` | number | yes | Time percentage (PorcentajeTiempo). |
| `payroll.perceptions` | array of object | yes | Earnings (Percepcion): wages and the rest, taxable and exempt. |
| `payroll.perceptions[].type` | string | yes | Earning type (TipoPercepcion), c_TipoPercepcion: 001 wages… |
| `payroll.perceptions[].key` | string | yes | Employer's code (Clave). |
| `payroll.perceptions[].concept` | string | yes | Concept (Concepto). |
| `payroll.perceptions[].taxed` | number | yes | Taxable amount (ImporteGravado). |
| `payroll.perceptions[].exempt` | number | yes | Exempt amount (ImporteExento). |
| `payroll.perceptions[].overtime` | array of object |  | Overtime (HorasExtra), with earning 019. |
| `payroll.perceptions[].overtime[].days` | integer | yes | Days with overtime (Dias). (from -9007199254740991 to 9007199254740991) |
| `payroll.perceptions[].overtime[].hours_type` | string | yes | c_TipoHoras: 01 double, 02 triple, 03 single. |
| `payroll.perceptions[].overtime[].hours` | integer | yes | Overtime hours (HorasExtra). (from -9007199254740991 to 9007199254740991) |
| `payroll.perceptions[].overtime[].amount_paid` | number | yes | Amount paid (ImportePagado). |
| `payroll.perceptions[].stock_options` | object |  | Shares or securities (AccionesOTitulos), with earning 045. |
| `payroll.perceptions[].stock_options.market_value` | number | yes | Market value (ValorMercado). |
| `payroll.perceptions[].stock_options.grant_price` | number | yes | Price when granted (PrecioAlOtorgarse). |
| `payroll.deductions` | array of object | yes | Deductions (Deduccion): ISR, IMSS contributions and the rest. |
| `payroll.deductions[].type` | string | yes | Deduction type (TipoDeduccion), c_TipoDeduccion: 001 IMSS, 002 ISR… |
| `payroll.deductions[].key` | string | yes | Employer's code (Clave). |
| `payroll.deductions[].concept` | string | yes | Concept (Concepto). |
| `payroll.deductions[].amount` | number | yes | Amount (Importe). |
| `payroll.other_payments` | array of object | yes | Other payments (OtroPago): employment subsidy. |
| `payroll.other_payments[].type` | string | yes | Other payment type (TipoOtroPago), c_TipoOtroPago: 002 employment subsidy. |
| `payroll.other_payments[].key` | string | yes | Employer's code (Clave). |
| `payroll.other_payments[].concept` | string | yes | Concept (Concepto). |
| `payroll.other_payments[].amount` | number | yes | Amount paid (Importe). |
| `payroll.other_payments[].subsidy_caused` | number |  | Subsidy accrued (SubsidioCausado). |
| `payroll.other_payments[].subsidy_applied` | number |  | Of the subsidy accrued, the ISR it avoided (not in the XML). |
| `payroll.other_payments[].balance_compensation` | object |  | Offset of the balance in favor (CompensacionSaldosAFavor), with 004. |
| `payroll.other_payments[].balance_compensation.balance` | number | yes | Balance in favor (SaldoAFavor). |
| `payroll.other_payments[].balance_compensation.year` | integer | yes | Year of the balance in favor (Año). (from -9007199254740991 to 9007199254740991) |
| `payroll.other_payments[].balance_compensation.remaining` | number | yes | Remainder of the balance in favor (RemanenteSalFav). |
| `payroll.separation` | object |  | SeparacionIndemnizacion (earnings 022, 023, 025). |
| `payroll.separation.total_paid` | number | yes | Total paid (TotalPagado). |
| `payroll.separation.years_of_service` | integer | yes | Years of service (NumAñosServicio). (from -9007199254740991 to 9007199254740991) |
| `payroll.separation.last_monthly_salary` | number | yes | Last ordinary monthly salary (UltimoSueldoMensOrd). |
| `payroll.separation.accumulable_income` | number | yes | Cumulative income (IngresoAcumulable). |
| `payroll.separation.non_accumulable_income` | number | yes | Non-cumulative income (IngresoNoAcumulable). |
| `payroll.retirement` | object |  | JubilacionPensionRetiro (earnings 039, 044). |
| `payroll.retirement.total_one_payment` | number |  | Total in a single payment (TotalUnaExhibicion). |
| `payroll.retirement.total_installment` | number |  | Total in installments (TotalParcialidad). |
| `payroll.retirement.daily_amount` | number |  | Daily amount (MontoDiario). |
| `payroll.retirement.accumulable_income` | number | yes | Cumulative income (IngresoAcumulable). |
| `payroll.retirement.non_accumulable_income` | number | yes | Non-cumulative income (IngresoNoAcumulable). |
| `payroll.disabilities` | array of object |  | Disabilities (earning 014 or deduction 006). |
| `payroll.disabilities[].days` | integer | yes | Days paid (NumDiasPagados). By default, all the period's days that apply to them. (from -9007199254740991 to 9007199254740991) |
| `payroll.disabilities[].type` | string | yes | Receipt type (TipoDeComprobante): I income, E expense, P payment, T transfer, N payroll. |
| `payroll.disabilities[].amount` | number or null | yes | Amount. |
| `payroll.imss_days` | object |  | On a receipt Fiscalisto calculated: the IMSS days. |
| `payroll.imss_days.calendar_days` | integer | yes | Calendar days of the period they worked for the employer: IMSS contributions accrue per calendar month (LSS art. 39), not per days paid. (from -9007199254740991 to 9007199254740991) |
| `payroll.imss_days.absences` | integer | yes | Absences on the receipt. (from -9007199254740991 to 9007199254740991) |
| `payroll.imss_days.disability_days` | integer | yes | Sick-leave days on the receipt. (from -9007199254740991 to 9007199254740991) |
| `payroll.imss_days.sickness_and_maternity` | integer | yes | Days contributed for sickness and maternity (surplus, cash benefits, pensioners' medical expenses): the period without the sick leave; absences count (LSS art. 31 fr. I). (from -9007199254740991 to 9007199254740991) |
| `payroll.imss_days.disability_and_old_age` | integer | yes | Days contributed for disability and life and for old-age and severance retirement: also without the absences, up to 7 per month. (from -9007199254740991 to 9007199254740991) |
| `payroll.totals` | object | yes | Totals: earnings, deductions, other payments and net pay. |
| `payroll.totals.salaries` | number | yes | Total wages, salaries and assimilated income (TotalSueldos). |
| `payroll.totals.taxed` | number | yes | Total taxable (TotalGravado). |
| `payroll.totals.exempt` | number | yes | Total exempt (TotalExento). |
| `payroll.totals.separation` | number | yes | Total separation and severance (TotalSeparacionIndemnizacion). |
| `payroll.totals.retirement` | number | yes | Total retirement, pension or withdrawal (TotalJubilacionPensionRetiro). |
| `payroll.totals.perceptions` | number | yes | Total earnings (TotalPercepciones). |
| `payroll.totals.other_deductions` | number | yes | Other deductions (TotalOtrasDeducciones). |
| `payroll.totals.taxes_withheld` | number | yes | Taxes withheld (TotalImpuestosRetenidos). |
| `payroll.totals.deductions` | number | yes | Total deductions (TotalDeducciones). |
| `payroll.totals.other_payments` | number | yes | Total other payments (TotalOtrosPagos). |
| `payroll.totals.subtotal` | number | yes | Receipt subtotal: earnings plus other payments. |
| `payroll.totals.net` | number | yes | Net pay for the employee. |
| `global` | object |  | Only on a global invoice. |
| `cancellation` | object or null | yes | The cancellation, if requested: status, reason, replacement and when. |
| `cancellation.status` | string or null | yes | `pending`: the SAT has the request (it finishes it in minutes, or waits for the recipient's answer). `accepted`: canceled. `rejected`: the recipient rejected it. `lapsed`: the SAT never recorded it; it can be requested again. `scheduled`: the SAT doesn't accept it yet (it doesn't have the replacing CFDI on record, or briefly rejected the signature) and Fiscalisto requests it again on its own. `failed`: Fiscalisto stopped trying; request it again with POST /v1/invoices/{id}/cancel. |
| `cancellation.motive` | string or null | yes | Cancellation reason (c_MotivoCancelacion): 01 with errors, related (carries substitution), 02 with errors, not related (the default), 03 didn't take place, 04 only on a global invoice, when an included sale was invoiced in the customer's name. |
| `cancellation.substitution` | string or null | yes | The CFDI that replaces this one (its id or its UUID), with reason 01. |
| `cancellation.canceled_at` | string (date-time) or null | yes | When it was canceled. |
| `cancellation.next_attempt_at` | string (date-time) or null | yes | With `scheduled`: when Fiscalisto requests it again (null: within the next 15 minutes). |
| `cancellation.error` | string or null | yes | With `scheduled` or `failed`: why it hasn't gone through. |
| `email` | object or null | yes | The email send: to whom, cc to whom and when (null if it hasn't been sent). |
| `email.to` | string or null | yes | To whom (emails separated by commas). |
| `email.cc` | string or null | yes | CC (emails separated by commas). |
| `email.sent_at` | string (date-time) or null | yes | When it was sent. |
| `email.status` | `sent`, `delayed`, `delivered`, `opened`, `bounced`, `complained` | yes | What happened with the last send: the worst of its recipients (bounced or complained weigh more than opened or delivered). sent until the customer's server answers. |
| `email.recipients` | array of object | yes | Each address of the send (to and cc), with its delivery. |
| `email.recipients[].address` | string | yes | The recipient's email address. |
| `email.recipients[].status` | `sent`, `delayed`, `delivered`, `opened`, `bounced`, `complained` | yes | Object status. |
| `email.recipients[].delivered_at` | string (date-time) or null | yes | When the recipient's server accepted it. |
| `email.recipients[].opened_at` | string (date-time) or null | yes | The first time it was opened (approximate: some email clients load images on their own or don't load them). |
| `email.recipients[].bounced_at` | string (date-time) or null | yes | When it bounced. |
| `email.recipients[].bounce_reason` | string or null | yes | Why it bounced, in Spanish: «buzón no existe», «buzón lleno»… |
| `email.recipients[].complained_at` | string (date-time) or null | yes | When the recipient marked it as spam. |
| `error` | object or null | yes | Why the SAT or the PAC didn't accept it: message, SAT code and original text. |
| `error.message` | string | yes | What happened and how to fix it, for a person. |
| `error.sat_code` | string or null | yes | SAT or PAC code (CFDI40xxx). |
| `error.raw` | string | yes | The PAC's original text. |
| `recurring_invoice` | string or null | yes | The recurring invoice (rin_…) that stamped it on its own, or null if it was stamped with a call. |
| `tickets` | array of string | yes | The tickets (`tkt_…`) it invoices: the one your customer invoiced through autofactura, the one your team invoiced from the ticket's page, or the ones associated with it. Empty otherwise; a global invoice's tickets are in GET /v1/tickets with `status=global`. |
| `origin` | object or null | yes | What stamped the invoice; `null` if it was stamped outside Fiscalisto. |
| `origin.type` | `app`, `api`, `assistant`, `point_of_sale`, `autofactura`, `invoice_link`, `quote`, `recurring_invoice`, `global_invoice` | yes | What stamped it: `app` (a person in Fiscalisto), `api`, `assistant` (an AI assistant through MCP), `point_of_sale` (a point-of-sale key), `autofactura` (your customer with a ticket, or the buyer's data from Stripe or Mercado Libre), `invoice_link` (your customer filling in the invoice link), `quote` (your customer accepting the quote), `recurring_invoice` (a recurring invoice by itself) or `global_invoice` (the tickets' automatic global invoice). |
| `origin.name` | string or null | yes | The name of the API or point-of-sale key, the assistant («ChatGPT») or where an autofactura's buyer data came from («Stripe»). |
| `created_at` | string (date-time) or null | yes | When it was created, ISO 8601 with Mexico City time (-06:00). |
| `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. |
| `warnings` | array of string |  | Warnings about the invoice (only in the response that stamps it or, with 202, the one that leaves it processing): it is stamped as sent. |
| `email_error` | string |  | Why the email couldn't be sent; the receipt was stamped. |
| `substitutes` | object |  | The invoice this one replaced and whether it was canceled. |
| `substitutes.invoice` | string | yes | The replaced invoice (inv_…). |
| `substitutes.canceled` | boolean | yes | true if the replaced one is already canceled. false isn't final: see substitutes.cancellation. |
| `substitutes.cancel_error` | string |  | Why the replaced one couldn't be canceled (cancel it with POST /v1/invoices/{id}/cancel). |
| `substitutes.cancellation` | object or null | yes | The previous one's cancellation, same as its `cancellation` in GET /v1/invoices/{id}: `accepted` if it is already canceled, `pending` if the SAT is finishing it (or waiting for the recipient), `scheduled` if Fiscalisto requests it again on its own, `failed` if it must be requested again. The previous one's webhook says when it changes. |
| `substitutes.cancellation.status` | string or null | yes | `pending`: the SAT has the request (it finishes it in minutes, or waits for the recipient's answer). `accepted`: canceled. `rejected`: the recipient rejected it. `lapsed`: the SAT never recorded it; it can be requested again. `scheduled`: the SAT doesn't accept it yet (it doesn't have the replacing CFDI on record, or briefly rejected the signature) and Fiscalisto requests it again on its own. `failed`: Fiscalisto stopped trying; request it again with POST /v1/invoices/{id}/cancel. |
| `substitutes.cancellation.motive` | string or null | yes | Cancellation reason (c_MotivoCancelacion): 01 with errors, related (carries substitution), 02 with errors, not related (the default), 03 didn't take place, 04 only on a global invoice, when an included sale was invoiced in the customer's name. |
| `substitutes.cancellation.substitution` | string or null | yes | The CFDI that replaces this one (its id or its UUID), with reason 01. |
| `substitutes.cancellation.canceled_at` | string (date-time) or null | yes | When it was canceled. |
| `substitutes.cancellation.next_attempt_at` | string (date-time) or null | yes | With `scheduled`: when Fiscalisto requests it again (null: within the next 15 minutes). |
| `substitutes.cancellation.error` | string or null | yes | With `scheduled` or `failed`: why it hasn't gone through. |
| `advance_application` | object |  | The advance payment's application: method, application note and its status. |
| `advance_application.advance` | string or null | yes | The advance payment, as an invoice (inv_…). |
| `advance_application.advance_uuid` | string | yes | The advance payment's tax folio. |
| `advance_application.method` | `egreso`, `remanente` | yes | egreso (the full invoice and then a credit note for the advance payment, option A) or remanente (the invoice only for what's left, option B). |
| `advance_application.status` | `done`, `credit_note_pending` | yes | done (ready) or credit_note_pending (the application note still has to be stamped: repeat the request with the same Idempotency-Key). |
| `advance_application.credit_note` | string or null | yes | The advance payment's application note (inv_…), with method egreso. |
| `advance_application.credit_note_error` | string |  | Why the application note wasn't stamped (repeat with the same Idempotency-Key). |

```json
{
  "id": "inv_OufpKqnrvx9p6Xp2nL8rTq5vMz3wKc9bHd",
  "object": "invoice",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "branch": null,
  "cost_center": null,
  "type": "N",
  "status": "valid",
  "uuid": "1C9B7E52-6A3F-4D8E-9B21-7F4C0D5E8A63",
  "series": null,
  "folio": "9",
  "date": "2026-10-15T09:30:12",
  "customer": {
    "tax_id": "MASO451221PM4",
    "legal_name": "MARIA OLIVIA MARTINEZ SAGAZ",
    "tax_system": "605",
    "zip": "80290"
  },
  "use": "CN01",
  "payment_form": null,
  "payment_method": "PUE",
  "payment_terms": null,
  "notes": null,
  "currency": "MXN",
  "exchange_rate": null,
  "items": [
    {
      "description": "Pago de nómina",
      "product_key": "84111505",
      "unit_key": "ACT",
      "quantity": 1,
      "unit_price": 9600,
      "discount": 2913.87,
      "taxability": "01",
      "iva": "0"
    }
  ],
  "subtotal": 9600,
  "discount": 2913.87,
  "taxes": {
    "iva": 0,
    "ieps": 0,
    "iva_withheld": 0,
    "isr_withheld": 0,
    "local_transferred": 0,
    "local_withheld": 0
  },
  "total": 6686.13,
  "payment_status": null,
  "amount_due": null,
  "amount_paid": null,
  "paid_on": null,
  "due_date": null,
  "related": null,
  "cancellation": null,
  "email": null,
  "error": null,
  "recurring_invoice": null,
  "tickets": [],
  "origin": {
    "type": "api",
    "name": "Tienda en línea"
  },
  "created_at": "2026-10-15T09:30:12-06:00",
  "metadata": {
    "corrida": "2026-Q19"
  },
  "payroll": {
    "type": "O",
    "calculation": "external",
    "periodicity": "04",
    "period": {
      "start": "2026-10-01",
      "end": "2026-10-15",
      "payment_date": "2026-10-15"
    },
    "days": 15,
    "references": {
      "employee_id": "nom-000123",
      "payroll_run_id": "2026-Q19"
    },
    "employer": {
      "employer_registration": "Y5412345109",
      "curp": null
    },
    "employee": {
      "id": null,
      "number": "123",
      "curp": "MASO451221MSLRGL08",
      "social_security_number": "12345678903",
      "start_date": "2024-03-04",
      "seniority": "P136W",
      "contract_type": "01",
      "unionized": false,
      "workday_type": "01",
      "regime_type": "02",
      "department": "Ventas",
      "position": "Ejecutiva de cuenta",
      "risk_class": "1",
      "contribution_base_salary": 525.4,
      "integrated_daily_salary": 525.4,
      "state": "SIN",
      "bank_account": "002180700601234561"
    },
    "perceptions": [
      {
        "type": "001",
        "key": "SUELDO",
        "concept": "Sueldo",
        "taxed": 7500,
        "exempt": 0
      },
      {
        "type": "019",
        "key": "HEXTRA",
        "concept": "Horas extra dobles",
        "taxed": 450,
        "exempt": 450,
        "overtime": [
          {
            "days": 2,
            "hours_type": "01",
            "hours": 6,
            "amount_paid": 900
          }
        ]
      },
      {
        "type": "028",
        "key": "COMISION",
        "concept": "Comisiones de octubre",
        "taxed": 1200,
        "exempt": 0
      }
    ],
    "deductions": [
      {
        "type": "001",
        "key": "IMSS",
        "concept": "Cuotas obreras IMSS",
        "amount": 260.15
      },
      {
        "type": "002",
        "key": "ISR",
        "concept": "ISR",
        "amount": 1203.72
      },
      {
        "type": "010",
        "key": "INFONAVIT",
        "concept": "Crédito Infonavit",
        "amount": 950
      },
      {
        "type": "004",
        "key": "PRESTAMO",
        "concept": "Préstamo personal",
        "amount": 500
      }
    ],
    "other_payments": [
      {
        "type": "002",
        "key": "SUBSIDIO",
        "concept": "Subsidio para el empleo",
        "amount": 0,
        "subsidy_caused": 0
      }
    ],
    "totals": {
      "salaries": 9600,
      "separation": 0,
      "retirement": 0,
      "taxed": 9150,
      "exempt": 450,
      "perceptions": 9600,
      "other_deductions": 1710.15,
      "taxes_withheld": 1203.72,
      "deductions": 2913.87,
      "other_payments": 0,
      "subtotal": 9600,
      "net": 6686.13
    }
  }
}
```

## Response 202

The PAC didn't answer in time: the CFDI stays in processing and is stamped on its own in a few moments. Listen for the *.stamped event or look it up with GET; repeating the request with the same Idempotency-Key answers its status without stamping again.

A `Invoice` 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` | `"invoice"` | yes | What kind of object it is («invoice», «customer»…). |
| `issuer` | string | yes | The issuer (iss_…). |
| `branch` | string or null | yes | The branch (brn_…) it was stamped from, or null (the issuer's tax address). Its payments and credit notes follow it. |
| `cost_center` | string or null | yes | Its cost center (ccn_…), or null. The one sent when creating it, or the one set or changed later with POST /v1/invoices/{id}. |
| `type` | `I`, `E`, `P`, `T`, `N` | yes | Receipt type (TipoDeComprobante): I income, E expense, P payment, T transfer, N payroll. |
| `status` | `processing`, `pending`, `valid`, `rejected`, `canceled` | yes | processing: the PAC hasn't answered (it resolves on its own; listen for invoice.stamped). valid: stamped. pending: stamped, without the UUID yet (it resolves on its own, like processing). A cancellation waiting on the customer doesn't change status: it stays valid, with cancellation.status pending. rejected: the SAT or the PAC didn't accept it (see error). canceled: canceled. |
| `uuid` | string or null | yes | Tax folio the SAT assigns (UUID of the Timbre Fiscal Digital), in uppercase. |
| `series` | string or null | yes | The series (Serie) it was stamped with, or null. |
| `folio` | string or null | yes | Internal folio. On a rejected one it is the one attempted: it isn't used up, and the series' next CFDI uses it. |
| `date` | string or null | yes | Issue date (Fecha), Mexico City time. |
| `customer` | object | yes | The customer (Receptor) as it ended up in the CFDI: RFC, name, tax regime and postal code (and foreign if they are abroad). |
| `customer.tax_id` | string or null | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `customer.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.»). |
| `customer.tax_system` | string |  | Tax regime (RegimenFiscal), a c_RegimenFiscal key: 601, 612, 626… |
| `customer.zip` | string |  | Postal code of the customer's tax address (DomicilioFiscalReceptor), 5 digits. |
| `customer.foreign` | object |  | If they're foreign: their country of residence (ResidenciaFiscal, c_Pais) and their tax registration number (NumRegIdTrib), with the generic RFC XEXX010101000. |
| `use` | string or null | yes | CFDI use (UsoCFDI), a c_UsoCFDI key. G03 by default, or S01 with regime 616. |
| `payment_form` | string or null | yes | Payment form (FormaPago), a c_FormaPago key: 01 cash, 03 transfer, 04 credit card, 28 debit, 99 to be defined… Required with PUE; with PPD it's 99. |
| `payment_method` | string or null | yes | Payment method (MetodoPago): PUE (a single payment, the default) or PPD (in installments or deferred, collected with payment complements). |
| `payment_terms` | string or null | yes | Payment terms (CondicionesDePago), up to 1,000 characters without «\|»: «Crédito a 30 días», «50 % anticipo». They go in the XML and the PDF; income and expense receipts only. They don't change when it is due (due_date uses the customer's credit days). |
| `notes` | string or null | yes | Note for the customer: it appears on the PDF, not in the XML. Changed after stamping with POST /v1/invoices/{id} (the XML doesn't change; the next PDF carries it). |
| `currency` | string | yes | Currency, an ISO 4217 key from c_Moneda (MXN, USD, EUR…). MXN by default. |
| `exchange_rate` | number or null | yes | Exchange rate to pesos (TipoCambio). Required if the currency isn't MXN; use the DOF's from the previous day. |
| `items` | array of object | yes | Line items (Conceptos), at least one. |
| `subtotal` | number or null | yes | Sum of the amounts before taxes and discounts (SubTotal). |
| `discount` | number or null | yes | Discount (Descuento). |
| `taxes` | object or null | yes | The receipt's taxes summed by type: IVA and IEPS transferred, IVA and ISR withheld and local taxes; null on a payment complement. |
| `taxes.iva` | number or null | yes | IVA transferred. |
| `taxes.ieps` | number or null | yes | IEPS transferred. |
| `taxes.iva_withheld` | number or null | yes | IVA withheld. |
| `taxes.isr_withheld` | number or null | yes | ISR withheld. |
| `taxes.local_transferred` | number or null | yes | Local taxes transferred. |
| `taxes.local_withheld` | number or null | yes | Local taxes withheld. |
| `total` | number or null | yes | Total in the receipt's currency (Total). |
| `payment_status` | `paid`, `partial`, `unpaid` or null | yes | Whether it has been collected (Cuentas por cobrar): paid, partial (payment complements or credit notes for part of it) or unpaid. A PUE is paid, except with paid_later until POST /v1/invoices/{id}/mark_paid. null if it isn't income or isn't valid. |
| `amount_due` | number or null | yes | What is left to collect, in its currency, or null. |
| `amount_paid` | number or null | yes | What was collected: valid payment complements and credit notes, or everything if it is a paid PUE. null if it doesn't apply. |
| `paid_on` | string or null | yes | A PUE that was pending collection (paid_later or mark_unpaid): the day the customer paid (YYYY-MM-DD), the one given to POST /v1/invoices/{id}/mark_paid or that of the deposit reconciled with it. null if there is no recorded payment date (a PUE paid when stamped), if it hasn't been paid or if it is PPD (its payments are in its complements). |
| `due_date` | string or null | yes | While it is still to be collected (unpaid or partial): the day it is due (YYYY-MM-DD), its date plus the credit days on the customer's record (or their customer group's) or, without them, the empresa's (30 if you didn't change them); a PUE with paid_later, the last day of its month. These are the days Cuentas por cobrar and the collection reminders use. null if it was already paid or doesn't apply. |
| `related` | object or null | yes | Related CFDIs (CfdiRelacionados): relation type from c_TipoRelacion and the UUIDs. |
| `payment` | object or null |  | Only on a payment complement (type P). |
| `payment.date` | string or null | yes | Payment date (FechaPago). |
| `payment.payment_form` | string or null | yes | Payment form (FormaPago), a c_FormaPago key: 01 cash, 03 transfer, 04 credit card, 28 debit, 99 to be defined… Required with PUE; with PPD it's 99. |
| `payment.currency` | string | yes | Payment currency (MonedaP). |
| `payment.exchange_rate` | number or null | yes | Exchange rate to pesos (TipoCambio). Required if the currency isn't MXN; use the DOF's from the previous day. |
| `payment.amount` | number | yes | Payment amount (Monto). |
| `payment.operation_number` | string or null | yes | Payment's operation number (NumOperacion), like the SPEI tracking key. |
| `payment.documents` | array of object | yes | The invoices it pays (DoctoRelacionado). |
| `payment.documents[].uuid` | string | yes | Tax folio the SAT assigns (UUID of the Timbre Fiscal Digital), in uppercase. |
| `payment.documents[].series` | string or null | yes | Series of the invoice paid. |
| `payment.documents[].folio` | string or null | yes | Folio of the invoice paid. |
| `payment.documents[].currency` | string | yes | Currency of the invoice paid (MonedaDR). |
| `payment.documents[].partiality` | integer | yes | Installment number (NumParcialidad). (from -9007199254740991 to 9007199254740991) |
| `payment.documents[].previous_balance` | number | yes | Previous balance of the invoice (ImpSaldoAnt). |
| `payment.documents[].amount` | number | yes | What is paid of that invoice (ImpPagado), in the invoice's currency. |
| `payment.documents[].remaining` | number | yes | Outstanding balance after this payment (ImpSaldoInsoluto). |
| `payroll` | object |  | The payroll complement 1.2 as stamped: type, period, employer, employee, earnings, deductions, other payments, their nodes and the totals. |
| `payroll.type` | `O`, `E` | yes | TipoNomina: O ordinary, E extraordinary. |
| `payroll.calculation` | `fiscalisto`, `external` | yes | fiscalisto: Fiscalisto calculated it (POST /v1/payroll_receipts); external: your payroll system calculated it and it was stamped as is (POST /v1/payroll_receipts/external). |
| `payroll.periodicity` | string | yes | Pay frequency (PeriodicidadPago): 02 weekly, 03 every 14 days, 04 every two weeks (the default), 05 monthly. |
| `payroll.period` | object | yes | Period paid: FechaInicialPago, FechaFinalPago and FechaPago. |
| `payroll.period.start` | string | yes | First day of the period (FechaInicialPago), YYYY-MM-DD. |
| `payroll.period.end` | string | yes | Last day of the period (FechaFinalPago), YYYY-MM-DD. |
| `payroll.period.payment_date` | string | yes | Payment date (FechaPago), YYYY-MM-DD. The last day of the period by default. |
| `payroll.days` | number | yes | Days paid (NumDiasPagados). By default, all the period's days that apply to them. |
| `payroll.references` | object or null | yes | Your payroll system's ids (external receipts only). |
| `payroll.references.employee_id` | string or null | yes | The employee's id in your payroll system. |
| `payroll.references.payroll_run_id` | string or null | yes | The payroll run's id in your system. |
| `payroll.employer` | object | yes | The employer (Emisor of the complement): employer registration and CURP if it is a persona física. |
| `payroll.employer.employer_registration` | string or null | yes | Employer registration with IMSS (RegistroPatronal), 11 characters. Required to stamp payroll. |
| `payroll.employer.curp` | string or null | yes | CURP, 18 characters. |
| `payroll.employer.origin_tax_id` | string |  | Origin employer's RFC (RfcPatronOrigen). |
| `payroll.employer.sncf` | object |  | SNCF entity (EntidadSNCF). |
| `payroll.employer.sncf.resource_origin` | string | yes | Source of funds (OrigenRecurso): IP, IF or IM. |
| `payroll.employer.sncf.own_resource_amount` | number or null | yes | Own funds amount (MontoRecursoPropio), with IM. |
| `payroll.employee` | object | yes | The employee (Nomina/Receptor), as stamped. |
| `payroll.employee.id` | string or null | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `payroll.employee.number` | string | yes | Employee number (NumEmpleado). |
| `payroll.employee.curp` | string | yes | CURP, 18 characters. |
| `payroll.employee.social_security_number` | string or null | yes | Social security number (NumSeguridadSocial), 11 digits. |
| `payroll.employee.start_date` | string or null | yes | Start date of the employment relationship (FechaInicioRelLaboral), YYYY-MM-DD. |
| `payroll.employee.seniority` | string or null | yes | Seniority (P52W, P1Y2M3D). |
| `payroll.employee.contract_type` | string | yes | Contract type (TipoContrato), c_TipoContrato. 01 by default, permanent. |
| `payroll.employee.unionized` | boolean or null | yes | true if they're unionized (Sindicalizado). |
| `payroll.employee.workday_type` | string or null | yes | Shift type (TipoJornada), c_TipoJornada. 01 by default, day shift. |
| `payroll.employee.regime_type` | string | yes | Regime type (TipoRegimen): 02 wages and salaries. |
| `payroll.employee.department` | string or null | yes | Department (Departamento). |
| `payroll.employee.position` | string or null | yes | Position (Puesto). |
| `payroll.employee.risk_class` | string or null | yes | The position's risk class with IMSS (RiesgoPuesto), 1 to 5. 1 by default. |
| `payroll.employee.contribution_base_salary` | number or null | yes | Contribution base salary (SalarioBaseCotApor). |
| `payroll.employee.integrated_daily_salary` | number or null | yes | Integrated daily salary (SalarioDiarioIntegrado): not lower than the daily salary. |
| `payroll.employee.state` | string | yes | State where they work (ClaveEntFed): JAL, CMX, NLE… |
| `payroll.employee.bank` | string |  | Bank (Banco), c_Banco. |
| `payroll.employee.bank_account` | string |  | Bank account or CLABE (CuentaBancaria). |
| `payroll.employee.subcontracting` | array of object |  | Subcontracting (SubContratacion). |
| `payroll.employee.subcontracting[].tax_id` | string | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `payroll.employee.subcontracting[].percentage` | number | yes | Time percentage (PorcentajeTiempo). |
| `payroll.perceptions` | array of object | yes | Earnings (Percepcion): wages and the rest, taxable and exempt. |
| `payroll.perceptions[].type` | string | yes | Earning type (TipoPercepcion), c_TipoPercepcion: 001 wages… |
| `payroll.perceptions[].key` | string | yes | Employer's code (Clave). |
| `payroll.perceptions[].concept` | string | yes | Concept (Concepto). |
| `payroll.perceptions[].taxed` | number | yes | Taxable amount (ImporteGravado). |
| `payroll.perceptions[].exempt` | number | yes | Exempt amount (ImporteExento). |
| `payroll.perceptions[].overtime` | array of object |  | Overtime (HorasExtra), with earning 019. |
| `payroll.perceptions[].overtime[].days` | integer | yes | Days with overtime (Dias). (from -9007199254740991 to 9007199254740991) |
| `payroll.perceptions[].overtime[].hours_type` | string | yes | c_TipoHoras: 01 double, 02 triple, 03 single. |
| `payroll.perceptions[].overtime[].hours` | integer | yes | Overtime hours (HorasExtra). (from -9007199254740991 to 9007199254740991) |
| `payroll.perceptions[].overtime[].amount_paid` | number | yes | Amount paid (ImportePagado). |
| `payroll.perceptions[].stock_options` | object |  | Shares or securities (AccionesOTitulos), with earning 045. |
| `payroll.perceptions[].stock_options.market_value` | number | yes | Market value (ValorMercado). |
| `payroll.perceptions[].stock_options.grant_price` | number | yes | Price when granted (PrecioAlOtorgarse). |
| `payroll.deductions` | array of object | yes | Deductions (Deduccion): ISR, IMSS contributions and the rest. |
| `payroll.deductions[].type` | string | yes | Deduction type (TipoDeduccion), c_TipoDeduccion: 001 IMSS, 002 ISR… |
| `payroll.deductions[].key` | string | yes | Employer's code (Clave). |
| `payroll.deductions[].concept` | string | yes | Concept (Concepto). |
| `payroll.deductions[].amount` | number | yes | Amount (Importe). |
| `payroll.other_payments` | array of object | yes | Other payments (OtroPago): employment subsidy. |
| `payroll.other_payments[].type` | string | yes | Other payment type (TipoOtroPago), c_TipoOtroPago: 002 employment subsidy. |
| `payroll.other_payments[].key` | string | yes | Employer's code (Clave). |
| `payroll.other_payments[].concept` | string | yes | Concept (Concepto). |
| `payroll.other_payments[].amount` | number | yes | Amount paid (Importe). |
| `payroll.other_payments[].subsidy_caused` | number |  | Subsidy accrued (SubsidioCausado). |
| `payroll.other_payments[].subsidy_applied` | number |  | Of the subsidy accrued, the ISR it avoided (not in the XML). |
| `payroll.other_payments[].balance_compensation` | object |  | Offset of the balance in favor (CompensacionSaldosAFavor), with 004. |
| `payroll.other_payments[].balance_compensation.balance` | number | yes | Balance in favor (SaldoAFavor). |
| `payroll.other_payments[].balance_compensation.year` | integer | yes | Year of the balance in favor (Año). (from -9007199254740991 to 9007199254740991) |
| `payroll.other_payments[].balance_compensation.remaining` | number | yes | Remainder of the balance in favor (RemanenteSalFav). |
| `payroll.separation` | object |  | SeparacionIndemnizacion (earnings 022, 023, 025). |
| `payroll.separation.total_paid` | number | yes | Total paid (TotalPagado). |
| `payroll.separation.years_of_service` | integer | yes | Years of service (NumAñosServicio). (from -9007199254740991 to 9007199254740991) |
| `payroll.separation.last_monthly_salary` | number | yes | Last ordinary monthly salary (UltimoSueldoMensOrd). |
| `payroll.separation.accumulable_income` | number | yes | Cumulative income (IngresoAcumulable). |
| `payroll.separation.non_accumulable_income` | number | yes | Non-cumulative income (IngresoNoAcumulable). |
| `payroll.retirement` | object |  | JubilacionPensionRetiro (earnings 039, 044). |
| `payroll.retirement.total_one_payment` | number |  | Total in a single payment (TotalUnaExhibicion). |
| `payroll.retirement.total_installment` | number |  | Total in installments (TotalParcialidad). |
| `payroll.retirement.daily_amount` | number |  | Daily amount (MontoDiario). |
| `payroll.retirement.accumulable_income` | number | yes | Cumulative income (IngresoAcumulable). |
| `payroll.retirement.non_accumulable_income` | number | yes | Non-cumulative income (IngresoNoAcumulable). |
| `payroll.disabilities` | array of object |  | Disabilities (earning 014 or deduction 006). |
| `payroll.disabilities[].days` | integer | yes | Days paid (NumDiasPagados). By default, all the period's days that apply to them. (from -9007199254740991 to 9007199254740991) |
| `payroll.disabilities[].type` | string | yes | Receipt type (TipoDeComprobante): I income, E expense, P payment, T transfer, N payroll. |
| `payroll.disabilities[].amount` | number or null | yes | Amount. |
| `payroll.imss_days` | object |  | On a receipt Fiscalisto calculated: the IMSS days. |
| `payroll.imss_days.calendar_days` | integer | yes | Calendar days of the period they worked for the employer: IMSS contributions accrue per calendar month (LSS art. 39), not per days paid. (from -9007199254740991 to 9007199254740991) |
| `payroll.imss_days.absences` | integer | yes | Absences on the receipt. (from -9007199254740991 to 9007199254740991) |
| `payroll.imss_days.disability_days` | integer | yes | Sick-leave days on the receipt. (from -9007199254740991 to 9007199254740991) |
| `payroll.imss_days.sickness_and_maternity` | integer | yes | Days contributed for sickness and maternity (surplus, cash benefits, pensioners' medical expenses): the period without the sick leave; absences count (LSS art. 31 fr. I). (from -9007199254740991 to 9007199254740991) |
| `payroll.imss_days.disability_and_old_age` | integer | yes | Days contributed for disability and life and for old-age and severance retirement: also without the absences, up to 7 per month. (from -9007199254740991 to 9007199254740991) |
| `payroll.totals` | object | yes | Totals: earnings, deductions, other payments and net pay. |
| `payroll.totals.salaries` | number | yes | Total wages, salaries and assimilated income (TotalSueldos). |
| `payroll.totals.taxed` | number | yes | Total taxable (TotalGravado). |
| `payroll.totals.exempt` | number | yes | Total exempt (TotalExento). |
| `payroll.totals.separation` | number | yes | Total separation and severance (TotalSeparacionIndemnizacion). |
| `payroll.totals.retirement` | number | yes | Total retirement, pension or withdrawal (TotalJubilacionPensionRetiro). |
| `payroll.totals.perceptions` | number | yes | Total earnings (TotalPercepciones). |
| `payroll.totals.other_deductions` | number | yes | Other deductions (TotalOtrasDeducciones). |
| `payroll.totals.taxes_withheld` | number | yes | Taxes withheld (TotalImpuestosRetenidos). |
| `payroll.totals.deductions` | number | yes | Total deductions (TotalDeducciones). |
| `payroll.totals.other_payments` | number | yes | Total other payments (TotalOtrosPagos). |
| `payroll.totals.subtotal` | number | yes | Receipt subtotal: earnings plus other payments. |
| `payroll.totals.net` | number | yes | Net pay for the employee. |
| `global` | object |  | Only on a global invoice. |
| `cancellation` | object or null | yes | The cancellation, if requested: status, reason, replacement and when. |
| `cancellation.status` | string or null | yes | `pending`: the SAT has the request (it finishes it in minutes, or waits for the recipient's answer). `accepted`: canceled. `rejected`: the recipient rejected it. `lapsed`: the SAT never recorded it; it can be requested again. `scheduled`: the SAT doesn't accept it yet (it doesn't have the replacing CFDI on record, or briefly rejected the signature) and Fiscalisto requests it again on its own. `failed`: Fiscalisto stopped trying; request it again with POST /v1/invoices/{id}/cancel. |
| `cancellation.motive` | string or null | yes | Cancellation reason (c_MotivoCancelacion): 01 with errors, related (carries substitution), 02 with errors, not related (the default), 03 didn't take place, 04 only on a global invoice, when an included sale was invoiced in the customer's name. |
| `cancellation.substitution` | string or null | yes | The CFDI that replaces this one (its id or its UUID), with reason 01. |
| `cancellation.canceled_at` | string (date-time) or null | yes | When it was canceled. |
| `cancellation.next_attempt_at` | string (date-time) or null | yes | With `scheduled`: when Fiscalisto requests it again (null: within the next 15 minutes). |
| `cancellation.error` | string or null | yes | With `scheduled` or `failed`: why it hasn't gone through. |
| `email` | object or null | yes | The email send: to whom, cc to whom and when (null if it hasn't been sent). |
| `email.to` | string or null | yes | To whom (emails separated by commas). |
| `email.cc` | string or null | yes | CC (emails separated by commas). |
| `email.sent_at` | string (date-time) or null | yes | When it was sent. |
| `email.status` | `sent`, `delayed`, `delivered`, `opened`, `bounced`, `complained` | yes | What happened with the last send: the worst of its recipients (bounced or complained weigh more than opened or delivered). sent until the customer's server answers. |
| `email.recipients` | array of object | yes | Each address of the send (to and cc), with its delivery. |
| `email.recipients[].address` | string | yes | The recipient's email address. |
| `email.recipients[].status` | `sent`, `delayed`, `delivered`, `opened`, `bounced`, `complained` | yes | Object status. |
| `email.recipients[].delivered_at` | string (date-time) or null | yes | When the recipient's server accepted it. |
| `email.recipients[].opened_at` | string (date-time) or null | yes | The first time it was opened (approximate: some email clients load images on their own or don't load them). |
| `email.recipients[].bounced_at` | string (date-time) or null | yes | When it bounced. |
| `email.recipients[].bounce_reason` | string or null | yes | Why it bounced, in Spanish: «buzón no existe», «buzón lleno»… |
| `email.recipients[].complained_at` | string (date-time) or null | yes | When the recipient marked it as spam. |
| `error` | object or null | yes | Why the SAT or the PAC didn't accept it: message, SAT code and original text. |
| `error.message` | string | yes | What happened and how to fix it, for a person. |
| `error.sat_code` | string or null | yes | SAT or PAC code (CFDI40xxx). |
| `error.raw` | string | yes | The PAC's original text. |
| `recurring_invoice` | string or null | yes | The recurring invoice (rin_…) that stamped it on its own, or null if it was stamped with a call. |
| `tickets` | array of string | yes | The tickets (`tkt_…`) it invoices: the one your customer invoiced through autofactura, the one your team invoiced from the ticket's page, or the ones associated with it. Empty otherwise; a global invoice's tickets are in GET /v1/tickets with `status=global`. |
| `origin` | object or null | yes | What stamped the invoice; `null` if it was stamped outside Fiscalisto. |
| `origin.type` | `app`, `api`, `assistant`, `point_of_sale`, `autofactura`, `invoice_link`, `quote`, `recurring_invoice`, `global_invoice` | yes | What stamped it: `app` (a person in Fiscalisto), `api`, `assistant` (an AI assistant through MCP), `point_of_sale` (a point-of-sale key), `autofactura` (your customer with a ticket, or the buyer's data from Stripe or Mercado Libre), `invoice_link` (your customer filling in the invoice link), `quote` (your customer accepting the quote), `recurring_invoice` (a recurring invoice by itself) or `global_invoice` (the tickets' automatic global invoice). |
| `origin.name` | string or null | yes | The name of the API or point-of-sale key, the assistant («ChatGPT») or where an autofactura's buyer data came from («Stripe»). |
| `created_at` | string (date-time) or null | yes | When it was created, ISO 8601 with Mexico City time (-06:00). |
| `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. |
| `warnings` | array of string |  | Warnings about the invoice (only in the response that stamps it or, with 202, the one that leaves it processing): it is stamped as sent. |
| `email_error` | string |  | Why the email couldn't be sent; the receipt was stamped. |
| `substitutes` | object |  | The invoice this one replaced and whether it was canceled. |
| `substitutes.invoice` | string | yes | The replaced invoice (inv_…). |
| `substitutes.canceled` | boolean | yes | true if the replaced one is already canceled. false isn't final: see substitutes.cancellation. |
| `substitutes.cancel_error` | string |  | Why the replaced one couldn't be canceled (cancel it with POST /v1/invoices/{id}/cancel). |
| `substitutes.cancellation` | object or null | yes | The previous one's cancellation, same as its `cancellation` in GET /v1/invoices/{id}: `accepted` if it is already canceled, `pending` if the SAT is finishing it (or waiting for the recipient), `scheduled` if Fiscalisto requests it again on its own, `failed` if it must be requested again. The previous one's webhook says when it changes. |
| `substitutes.cancellation.status` | string or null | yes | `pending`: the SAT has the request (it finishes it in minutes, or waits for the recipient's answer). `accepted`: canceled. `rejected`: the recipient rejected it. `lapsed`: the SAT never recorded it; it can be requested again. `scheduled`: the SAT doesn't accept it yet (it doesn't have the replacing CFDI on record, or briefly rejected the signature) and Fiscalisto requests it again on its own. `failed`: Fiscalisto stopped trying; request it again with POST /v1/invoices/{id}/cancel. |
| `substitutes.cancellation.motive` | string or null | yes | Cancellation reason (c_MotivoCancelacion): 01 with errors, related (carries substitution), 02 with errors, not related (the default), 03 didn't take place, 04 only on a global invoice, when an included sale was invoiced in the customer's name. |
| `substitutes.cancellation.substitution` | string or null | yes | The CFDI that replaces this one (its id or its UUID), with reason 01. |
| `substitutes.cancellation.canceled_at` | string (date-time) or null | yes | When it was canceled. |
| `substitutes.cancellation.next_attempt_at` | string (date-time) or null | yes | With `scheduled`: when Fiscalisto requests it again (null: within the next 15 minutes). |
| `substitutes.cancellation.error` | string or null | yes | With `scheduled` or `failed`: why it hasn't gone through. |
| `advance_application` | object |  | The advance payment's application: method, application note and its status. |
| `advance_application.advance` | string or null | yes | The advance payment, as an invoice (inv_…). |
| `advance_application.advance_uuid` | string | yes | The advance payment's tax folio. |
| `advance_application.method` | `egreso`, `remanente` | yes | egreso (the full invoice and then a credit note for the advance payment, option A) or remanente (the invoice only for what's left, option B). |
| `advance_application.status` | `done`, `credit_note_pending` | yes | done (ready) or credit_note_pending (the application note still has to be stamped: repeat the request with the same Idempotency-Key). |
| `advance_application.credit_note` | string or null | yes | The advance payment's application note (inv_…), with method egreso. |
| `advance_application.credit_note_error` | string |  | Why the application note wasn't stamped (repeat with the same Idempotency-Key). |

```json
{
  "id": "inv_OufpKqnrvx9p6Xp2nL8rTq5vMz3wKc9bHd",
  "object": "invoice",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "branch": null,
  "cost_center": null,
  "type": "N",
  "status": "processing",
  "uuid": null,
  "series": null,
  "folio": "9",
  "date": "2026-10-15T09:30:12",
  "customer": {
    "tax_id": "MASO451221PM4",
    "legal_name": "MARIA OLIVIA MARTINEZ SAGAZ",
    "tax_system": "605",
    "zip": "80290"
  },
  "use": "CN01",
  "payment_form": null,
  "payment_method": "PUE",
  "payment_terms": null,
  "notes": null,
  "currency": "MXN",
  "exchange_rate": null,
  "items": [
    {
      "description": "Pago de nómina",
      "product_key": "84111505",
      "unit_key": "ACT",
      "quantity": 1,
      "unit_price": 9600,
      "discount": 2913.87,
      "taxability": "01",
      "iva": "0"
    }
  ],
  "subtotal": 9600,
  "discount": 2913.87,
  "taxes": {
    "iva": 0,
    "ieps": 0,
    "iva_withheld": 0,
    "isr_withheld": 0,
    "local_transferred": 0,
    "local_withheld": 0
  },
  "total": 6686.13,
  "payment_status": null,
  "amount_due": null,
  "amount_paid": null,
  "paid_on": null,
  "due_date": null,
  "related": null,
  "cancellation": null,
  "email": null,
  "error": null,
  "recurring_invoice": null,
  "tickets": [],
  "origin": {
    "type": "api",
    "name": "Tienda en línea"
  },
  "created_at": "2026-10-15T09:30:12-06:00",
  "metadata": {
    "corrida": "2026-Q19"
  },
  "payroll": {
    "type": "O",
    "calculation": "external",
    "periodicity": "04",
    "period": {
      "start": "2026-10-01",
      "end": "2026-10-15",
      "payment_date": "2026-10-15"
    },
    "days": 15,
    "references": {
      "employee_id": "nom-000123",
      "payroll_run_id": "2026-Q19"
    },
    "employer": {
      "employer_registration": "Y5412345109",
      "curp": null
    },
    "employee": {
      "id": null,
      "number": "123",
      "curp": "MASO451221MSLRGL08",
      "social_security_number": "12345678903",
      "start_date": "2024-03-04",
      "seniority": "P136W",
      "contract_type": "01",
      "unionized": false,
      "workday_type": "01",
      "regime_type": "02",
      "department": "Ventas",
      "position": "Ejecutiva de cuenta",
      "risk_class": "1",
      "contribution_base_salary": 525.4,
      "integrated_daily_salary": 525.4,
      "state": "SIN",
      "bank_account": "002180700601234561"
    },
    "perceptions": [
      {
        "type": "001",
        "key": "SUELDO",
        "concept": "Sueldo",
        "taxed": 7500,
        "exempt": 0
      },
      {
        "type": "019",
        "key": "HEXTRA",
        "concept": "Horas extra dobles",
        "taxed": 450,
        "exempt": 450,
        "overtime": [
          {
            "days": 2,
            "hours_type": "01",
            "hours": 6,
            "amount_paid": 900
          }
        ]
      },
      {
        "type": "028",
        "key": "COMISION",
        "concept": "Comisiones de octubre",
        "taxed": 1200,
        "exempt": 0
      }
    ],
    "deductions": [
      {
        "type": "001",
        "key": "IMSS",
        "concept": "Cuotas obreras IMSS",
        "amount": 260.15
      },
      {
        "type": "002",
        "key": "ISR",
        "concept": "ISR",
        "amount": 1203.72
      },
      {
        "type": "010",
        "key": "INFONAVIT",
        "concept": "Crédito Infonavit",
        "amount": 950
      },
      {
        "type": "004",
        "key": "PRESTAMO",
        "concept": "Préstamo personal",
        "amount": 500
      }
    ],
    "other_payments": [
      {
        "type": "002",
        "key": "SUBSIDIO",
        "concept": "Subsidio para el empleo",
        "amount": 0,
        "subsidy_caused": 0
      }
    ],
    "totals": {
      "salaries": 9600,
      "separation": 0,
      "retirement": 0,
      "taxed": 9150,
      "exempt": 450,
      "perceptions": 9600,
      "other_deductions": 1710.15,
      "taxes_withheld": 1203.72,
      "deductions": 2913.87,
      "other_payments": 0,
      "subtotal": 9600,
      "net": 6686.13
    }
  }
}
```

## Errors

- `calculation_mode_ambiguous` (400): This mixes the two ways of issuing a payroll receipt: POST /v1/payroll_receipts calculates it from an employee (emp_…); POST /v1/payroll_receipts/external stamps the amounts your payroll system calculated. Use the matching endpoint.
- `daily_limit` (429): You reached today's limit of something not paid with stamps. Retry-After says how many seconds until midnight in Mexico City.
- `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.
- `idempotency_key_missing` (400): Stamping requires the Idempotency-Key header (8 to 255 characters, a new one per document), so a retry never stamps twice.
- `insufficient_balance` (402): The account has no live stamps left: to stamp, check RFCs against SAT's lists, look up constancias, request SAT downloads or fetch declarations, the compliance opinion or the mailbox from SAT. Buy a pack in Desarrolladores › Timbres y pagos, or turn on auto-recharge. Never happens in test mode.
- `invoice_invalid` (422): The invoice breaks a SAT rule Fiscalisto checks before sending it to the PAC. No stamp was used. `message_es` says which rule and how to fix it.
- `invoice_rejected` (422): The PAC or the SAT didn't accept it. `sat_code` has their code (CFDI40xxx) and `message_es` what to fix. No stamp was used.
- `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_not_ready` (400): The issuer can't do that yet: the message says what it's missing (its CSD, or one in force when stamping; its RFC and tax details for viáticos). Upload it and repeat the request with the same Idempotency-Key.
- `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.
- `payroll_invalid` (422): The payroll receipt can't be calculated or stamped with that data (period, days, the issuer's employer registration…). `message_es` says which; for an externally calculated receipt, `errors` lists every problem with its `param`.
- `payroll_period_overlap` (409): The employee already has an ordinary receipt whose period overlaps this one (`invoice`). An additional payment goes as an extraordinary receipt (type E); to correct that one, use `replaces`.
- `payroll_receipt_exists` (409): The employee already has a valid receipt for that period (ordinary) or payroll run (extraordinary) with other amounts; `invoice` is that receipt. Replace it with `replaces` or cancel it first. The same amounts return the same receipt.
- `payroll_replacement_invalid` (409): `replaces` isn't a valid payroll receipt of the same issuer and employee.
- `request_in_progress` (409): Another request with the same Idempotency-Key is still running. Repeat it in a moment with the same key: it will answer the same.
- `resource_missing` (404): There's no object with that id (or it belongs to another issuer or the other mode).
- `stamp_rate_limit` (429): Too many stamps in a row for the same issuer. Wait what Retry-After says; for many invoices use POST /v1/invoice_batches, for a payroll run POST /v1/payroll_batches.

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