# Invoices

Income, global and transfer invoices: stamp, look up, send, cancel and replace.

The guide, step by step: https://fiscalisto.com/en/docs/api/facturas.md

## Endpoints

- [Stamp an invoice](https://fiscalisto.com/en/docs/api/referencia/facturas/create-invoice.md): `POST /v1/invoices`
- [List invoices](https://fiscalisto.com/en/docs/api/referencia/facturas/list-invoices.md): `GET /v1/invoices`
- [Check an invoice without stamping](https://fiscalisto.com/en/docs/api/referencia/facturas/preview-invoice.md): `POST /v1/invoices/preview`
- [Get an invoice](https://fiscalisto.com/en/docs/api/referencia/facturas/get-invoice.md): `GET /v1/invoices/{id}`
- [Update an invoice](https://fiscalisto.com/en/docs/api/referencia/facturas/update-invoice.md): `POST /v1/invoices/{id}`
- [Download the PDF](https://fiscalisto.com/en/docs/api/referencia/facturas/get-invoice-pdf.md): `GET /v1/invoices/{id}/pdf`
- [Download the XML](https://fiscalisto.com/en/docs/api/referencia/facturas/get-invoice-xml.md): `GET /v1/invoices/{id}/xml`
- [Download the cancellation receipt](https://fiscalisto.com/en/docs/api/referencia/facturas/get-invoice-cancellation-receipt.md): `GET /v1/invoices/{id}/cancellation_receipt`
- [Send by email](https://fiscalisto.com/en/docs/api/referencia/facturas/send-invoice.md): `POST /v1/invoices/{id}/send`
- [Cancel an invoice](https://fiscalisto.com/en/docs/api/referencia/facturas/cancel-invoice.md): `POST /v1/invoices/{id}/cancel`
- [Replace an invoice](https://fiscalisto.com/en/docs/api/referencia/facturas/substitute-invoice.md): `POST /v1/invoices/{id}/substitute`

## The Invoice object

An issued CFDI 4.0: income or global invoice, delivery note, credit note (E), payment complement (P) or payroll receipt (N).

`status` lifecycle:

- `processing`, `pending` → `valid`: The PAC answers (Fiscalisto asks it again on its own) (invoice.stamped).
- `processing` → `rejected`: SAT or the PAC don't accept it (invoice.failed).
- `valid` → `canceled`: POST /v1/invoices/{id}/cancel or /substitute: right away, or when the customer accepts (invoice.canceled).

While the customer decides on a cancellation it stays valid, with cancellation.status pending (invoice.cancellation_pending); if they reject it, it stays valid (invoice.cancellation_rejected).

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

Example:

```json
{
  "id": "inv_OufpKqnrvx9p0Nfbydl9jG4UNGeTYcvdrg",
  "object": "invoice",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "branch": null,
  "cost_center": null,
  "type": "I",
  "status": "valid",
  "uuid": "5F1E8C2A-3B7D-4C9E-A1B2-C3D4E5F60718",
  "series": null,
  "folio": "1",
  "date": "2026-10-24T10:15:42",
  "customer": {
    "tax_id": "ICV060329BY0",
    "legal_name": "INMOBILIARIA CVA",
    "tax_system": "601",
    "zip": "33826"
  },
  "use": "G03",
  "payment_form": "03",
  "payment_method": "PUE",
  "payment_terms": null,
  "notes": null,
  "currency": "MXN",
  "exchange_rate": null,
  "items": [
    {
      "description": "Mensualidad",
      "product_key": "86121700",
      "unit_key": "E48",
      "unit_name": "Unidad de servicio",
      "sku": "MEN-1",
      "quantity": 2,
      "unit_price": 2500,
      "taxability": "02",
      "iva": "0.16"
    }
  ],
  "subtotal": 5000,
  "discount": 0,
  "taxes": {
    "iva": 800,
    "ieps": 0,
    "iva_withheld": 0,
    "isr_withheld": 0,
    "local_transferred": 0,
    "local_withheld": 0
  },
  "total": 5800,
  "payment_status": "paid",
  "amount_due": 0,
  "amount_paid": 5800,
  "paid_on": null,
  "due_date": null,
  "related": null,
  "cancellation": null,
  "email": {
    "to": "pagos@cva.example",
    "cc": null,
    "sent_at": "2026-10-24T10:15:44-06:00"
  },
  "error": null,
  "recurring_invoice": null,
  "tickets": [],
  "origin": {
    "type": "api",
    "name": "Tienda en línea"
  },
  "created_at": "2026-10-24T10:15:42-06:00",
  "metadata": {
    "pedido": "A-1042"
  }
}
```

## The InvoicePreview object

A checked, unstamped invoice: what would be stamped now with POST /v1/invoices and the same body.

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"invoice_preview"` | yes | What kind of object it is («invoice», «customer»…). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer` | string | yes | The issuer (iss_…). |
| `branch` | string or null | yes | Branch (brn_…) the invoice is issued from: its postal code goes in LugarExpedicion, its address on the PDF and, if it has them, its series. Without it, the issuer's tax address (the Matriz). |
| `type` | `I`, `E`, `T` | yes | Receipt type (TipoDeComprobante): I income, E expense, P payment, T transfer, N payroll. |
| `series` | string or null | yes | Series (Serie), up to 25 characters. Each series has its own folios. |
| `folio` | string or null | yes | The folio it would have if stamped now; another invoice stamped earlier may take it. |
| `date` | string or null | yes | Issue date (Fecha), Mexico City time. |
| `customer` | object | yes | Customer (Receptor): the id of one in your catalog (cus_…) or their details in an object. |
| `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). |
| `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 invoice's taxes, by type: IVA and IEPS transferred, IVA and ISR withheld and local taxes. |
| `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 | yes | Total in the receipt's currency (Total). |
| `warnings` | array of object | yes | What is worth checking before stamping (a customer on the SAT's 69 or 69-B lists, an invoice that looks duplicated); it doesn't prevent stamping. |
| `warnings[].code` | string | yes | Withholding key (CveRetenc), c_CveRetenc: 01 professional services, 05 leasing, 14 dividends, 16 interest, 18 payments abroad… Keys 06 and 14 to 24 carry their complement, as SAT's catalog asks (share_sale with 06 and 19, dividends with 14, distributable_remainder with 15, interest, trust_lease, foreign_payment, prize, trust, retirement_plan, mortgage_interest, financial_derivatives); 01, 02, 04 and 05 carry foreign_payment when the recipient is foreign; 26 (technology platforms) carries platform, and its totals and taxes are calculated from the operations. 27 and 28 can't be issued here. |
| `warnings[].message` | string | yes | What happened and how to fix it, for a person. |
| `unsigned_xml` | string | yes | The XML that would be sent to the PAC, without seal or stamp. |

Example:

```json
{
  "object": "invoice_preview",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "branch": null,
  "type": "I",
  "series": null,
  "folio": "2",
  "date": "2026-10-24T10:15:42",
  "customer": {
    "tax_id": "ICV060329BY0",
    "legal_name": "INMOBILIARIA CVA",
    "tax_system": "601",
    "zip": "33826"
  },
  "use": "G03",
  "payment_form": "03",
  "payment_method": "PUE",
  "currency": "MXN",
  "exchange_rate": null,
  "items": [
    {
      "description": "Mensualidad",
      "product_key": "86121700",
      "unit_key": "E48",
      "unit_name": "Unidad de servicio",
      "sku": "MEN-1",
      "quantity": 2,
      "unit_price": 2500,
      "taxability": "02",
      "iva": "0.16"
    }
  ],
  "subtotal": 5000,
  "discount": 0,
  "taxes": {
    "iva": 800,
    "ieps": 0,
    "iva_withheld": 0,
    "isr_withheld": 0,
    "local_transferred": 0,
    "local_withheld": 0
  },
  "total": 5800,
  "warnings": [],
  "unsigned_xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><cfdi:Comprobante Version=\"4.0\" Folio=\"2\" SubTotal=\"5000.00\" Moneda=\"MXN\" Total=\"5800.00\" TipoDeComprobante=\"I\" …>…</cfdi:Comprobante>"
}
```
