FISCALISTO / API
Withholding certificates
Stamp the withholding and payment information certificate (CFDI de Retenciones 2.0) for what you withheld from a supplier: professional fees, rent, dividends, interest or payments abroad.
When a company pays an individual for professional fees or rent, it withholds ISR and IVA and must give them a withholding certificate: a CFDI de Retenciones 2.0, different from an invoice, with what it paid and what it withheld in the period. With the API you stamp it with the same folios (RET1, RET2…), checks and timbres as Retenciones in the app. Each certificate uses one timbre; cancelling it is free.
Stamp one
What was withheld in September from a lawyer for $10,000 in fees: 10% ISR and two thirds of the IVA.
curl https://api.fiscalisto.com/v1/retentions \
-H "Authorization: Bearer $FISCALISTO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ret-2026-09-gora" \
-d '{
"code": "01",
"recipient": {
"tax_id": "MASO451221PM4",
"legal_name": "MARIA OLIVIA MARTINEZ SAGAZ",
"zip": "80290"
},
"period": { "year": 2026, "month": 9 },
"totals": { "operation": 10000 },
"taxes": [
{ "tax": "isr", "base": 10000, "amount": 1000 },
{ "tax": "iva", "base": 10000, "amount": 1066.67 }
],
"send_email": true,
"email": "ana@example.com"
}'The response is the certificate (ret_…) with status: "valid", its uuid, its folio in internal_folio and the total withheld in totals.withheld. The retention.stamped webhook also arrives. With send_email the receiver gets the PDF and the XML at email. If the stamping answer was lost and the certificate stamps later, the email goes out on its own once it's confirmed, only once.
| Field | What it is |
|---|---|
code | The withholding's key (c_CveRetenc): 01 professional services, 05 rent, 14 dividends, 16 interest, 18 payments to non-residents, 25 other (with description), and the rest of the catalog. The ones that carry a complement are below. |
recipient | Who was withheld from: their RFC, name and postal code as on their constancia de situación fiscal (SAT compares them). A non-resident goes with foreign: true, their tax identification number in tax_id and no postal code. |
period | The month (month) or months (from_month and to_month) of the year it covers, already finished or the current one. A supplier's annual certificate goes with from_month: 1 and to_month: 12. |
totals | The operation's amount; taxed and exempt if part of it is exempt (without them, everything is taxed). |
taxes | Each tax withheld: isr, iva or ieps, its base and the amount. payment_type is SAT's payment type (c_TipoPagoRet); by default 04 for ISR (provisional payment), 01 for IVA and 02 for IEPS. |
The keys SAT requires with a complement carry their object, with the reference's names:
code | Object | SAT complement |
|---|---|---|
01, 02, 04, 05 with recipient.foreign | foreign_payment | Pagos a extranjeros 1.0 |
06 | share_sale | Enajenación de acciones 1.0 |
14 | dividends | Dividendos 1.0 |
15 | distributable_remainder | Dividendos 1.0, with its Remanente node (proportion optional; without the object it goes without a proportion) |
16 | interest | Intereses 1.0 |
17 | trust_lease | Arrendamiento en fideicomiso 1.0 |
18 | foreign_payment | Pagos a extranjeros 1.0 |
19 | share_sale | Enajenación de acciones 1.0 |
20 | prize | Premios 1.0 (state and the amounts in totals) |
21 | trust | Fideicomiso no empresarial 1.0 |
22 | retirement_plan | Planes de retiro 1.1 |
23 | mortgage_interest | Intereses hipotecarios 1.0 |
24 | financial_derivatives | Operaciones con derivados 1.0 |
26 | platform | Servicios de plataformas tecnológicas 1.0 (see below) |
That is what SAT's key catalog (c_CveRetenc) asks for, and SAT refuses the certificate without its complement (Reten20107). Each object only goes with its key; with another it returns 400. Without it, the certificate returns 422 retention_invalid and says what's missing. Keys 27 (financial sector) and 28 (RIF taxpayers) can't be issued through the API: GET /v1/sat_catalogs/retention_codes lists them with supported: false.
{
"code": "20",
"recipient": { "tax_id": "MASO451221PM4", "legal_name": "MARIA OLIVIA MARTINEZ SAGAZ", "zip": "80290" },
"period": { "year": 2026, "month": 9 },
"totals": { "operation": 50000 },
"taxes": [{ "tax": "isr", "base": 50000, "amount": 500, "payment_type": "03" }],
"prize": { "state": "09" }
}Digital platforms (key 26)
A digital platform (transport, delivery, lodging, sale of goods, digital services, betting) sends each month to whoever sells through it a certificate with code: "26" and each operation in platform.services. Don't send totals or taxes: Fiscalisto calculates them from the operations as SAT requires (what was collected in cash outside the base, ISR at the rate for the service type and year, half or all of the IVA, truncated to the cent). If you send them, they must match.
| Field | What it is |
|---|---|
platform.type | The service type (c_TipoDeServ): 01 transport, 02 delivery, 03 other transport, 04 lodging, 05 sale of goods, 06 other services, 07 to 09 digital services to foreigners, 11 betting and raffles (from 2026). One per certificate. |
platform.periodicity | How often the platform pays them (c_Periodicidad): 01 weekly, 02 monthly (default), 03 daily, 04 fortnightly, 05 other. |
platform.isr_definitive | true if the individual chose for the ISR to be a definitive payment (LISR 113-B): the ISR goes with payment_type 03. |
platform.foreign_account | true if they're paid into an account abroad: 100% of the IVA is withheld. |
services[].date | The day the customer paid (YYYY-MM-DD), within the certificate's month. |
services[].payment_form | Payment form (c_FormaPagoServ): 01 cash, 03 transfer, 04 credit card… 09 prizes or rebates (no tax or commission, they don't add to the total). |
services[].price | The price before IVA. |
services[].rate | The transferred tax rate: 0.16 (default), 0.08, 0 or 0.5 (IEPS, betting only). |
services[].subtype | Transport: 01 personal (default), 02 shared, 03 plus, 04 cancellation. Betting: 08 games with bets (default), 09 raffles. |
services[].commission | What the platform charged (amount) and, if you know it, its percent. It goes on each operation with IVA; not on prizes or IEPS ones. |
services[].contribution | A government contribution paid (for example the lodging tax): amount and the state (01 to 32). |
services[].authorized_tax_id | The authorized third party's RFC (an individual), if any. |
Up to 5,000 operations per certificate, from a single month. Betting and raffles carry two operations per sale: one with IVA and another with rate: 0.5 (IEPS).
{
"code": "26",
"recipient": { "tax_id": "MASO451221PM4", "legal_name": "MARIA OLIVIA MARTINEZ SAGAZ", "zip": "80290" },
"period": { "year": 2026, "month": 10 },
"platform": {
"type": "01",
"services": [
{ "date": "2026-10-03", "payment_form": "04", "price": 300, "commission": { "amount": 75 } },
{ "date": "2026-10-31", "payment_form": "01", "price": 120, "commission": { "amount": 30 } }
]
}
}The certificate returns with totals and taxes already calculated: here ISR of $6.30 (2.1% of the $300 the platform collected) and withheld IVA of $24.00 (half of the $48.00 transferred outside cash).
The same Idempotency-Key again returns the same certificate, without stamping another. If SAT rejects it, it returns 422 retention_rejected with its code in sat_code, and retention.failed arrives.
Email it later
curl https://api.fiscalisto.com/v1/retentions/ret_PhBIUaMpw23r7krC5Vs3pDT6dB7C2wuY0D/send \
-H "Authorization: Bearer $FISCALISTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "to": "ana@example.com, contabilidad@example.com" }'Without to, it goes to the receiver's saved email. If it couldn't be sent, it returns email_failed and says why; two simultaneous sends of the same certificate do too (the second isn't sent).
Download it
GET /v1/retentions/{id}/pdf gives the PDF and /xml the stamped XML. GET /v1/retentions lists them, newest first, and filters by status (valid, canceled, rejected, processing), by recipient (an RFC) and by year.
Cancel it
curl https://api.fiscalisto.com/v1/retentions/ret_PhBIUaMpw23r7krC5Vs3pDT6dB7C2wuY0D/cancel \
-H "Authorization: Bearer $FISCALISTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "motive": "02" }'A certificate is cancelled right away: the receiver doesn't have to accept it. retention.canceled arrives. With reason 01 (it had errors and another replaces it), stamp the correct one first and send it in substitution (its ret_… or its UUID): it must be another current certificate of the same issuer.
To correct one in a single step, stamp the correct one with replaces, the UUID of the one it replaces: the new one carries the relation to it (TipoRelacion 04) and, once stamped, Fiscalisto cancels the old one with reason 01. It also works for one that came from the SAT and wasn't stamped in Fiscalisto, if it has the same issuer and the same receiver. The response has replaced: the UUID, canceled and, if it couldn't be cancelled, error; then the new one stays stamped and you cancel the old one with 01 as above.
Was this page helpful?
Payroll
Stamp payroll receipts (CFDI type N with Nómina 1.2) in two ways: Fiscalisto calculates your employee's ordinary receipt, or stamps as is the amounts your payroll system already calculated, ordinary or extraordinary.
Accounts receivable
Know which invoices are already paid, which are in installments and how much each customer owes you, and hear about each payment by webhook.