# Calculate an aguinaldo, PTU or settlement without stamping

`POST https://api.fiscalisto.com/v1/payroll_receipts/extraordinary/preview`

The extraordinary receipt as it would be stamped (what it pays, its exempt part, the ISR with both calculations and the net), without stamping or using stamps, with the confirmation_token that stamps it as is.

## Parameters

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

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `employee` | string | yes | The employee (emp_…). |
| `kind` | `aguinaldo`, `ptu`, `finiquito` | yes | aguinaldo (their days per year, at least 15, in proportion to those worked), ptu (their share of the profits) or finiquito (at the last day worked, the employee's end_date: proportional aguinaldo, vacation and vacation premium and, with exit_reason dismissal, the severance and the seniority premium). |
| `payment_date` | string | yes | The receipt's FechaPago. |
| `year` | integer |  | aguinaldo: the year it pays (by default, that of payment_date). ptu: the year of the profit (by default, the one before payment_date). (from 2020 to 2100) |
| `days_worked` | number |  | aguinaldo: the days worked in the year, if they aren't all those they were employed (absences or disabilities that don't count). (from 0 to 365) |
| `ptu_amount` | number |  | ptu: what this employee gets (half of the PTU by days worked and half by salary, capped at three months of salary). Fiscalisto calculates its exempt part (15 UMA) and its ISR. (greater than 0 and up to 100000000) |
| `isr_method` | `lower`, `art96`, `art174` |  | aguinaldo and ptu: how to withhold the ISR on the taxed part. lower (the default) the one that withholds less; art96 added to the month's wage; art174 the optional procedure of the LISR Regulations. |
| `exit_reason` | `resignation`, `dismissal`, `justified_dismissal`, `worker_rescission`, `death` |  | finiquito: resignation (resignation, mutual agreement or end of contract, the default; seniority premium only after 15 years or more), dismissal (without cause: adds 3 months of integrated salary and the seniority premium), justified_dismissal (for a cause of LFT art. 47: no indemnity, with the seniority premium), worker_rescission (the worker rescinds for a cause of art. 51: 3 months, 20 days per year and the seniority premium) or death (the seniority premium to their beneficiaries, whatever the years). |
| `twenty_days_per_year` | boolean |  | finiquito with dismissal: includes 20 days per year of service (LFT art. 50), when the employer doesn't reinstate them. |
| `vacation_days_taken` | number |  | finiquito: the vacation days of the current year of service already taken. By default, those of their stamped receipts (GET /v1/employees/{id}/vacations). (from 0 to 365) |
| `vacation_days_owed` | number |  | finiquito: the vacation days of completed years of service not taken nor expired; they're paid with their vacation premium. By default, pending_days of their vacation. (from 0 to 400) |
| `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
{
  "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
  "kind": "finiquito",
  "payment_date": "2026-11-30",
  "exit_reason": "resignation"
}
```

## With the TypeScript SDK

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

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

const extraordinaryPayrollReceiptPreview = await fiscalisto.payrollReceipts.previewExtraordinary({
  employee: "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
  kind: "finiquito",
  payment_date: "2026-11-30",
  exit_reason: "resignation",
}, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

extraordinary_payroll_receipt_preview = fiscalisto.payroll_receipts.preview_extraordinary({
    "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
    "kind": "finiquito",
    "payment_date": "2026-11-30",
    "exit_reason": "resignation",
}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

$extraordinaryPayrollReceiptPreview = $fiscalisto->payrollReceipts->previewExtraordinary([
    'employee' => 'emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV',
    'kind' => 'finiquito',
    'payment_date' => '2026-11-30',
    'exit_reason' => 'resignation',
], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

var extraordinaryPayrollReceiptPreview = await fiscalisto.PayrollReceipts.PreviewExtraordinaryAsync(new PreviewExtraordinaryPayrollReceiptParams
{
    Employee = "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
    Kind = "finiquito",
    PaymentDate = "2026-11-30",
    ExitReason = "resignation",
}, 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()

	extraordinaryPayrollReceiptPreview, err := client.PayrollReceipts.PreviewExtraordinary(ctx, &fiscalisto.PreviewExtraordinaryPayrollReceiptParams{
		Employee:    "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
		Kind:        "finiquito",
		PaymentDate: "2026-11-30",
		ExitReason:  fiscalisto.String("resignation"),
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", *extraordinaryPayrollReceiptPreview)
}
```

## With the Java SDK

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

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

var extraordinaryPayrollReceiptPreview = fiscalisto.payrollReceipts().previewExtraordinary(new PreviewExtraordinaryPayrollReceiptParams()
        .setEmployee("emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV")
        .setKind("finiquito")
        .setPaymentDate("2026-11-30")
        .setExitReason("resignation"), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(extraordinaryPayrollReceiptPreview);
```

## Response 200

OK.

A `ExtraordinaryPayrollReceiptPreview` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"payroll_receipt_preview"` | yes | What kind of object it is («invoice», «customer»…). |
| `calculation` | `"extraordinary"` | yes | Fiscalisto calculated it, as an extraordinary payroll. |
| `confirmation_token` | string | yes | Send it in POST /v1/payroll_receipts/extraordinary to stamp exactly this receipt: if a different one is calculated when stamping, it answers 409 payroll_calculation_changed without stamping. |
| `employee` | string | yes | The employee (emp_…). |
| `kind` | `aguinaldo`, `ptu`, `finiquito` | yes | What it pays: aguinaldo, ptu or finiquito. |
| `period` | object | yes | The period (FechaInicialPago, FechaFinalPago) of an extraordinary receipt is a single day: payment_date (aguinaldo, PTU) or the last day worked (finiquito); payment_date is 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. |
| `contribution_base_salary` | number | yes | Contribution base salary (SalarioBaseCotApor). |
| `lines` | array of object | yes | What it pays, as the app shows it. |
| `lines[].concept` | string | yes | Payment concept (ConceptoPago), c_TipoContribuyenteSujetoRetencion. |
| `lines[].detail` | string | yes | How it was calculated (days, years, salary). |
| `lines[].gross` | number | yes | Amount. |
| `lines[].exempt` | number | yes | Of it, the part exempt from ISR. |
| `perceptions` | array of object | yes | Earnings (Percepcion): wages and the rest, taxable and exempt. |
| `perceptions[].type` | string | yes | Earning type (TipoPercepcion), c_TipoPercepcion: 001 wages… |
| `perceptions[].key` | string | yes | Employer's code (Clave). |
| `perceptions[].concept` | string | yes | Concept (Concepto). |
| `perceptions[].taxed` | number | yes | Taxable amount (ImporteGravado). |
| `perceptions[].exempt` | number | yes | Exempt amount (ImporteExento). |
| `perceptions[].overtime` | array of object |  | Overtime (HorasExtra), with earning 019. |
| `perceptions[].overtime[].days` | integer | yes | Days with overtime (Dias). (from -9007199254740991 to 9007199254740991) |
| `perceptions[].overtime[].hours_type` | string | yes | c_TipoHoras: 01 double, 02 triple, 03 single. |
| `perceptions[].overtime[].hours` | integer | yes | Overtime hours (HorasExtra). (from -9007199254740991 to 9007199254740991) |
| `perceptions[].overtime[].amount_paid` | number | yes | Amount paid (ImportePagado). |
| `perceptions[].stock_options` | object |  | Shares or securities (AccionesOTitulos), with earning 045. |
| `perceptions[].stock_options.market_value` | number | yes | Market value (ValorMercado). |
| `perceptions[].stock_options.grant_price` | number | yes | Price when granted (PrecioAlOtorgarse). |
| `deductions` | array of object | yes | Deductions (Deduccion): ISR, IMSS contributions and the rest. |
| `deductions[].type` | string | yes | Deduction type (TipoDeduccion), c_TipoDeduccion: 001 IMSS, 002 ISR… |
| `deductions[].key` | string | yes | Employer's code (Clave). |
| `deductions[].concept` | string | yes | Concept (Concepto). |
| `deductions[].amount` | number | yes | Amount (Importe). |
| `other_payments` | array of object | yes | Other payments (OtroPago): employment subsidy. |
| `other_payments[].type` | string | yes | Other payment type (TipoOtroPago), c_TipoOtroPago: 002 employment subsidy. |
| `other_payments[].key` | string | yes | Employer's code (Clave). |
| `other_payments[].concept` | string | yes | Concept (Concepto). |
| `other_payments[].amount` | number | yes | Amount paid (Importe). |
| `other_payments[].subsidy_caused` | number |  | Subsidy accrued (SubsidioCausado). |
| `other_payments[].subsidy_applied` | number |  | Of the subsidy accrued, the ISR it avoided (not in the XML). |
| `other_payments[].balance_compensation` | object |  | Offset of the balance in favor (CompensacionSaldosAFavor), with 004. |
| `other_payments[].balance_compensation.balance` | number | yes | Balance in favor (SaldoAFavor). |
| `other_payments[].balance_compensation.year` | integer | yes | Year of the balance in favor (Año). (from -9007199254740991 to 9007199254740991) |
| `other_payments[].balance_compensation.remaining` | number | yes | Remainder of the balance in favor (RemanenteSalFav). |
| `separation` | object or null | yes | SeparacionIndemnizacion: only in a severance (indemnity and seniority premium). |
| `separation.total_paid` | number | yes | Total paid (TotalPagado). |
| `separation.years_of_service` | integer | yes | Years of service (NumAñosServicio). (from -9007199254740991 to 9007199254740991) |
| `separation.last_monthly_salary` | number | yes | Last ordinary monthly salary (UltimoSueldoMensOrd). |
| `separation.accumulable_income` | number | yes | Cumulative income (IngresoAcumulable). |
| `separation.non_accumulable_income` | number | yes | Non-cumulative income (IngresoNoAcumulable). |
| `isr` | object | yes | The period's ISR calculation: base, table, subsidy and result. |
| `isr.amount` | number | yes | ISR withheld. |
| `isr.art96` | number |  | aguinaldo and ptu: ISR with the taxable part added to the month's wage. |
| `isr.art174` | number |  | aguinaldo and ptu: ISR with the procedure in art. 174 of the Regulations. |
| `isr.method` | `art96`, `art174` |  | aguinaldo and ptu: the calculation that was applied. |
| `totals` | object | yes | Totals: earnings, deductions, other payments and net pay. |
| `totals.salaries` | number | yes | Total wages, salaries and assimilated income (TotalSueldos). |
| `totals.taxed` | number | yes | Total taxable (TotalGravado). |
| `totals.exempt` | number | yes | Total exempt (TotalExento). |
| `totals.separation` | number | yes | Total separation and severance (TotalSeparacionIndemnizacion). |
| `totals.retirement` | number | yes | Total retirement, pension or withdrawal (TotalJubilacionPensionRetiro). |
| `totals.perceptions` | number | yes | Total earnings (TotalPercepciones). |
| `totals.other_deductions` | number | yes | Other deductions (TotalOtrasDeducciones). |
| `totals.taxes_withheld` | number | yes | Taxes withheld (TotalImpuestosRetenidos). |
| `totals.deductions` | number | yes | Total deductions (TotalDeducciones). |
| `totals.other_payments` | number | yes | Total other payments (TotalOtrosPagos). |
| `totals.subtotal` | number | yes | Receipt subtotal: earnings plus other payments. |
| `totals.net` | number | yes | Net pay for the employee. |

```json
{
  "object": "payroll_receipt_preview",
  "calculation": "extraordinary",
  "confirmation_token": "4b7e1d9c2a6f8e0b3d5c7a9e1f3b5d7c9e2a4c6e8b0d2f4a6c8e0b2d4f6a8c0e",
  "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",
  "kind": "aguinaldo",
  "period": {
    "start": "2026-12-18",
    "end": "2026-12-18",
    "payment_date": "2026-12-18"
  },
  "contribution_base_salary": 418.36,
  "lines": [
    {
      "concept": "Aguinaldo",
      "detail": "15 días de 15 días al año, por 365 días trabajados en 2026",
      "gross": 6000,
      "exempt": 3519.3
    }
  ],
  "perceptions": [
    {
      "type": "002",
      "key": "002",
      "concept": "Aguinaldo",
      "taxed": 2480.7,
      "exempt": 3519.3
    }
  ],
  "deductions": [
    {
      "type": "002",
      "key": "002",
      "concept": "ISR",
      "amount": 269.91
    }
  ],
  "other_payments": [
    {
      "type": "002",
      "key": "002",
      "concept": "Subsidio para el empleo del Decreto que otorga el subsidio para el empleo (DOF 1 de mayo de 2024)",
      "amount": 0,
      "subsidy_caused": 0,
      "subsidy_applied": 0
    }
  ],
  "separation": null,
  "isr": {
    "amount": 269.91,
    "art96": 374.49,
    "art174": 269.91,
    "method": "art174"
  },
  "totals": {
    "salaries": 6000,
    "taxed": 2480.7,
    "exempt": 3519.3,
    "perceptions": 6000,
    "separation": 0,
    "retirement": 0,
    "other_deductions": 0,
    "taxes_withheld": 269.91,
    "deductions": 269.91,
    "other_payments": 0,
    "subtotal": 6000,
    "net": 5730.09
  }
}
```

## Errors

- `feature_not_in_plan` (403): Live, this part of the API (inventario, portal de proveedores, pedidos, comprobación de gastos) follows the empresa's plan, as in the app: it comes with Operaciones (added to any paid plan; included in Corporativo). The books (the /v1/accounting routes except DIOT, cross checks, IVA refunds and fixed assets) come with Contabilidad (added to Independiente, Emprendedor or Negocio; included in Despacho and Corporativo): without it, changing the books answers this error, and reading them works only up to the last month it had it. Add either in Ajustes › Plan y pagos; test mode has everything.
- `issuer_archived` (400): The issuer is archived and no longer stamps. Its documents can still be read and canceled.
- `issuer_linked_empresa` (403): That issuer is an empresa of the app connected to your account: through the API it only offers its Portal de proveedores (/v1/portal_suppliers and /v1/supplier_invoices) and, once someone who may pay suppliers and change Configurar pagos turned them on, its supplier payouts (/v1/payouts and /v1/payroll_payouts). It also stops when whoever connected it (or turned its payouts on) no longer has that permission in the empresa: message_es says which. Do everything else in the app.
- `issuer_missing` (404): There is no such issuer in the account (or it belongs to the other mode).
- `issuer_not_allowed` (403): This key can't use that issuer.
- `issuer_required` (400): The account has several issuers and the request doesn't say which: send `issuer` (iss_…).
- `livemode_mismatch` (400): The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.
- `payroll_approval_required` (409): The issuer requires the payroll run (prenómina) to be approved before stamping, and this receipt isn't in the period's approved run with these amounts and payment date (not requested, awaiting approval, rejected, or the receipt changed). Nothing was stamped: request it with POST /v1/payroll_approvals and wait for a person to approve it in the app.
- `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`.

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