Skip to content

FISCALISTO / API / REFERENCE

Calculate a receipt without stamping · Payroll

Open in ChatGPTOpen in ClaudeOpen in Cursor
POST
/v1/payroll_receipts/preview

The receipt as it would be stamped (perceptions with their incidents, ISR with the employment subsidy, IMSS contributions and the net), without stamping or using stamps, with the confirmation_token that stamps it as is and the warnings about what it doesn't include (a settlement, the year's values not loaded yet).

Authorization

bearerAuth
headerAuthorizationBearer <key>

Your secret key: fk_test_… in test mode, fk_live_… in production. Desarrolladores › Llaves.

Headers

Idempotency-Key?string

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).

Length1 <= length <= 255

Request body

application/json
  1. body
employee*string

The employee (emp_…).

Length1 <= length
period*

The pay period: first and last day (FechaInicialPago, FechaFinalPago) and, if it isn't the last one, the payment day (FechaPago).

days?number

Days paid (NumDiasPagados). By default, all the period's days that apply to them.

Range0 < value <= 31
absences?integer

Absences in the period (unpaid days), from 0 to 31: they aren't paid (they come out of days) and contribute to IMSS only for illness and maternity, up to 7 per month (LSS art. 31 fr. I).

Range0 <= value <= 31
disability_days?integer

Days of disability IMSS issued in the period, from 0 to 31: they aren't paid (they come out of days) and don't generate the worker's IMSS contributions (LSS art. 31 fr. IV).

Range0 <= value <= 31
incidents?

The period's incidents, as in Nómina › Emitir recibos: overtime, Sundays, rest days and holidays worked, vacation, bonuses and commissions. Fiscalisto calculates their amounts, their exempt part and the ISR with the wage.

replaces?string

The current receipt (inv_… or UUID) this one corrects, calculated by Fiscalisto for the same employee: the new one is calculated with the employee's data as it is now, goes related with 04 and the previous one is canceled with reason 01. For a receipt your system calculated use POST /v1/payroll_receipts/external with replaces.

Length1 <= length
send_email?boolean

true to send the PDF and the XML by email when stamping, with Fiscalisto's design. Not sent by default.

metadata?

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.

Response body

OK.

application/json
  1. response

The receipt as it would be stamped: earnings, deductions (ISR, IMSS), other payments (subsidy) and the net.

object*string

What kind of object it is («invoice», «customer»…).

confirmation_token*string

Send it in POST /v1/payroll_receipts to stamp exactly this receipt: if a different one is calculated when stamping, it answers 409 payroll_calculation_changed without stamping.

warnings*array<>

What the receipt doesn't include or soon can't be calculated; it doesn't prevent stamping.

employee*string

The employee (emp_…).

periodicity*string

Pay frequency (PeriodicidadPago): 02 weekly, 03 every 14 days, 04 every two weeks (the default), 05 monthly.

period*

The pay period: first and last day and the pay day (FechaInicialPago, FechaFinalPago and FechaPago).

days*number

Days paid (NumDiasPagados). By default, all the period's days that apply to them.

imss_days*

The days the employee's IMSS contributions were calculated for.

contribution_base_salary*number

Contribution base salary (SalarioBaseCotApor).

perceptions*array<>

Earnings (Percepcion): wages and the rest, taxable and exempt.

deductions*array<>

Deductions (Deduccion): ISR, IMSS contributions and the rest.

other_payments*array<>

Other payments (OtroPago): employment subsidy.

isr*

The period's ISR calculation: base, table, subsidy and result.

totals*

Totals: earnings, deductions, other payments and net pay.

explanation*array<>

How each ISR, employment subsidy and IMSS line was calculated: base, rate or tariff row, the arithmetic and the article of the law. They are the receipt's own figures, not a recalculation.

Errors

  • 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.

  • The issuer is archived and no longer stamps. Its documents can still be read and canceled.

  • The account has several issuers and the request doesn't say which: send issuer (iss_…).

  • The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.

  • POST /v1/payroll_receipts only calculates ordinary payroll (salary, ISR with the employment subsidy and the employee's IMSS quotas). Fiscalisto calculates the aguinaldo, PTU and severance (finiquito or liquidación) with POST /v1/payroll_receipts/extraordinary; pensions, bonuses and the rest are calculated by your payroll system and stamped with POST /v1/payroll_receipts/external. param says which field asked for it.

  • 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.

  • 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.

  • This key can't use that issuer.

  • There is no such issuer in the account (or it belongs to the other mode).

  • There's no object with that id (or it belongs to another issuer or the other mode).

  • 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.

  • 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): Errors. They all carry code, message and, when it's about a field, param.

curl -X POST 'https://api.fiscalisto.com/v1/payroll_receipts/preview' \  -H 'Authorization: Bearer fk_test_…' \  -H 'Idempotency-Key: pedido-A-1042' \  -H 'Content-Type: application/json' \  -d '{  "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",  "period": {    "start": "2026-10-10",    "end": "2026-10-16"  }}'
{  "object": "payroll_receipt_preview",  "confirmation_token": "9f2c4e0a7b1d3c5e8f6a2b4d6c8e0f1a3b5d7c9e1f2a4b6c8d0e2f4a6b8c0d2e",  "warnings": [],  "employee": "emp_OufpKqnrvx9p3RxmD1RIDgEHzKYPYnYBlV",  "periodicity": "02",  "period": {    "start": "2026-10-10",    "end": "2026-10-16",    "payment_date": "2026-10-16"  },  "days": 7,  "imss_days": {    "calendar_days": 7,    "absences": 0,    "disability_days": 0,    "sickness_and_maternity": 7,    "disability_and_old_age": 7  },  "contribution_base_salary": 334.66,  "perceptions": [    {      "type": "001",      "key": "001",      "concept": "Sueldo",      "taxed": 2240,      "exempt": 0    }  ],  "deductions": [    {      "type": "001",      "key": "001",      "concept": "Cuotas IMSS",      "amount": 55.63    },    {      "type": "002",      "key": "002",      "concept": "ISR",      "amount": 37.73    }  ],  "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": 123.34,      "subsidy_applied": 123.34    }  ],  "isr": {    "tariff": 161.07,    "subsidy": 123.34,    "withheld": 37.73,    "exempt_minimum": false  },  "totals": {    "salaries": 2240,    "taxed": 2240,    "exempt": 0,    "separation": 0,    "retirement": 0,    "perceptions": 2240,    "other_deductions": 55.63,    "taxes_withheld": 37.73,    "deductions": 93.36,    "other_payments": 0,    "subtotal": 2240,    "net": 2146.64  },  "explanation": [    {      "id": "isr",      "kind": "isr",      "concept": "ISR",      "amount": 37.73,      "summary": "Tarifa de 7 días del art. 96 (Anexo 8 RMF 2026, rubro B, fracción II) sobre $2,240.00 gravados, menos el subsidio para el empleo.",      "steps": [        {          "label": "Ingresos gravados del periodo",          "value": 2240,          "unit": "mxn"        },        {          "label": "Límite inferior de su renglón de la tarifa",          "value": 1650.68,          "unit": "mxn"        },        {          "label": "Excedente del límite inferior",          "value": 589.32,          "unit": "mxn",          "formula": "$2,240.00 − $1,650.68"        },        {          "label": "Porcentaje sobre el excedente",          "value": 0.1088,          "unit": "pct"        },        {          "label": "Impuesto marginal",          "value": 64.12,          "unit": "mxn",          "formula": "$589.32 × 10.88%"        },        {          "label": "Cuota fija",          "value": 96.95,          "unit": "mxn"        },        {          "label": "ISR según la tarifa",          "value": 161.07,          "unit": "mxn",          "formula": "$64.12 + $96.95"        },        {          "label": "Menos subsidio para el empleo aplicado",          "value": 123.34,          "unit": "mxn"        },        {          "label": "ISR retenido",          "value": 37.73,          "unit": "mxn",          "formula": "$161.07 − $123.34"        }      ],      "law": [        {          "ref": "LISR art. 94",          "says": "El sueldo y las demás prestaciones de la relación laboral son ingresos por salarios."        },        {          "ref": "LISR art. 96",          "says": "Quien paga salarios retiene el ISR aplicando la tarifa a los ingresos gravados del periodo; no se retiene a quien en el mes solo percibe un salario mínimo."        },        {          "ref": "Decreto del subsidio para el empleo, art. Segundo (DOF 01-05-2024, reformado DOF 31-12-2025)",          "says": "Subsidio de 15.02% de la UMA mensual para quien gana hasta $11,492.66 al mes; en pagos menores a un mes, entre 30.4 por los días del periodo, sin pasar del monto mensual; se aplica solo contra el ISR del mes."        }      ]    }  ]}

Was this page helpful?