| Parameter | Type | Description |
|---|---|---|
limit | integer (1-100) | Number of results per page (default: 10) |
next | string | Pagination cursor for next page |
team | string | gigstack Connect: Target team ID |
order_by | string | Field to sort by (default: created_at) |
sort | string | Sort direction: asc or desc |
created_gte | integer | Filter by creation date (greater than or equal, unix timestamp ms) |
created_lte | integer | Filter by creation date (less than or equal, unix timestamp ms) |
status | string | Filter by status: valid or canceled |
retention_key | string | Filter by retention type key (e.g., 14, 16, 26) |
client_id | string | Filter by client ID |
{
"message": "Retentions retrieved successfully",
"data": [
{
"id": "ret_abc123",
"uuid": "12345678-1234-1234-1234-123456789012",
"status": "valid",
"document_type": "retenciones",
"retention_key": "14",
"folio_number": "1",
"series": "RET",
"receiver": {
"legal_name": "Juan Perez Garcia",
"tax_id": "PEGJ800101ABC",
"nationality": "Nacional"
},
"period": {
"start": 1,
"end": 12,
"year": 2025
},
"totals": {
"total_operation": 100000.00,
"total_taxable": 100000.00,
"total_exempt": 0,
"total_retained": 10000.00,
"tax_retained": [
{
"tax": "ISR",
"base": 100000.00,
"amount": 10000.00,
"payment_type": "03"
}
]
},
"stamp": {
"uuid": "12345678-1234-1234-1234-123456789012",
"stamped_at": "2025-06-15T10:30:00Z"
},
"livemode": true,
"created_at": 1718451000000
}
],
"has_more": false,
"total_results": 1
}| Field | Type | Required | Description |
|---|---|---|---|
retention_key | string | Yes | SAT retention type code (01-26) |
client | object | Yes | Client reference (by ID, search, or inline data) |
period_start | number | Yes | Start month of the fiscal period (1-12) |
period_end | number | Yes | End month of the fiscal period (1-12) |
period_year | number | Yes | Fiscal year |
total_operation | number | Yes | Total operation amount |
taxes | array | Yes | Array of retained taxes |
total_exempt | number | No | Exempt amount (default: 0) |
series | string | No | Invoice series (default: "RET") |
metadata | object | No | Custom metadata key-value pairs |
idempotency_key | string | No | Unique key to prevent duplicate creation |
retention_description | string | No | Required for key "25" (Otro tipo de retenciones) |
interest | object | No | Required for key "16" (Intereses) |
platform_services | object | No | Required for key "26" (Plataformas Tecnologicas) |
{
"tax": "ISR",
"base": 100000.00,
"amount": 10000.00,
"payment_type": "03"
}tax (string, required) - Tax type: ISR, IVA, or IEPS. Mapped automatically to SAT codes (001, 002, 003).base (number, required) - Taxable base amount.amount (number, required) - Amount retained.payment_type (string, optional) - SAT payment type code. Defaults to 03 (provisional) for ISR and 01 (definitivo) for IVA/IEPS.| Key | Description | Complement Required |
|---|---|---|
01 | Servicios profesionales | No |
02 | Renta de inmuebles | No |
06 | Enajenacion de acciones | No |
14 | Dividendos o utilidades | No |
16 | Intereses | Yes (interest object) |
25 | Otro tipo de retenciones | Yes (retention_description) |
26 | Plataformas tecnologicas | Yes (platform_services object) |
{
"message": "Retention created successfully",
"data": {
"id": "ret_xyz789",
"uuid": "98765432-1234-1234-1234-123456789012",
"status": "valid",
"document_type": "retenciones",
"retention_key": "14",
"folio_number": "1",
"series": "RET",
"issuer": {
"legal_name": "Mi Empresa SA de CV",
"tax_id": "MEM200101ABC",
"tax_system": "601"
},
"receiver": {
"legal_name": "Juan Perez Garcia",
"tax_id": "PEGJ800101ABC",
"nationality": "Nacional"
},
"period": {
"start": 1,
"end": 12,
"year": 2025
},
"totals": {
"total_operation": 500000.00,
"total_taxable": 500000.00,
"total_exempt": 0,
"total_retained": 50000.00,
"tax_retained": [
{
"tax": "ISR",
"base": 500000.00,
"amount": 50000.00,
"payment_type": "03"
}
]
},
"stamp": {
"uuid": "98765432-1234-1234-1234-123456789012",
"stamped_at": "2025-06-15T10:30:00Z"
},
"verification_url": "https://verificacfdi.facturaelectronica.sat.gob.mx/...",
"livemode": true,
"created_at": 1718451000000,
"metadata": {
"dividend_resolution": "ACT-2025-001"
}
}
}file_type (string, optional) - Filter by file type: pdf or xml. Returns both if omitted.team (string, optional) - gigstack Connect: Target team ID.{
"message": "Retention files retrieved successfully",
"data": [
{
"content": "JVBERi0xLjQK...",
"filename": "retention_98765432.pdf",
"type": "application/pdf"
}
]
}{
"motive": "02",
"replace_uuid": null
}| Code | Description | Requires replace_uuid |
|---|---|---|
01 | Comprobante emitido con errores con relacion | Yes |
02 | Comprobante emitido con errores sin relacion | No |
03 | No se llevo a cabo la operacion | No |
04 | Operacion nominativa relacionada en factura global | No |
{
"message": "Retention cancelled successfully",
"data": {
"id": "ret_xyz789",
"uuid": "98765432-1234-1234-1234-123456789012",
"status": "canceled",
"cancellation": {
"motive": "02",
"canceled_at": "2025-06-20T15:00:00Z"
}
}
}retention_key identifies the type of operation that requires tax withholding. Common keys include:| Key | Description |
|---|---|
01 | Servicios profesionales |
02 | Renta de inmuebles |
03 | Comercio exterior |
04 | Fideicomisos que no realizan actividades empresariales |
05 | Planes de retiro |
06 | Enajenacion de acciones |
07 | Intereses reales hipotecarios |
08 | Interes real por primas de seguro |
09 | Premios |
10 | Otras retenciones por ganancias |
11 | Pagos a extranjeros |
12 | Pagos a extranjeros consolidados |
14 | Dividendos o utilidades |
15 | Remanente distribuido |
16 | Intereses |
17 | Arrendamiento en fideicomiso |
18 | Pagos a FIBRAS |
22 | Enajenacion de FIBRAS |
25 | Otro tipo de retenciones |
26 | Plataformas tecnologicas |
| Friendly Name | SAT Code | Default Payment Type |
|---|---|---|
ISR | 001 | 03 (Pago provisional) |
IVA | 002 | 01 (Pago definitivo) |
IEPS | 003 | 01 (Pago definitivo) |
total_operation - total_exempttaxes[].amountretention_key is "16". Provides details about financial interest payments.{
"interest": {
"financial_system": "02",
"nominal_interest": 18500.00,
"real_interest": 12300.00,
"loss": 0,
"withdrawal_aores": null,
"financial_derivatives": null
}
}| Field | Type | Required | Description |
|---|---|---|---|
financial_system | string | Yes | Financial system code |
nominal_interest | number | Yes | Nominal interest amount |
real_interest | number | Yes | Real (inflation-adjusted) interest amount |
loss | number | No | Loss amount (default: 0) |
withdrawal_aores | string | No | AORES withdrawal code |
financial_derivatives | string | No | Financial derivatives code |
retention_key is "26". Details technology platform service transactions.{
"platform_services": {
"periodicity": "04",
"services": [
{
"payment_form": "03",
"service_type": "01",
"service_date": "2025-03-15",
"price_without_tax": 25000.00,
"tax_rate": 0.16,
"commission": 2500.00,
"government_contribution": 0
}
]
}
}| Code | Description |
|---|---|
01 | Diario |
02 | Semanal |
03 | Quincenal |
04 | Mensual |
05 | Bimestral |
retention_key is "25". A free-text description of the retention type.{
"retention_description": "Retencion por servicios de asesoria fiscal especializada"
}period_start, period_end, and period_year must correspond to the actual period covered by the retention.{
"message": "Invalid request body",
"error": "retention_key is required"
}{
"message": "Invalid request body",
"error": "retention_key must be a valid SAT retention type (01-26)"
}{
"message": "Invalid request body",
"error": "interest object is required for retention key 16"
}{
"message": "Resource not found"
}{
"message": "Retention is already canceled"
}{
"message": "An error occurred while creating retention",
"error": {
"code": "CFDI33106",
"message": "El RFC del receptor no es valido"
}
}