Ir al contenido

Evento de Operaciones Especiales (v1)

POST
/emitters/{id}/special-operations
curl --request POST \
--url 'https://api.sudte.com/v1/emitters/example/special-operations?mode=sync&dry_run=false' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--data '{ "items": [ { "document_type": "02", "from": "1", "to": "25", "description": "Facturas simplificadas del día", "unit_price": "10.00" } ] }'

Normativa §13.4 y Manual Funcional §IX: informa las facturas de venta simplificadas (CAT-023 02, solo por rango from/to) o los comprobantes de control interno autorizados por el art. 113 CT (97, por rango o uno a uno con number y date). Esquema fe-eop-v1; se transmite al MH como un DTE (tipoDte 17) con modelo previo y transmisión normal.

Reglas que valida sudte: un solo tipo de documento por evento; rangos y uno a uno no se combinan; hasta 500 ítems; precios sin IVA (IVA 13 % en el resumen, tributo 20 en las líneas gravadas); uno a uno la cantidad es 1; por rango la cantidad es to - from + 1 (o la indicada si el rango no es numérico) y la fecha y el documento de origen van vacíos; los documentos deben ser del período de event_date; cada documento se informa una sola vez: un número o un rango que ya está en otro evento vigente del emisor responde 422. Las anulaciones van en un evento aparte: todas las líneas con reference_generation_code (el EOE donde se informó como activo, vigente y de este emisor) y la fecha de los documentos de origen (hasta 3 meses antes de event_date). Plazo (Cuadro 9): hasta el 10.º día hábil del mes siguiente al período informado. Webhooks special_operations.processed, special_operations.rejected, special_operations.voided.

id
obligatorio
string
Idempotency-Key
obligatorio
string
<= 255 characters
mode
string
default: sync

sync (por defecto) o async

dry_run
boolean
Media type application/json
object
event_date

Fecha del evento (período que se informa). Por defecto hoy; puede ser anterior (AV 9.3) dentro del plazo del Cuadro 9

string format: date
external_id
string
<= 100 characters
items
obligatorio
Array<object>
>= 1 items <= 500 items
object
document_type
obligatorio

CAT-023: 02 factura de venta simplificada (solo por rango), 97 comprobante de control interno

string
Allowed values: 02 97
from

Doc. Del (por rango)

string
<= 36 characters
to

Doc. Al (por rango)

string
<= 36 characters
number

Documento origen (uno a uno, solo 97)

string
<= 36 characters
date

Fecha del documento origen: obligatoria uno a uno y en anulaciones; vacía en rangos activos

string format: date
quantity

Por rango numérico se calcula (to - from + 1); uno a uno es 1

integer
>= 1
description
obligatorio
string
<= 1500 characters
unit_price
obligatorio

Sin IVA

string
/^-?\d+(\.\d{1,8})?$/
tax
string
default: gravada
Allowed values: gravada exenta no_sujeta
reference_generation_code

Anulación: código de generación del EOE (vigente, de este emisor) donde se informó como activo

string

Ejemplos

Example fvs

Facturas simplificadas por rango

{
"items": [
{
"document_type": "02",
"from": "1",
"to": "25",
"description": "Facturas simplificadas del día",
"unit_price": "10.00"
}
]
}

Resultado de dry_run

Media type application/json
object
id
string
object
Allowed value: mh_event
kind
string
Allowed values: return special_operations
type

CAT-002: 17 Evento de Operaciones Especiales, 18 Evento de Retorno

string
Allowed values: 17 18
emitter_id
string
environment

00 pruebas, 01 producción (CAT-001)

string
Allowed values: 00 01
status

discarded: el emisor abandonó un documento sin sello (rechazado por el MH) con POST /documents/{id}/discard; conserva su historial, ya no se transmite ni se corrige y, si discard.number_released, su número de control lo toma el siguiente documento del mismo alcance y año.

string
Allowed values: draft validated signed sending processed rejected contingency voided error discarded
external_id
string | null
generation_code

CodigoGeneracion del evento

string
reception_stamp

SelloRecibido

string | null
processed_at
string | null format: date-time
event_at

Fecha y hora del evento (fecEmi/horEmi)

string format: date-time
establishment
string
point_of_sale
string
receiver

Retorno: receptor del documento (sección «documento»)

object
name
string | null
document_type
string | null
document_number
string | null
email
string | null
related_documents

Retorno: documentos a los que se aplica y lo retornado de cada uno

Array<object>
object
id
string
type

CAT-002. Implementados: todos (01, 03, 04, 05, 06, 07, 08, 09, 11, 14 y 15)

string
Allowed values: 01 03 04 05 06 07 08 09 11 14 15
generation_code
string
control_number
string
issue_date
string format: date
returned

Montos por categoría (2 decimales). FE: gravado con IVA, como en el DTE

object
taxable

Ventas gravadas

string
/^-?\d+(\.\d{1,8})?$/
exempt
string
/^-?\d+(\.\d{1,8})?$/
non_subject
string
/^-?\d+(\.\d{1,8})?$/
purchases

Compras a sujetos excluidos (FSE)

string
/^-?\d+(\.\d{1,8})?$/
iva_withheld
string
/^-?\d+(\.\d{1,8})?$/
income_tax_withheld
string
/^-?\d+(\.\d{1,8})?$/
totals
object
total_non_subject
string
/^-?\d+(\.\d{1,8})?$/
total_exempt
string
/^-?\d+(\.\d{1,8})?$/
total_taxable

Gravado (en el retorno de FSE, compras)

string
/^-?\d+(\.\d{1,8})?$/
subtotal
string
/^-?\d+(\.\d{1,8})?$/
iva

Retorno de FE: totalIva informativo; EOE: IVA 13 %

string
/^-?\d+(\.\d{1,8})?$/
iva_withheld
string
/^-?\d+(\.\d{1,8})?$/
total_operation
string
/^-?\d+(\.\d{1,8})?$/
total

Retorno: totalPagar; EOE: total

string
/^-?\d+(\.\d{1,8})?$/
total_in_words
string
mh_response
object
code
string | null
message
string | null
observations
Array<string>
public_url

Consulta pública del MH (QR)

string format: uri
json_url
string format: uri
pdf_url
string format: uri
void_deadline

«Invalidar hasta»: 10.º día hábil del mes siguiente al sello (Cuadro 6, ADR 0004)

string | null format: date-time
voided_at
string | null format: date-time
void
object
status
string
reception_stamp
string | null
generation_code
string
warnings
Array<object>
object
code
string
message
string
path
string
events
Array<object>
object
type
string
at
string format: date-time
message
string
created_at
string format: date-time

Example

{
"object": "mh_event",
"kind": "return",
"type": "17",
"environment": "00",
"status": "draft",
"related_documents": [
{
"type": "01",
"returned": {
"taxable": "113.00",
"exempt": "113.00",
"non_subject": "113.00",
"purchases": "113.00",
"iva_withheld": "113.00",
"income_tax_withheld": "113.00"
}
}
],
"totals": {
"total_non_subject": "113.00",
"total_exempt": "113.00",
"total_taxable": "113.00",
"subtotal": "113.00",
"iva": "113.00",
"iva_withheld": "113.00",
"total_operation": "113.00",
"total": "113.00"
}
}

Evento sellado por el MH

Media type application/json
object
id
string
object
Allowed value: mh_event
kind
string
Allowed values: return special_operations
type

CAT-002: 17 Evento de Operaciones Especiales, 18 Evento de Retorno

string
Allowed values: 17 18
emitter_id
string
environment

00 pruebas, 01 producción (CAT-001)

string
Allowed values: 00 01
status

discarded: el emisor abandonó un documento sin sello (rechazado por el MH) con POST /documents/{id}/discard; conserva su historial, ya no se transmite ni se corrige y, si discard.number_released, su número de control lo toma el siguiente documento del mismo alcance y año.

string
Allowed values: draft validated signed sending processed rejected contingency voided error discarded
external_id
string | null
generation_code

CodigoGeneracion del evento

string
reception_stamp

SelloRecibido

string | null
processed_at
string | null format: date-time
event_at

Fecha y hora del evento (fecEmi/horEmi)

string format: date-time
establishment
string
point_of_sale
string
receiver

Retorno: receptor del documento (sección «documento»)

object
name
string | null
document_type
string | null
document_number
string | null
email
string | null
related_documents

Retorno: documentos a los que se aplica y lo retornado de cada uno

Array<object>
object
id
string
type

CAT-002. Implementados: todos (01, 03, 04, 05, 06, 07, 08, 09, 11, 14 y 15)

string
Allowed values: 01 03 04 05 06 07 08 09 11 14 15
generation_code
string
control_number
string
issue_date
string format: date
returned

Montos por categoría (2 decimales). FE: gravado con IVA, como en el DTE

object
taxable

Ventas gravadas

string
/^-?\d+(\.\d{1,8})?$/
exempt
string
/^-?\d+(\.\d{1,8})?$/
non_subject
string
/^-?\d+(\.\d{1,8})?$/
purchases

Compras a sujetos excluidos (FSE)

string
/^-?\d+(\.\d{1,8})?$/
iva_withheld
string
/^-?\d+(\.\d{1,8})?$/
income_tax_withheld
string
/^-?\d+(\.\d{1,8})?$/
totals
object
total_non_subject
string
/^-?\d+(\.\d{1,8})?$/
total_exempt
string
/^-?\d+(\.\d{1,8})?$/
total_taxable

Gravado (en el retorno de FSE, compras)

string
/^-?\d+(\.\d{1,8})?$/
subtotal
string
/^-?\d+(\.\d{1,8})?$/
iva

Retorno de FE: totalIva informativo; EOE: IVA 13 %

string
/^-?\d+(\.\d{1,8})?$/
iva_withheld
string
/^-?\d+(\.\d{1,8})?$/
total_operation
string
/^-?\d+(\.\d{1,8})?$/
total

Retorno: totalPagar; EOE: total

string
/^-?\d+(\.\d{1,8})?$/
total_in_words
string
mh_response
object
code
string | null
message
string | null
observations
Array<string>
public_url

Consulta pública del MH (QR)

string format: uri
json_url
string format: uri
pdf_url
string format: uri
void_deadline

«Invalidar hasta»: 10.º día hábil del mes siguiente al sello (Cuadro 6, ADR 0004)

string | null format: date-time
voided_at
string | null format: date-time
void
object
status
string
reception_stamp
string | null
generation_code
string
warnings
Array<object>
object
code
string
message
string
path
string
events
Array<object>
object
type
string
at
string format: date-time
message
string
created_at
string format: date-time

Example

{
"object": "mh_event",
"kind": "return",
"type": "17",
"environment": "00",
"status": "draft",
"related_documents": [
{
"type": "01",
"returned": {
"taxable": "113.00",
"exempt": "113.00",
"non_subject": "113.00",
"purchases": "113.00",
"iva_withheld": "113.00",
"income_tax_withheld": "113.00"
}
}
],
"totals": {
"total_non_subject": "113.00",
"total_exempt": "113.00",
"total_taxable": "113.00",
"subtotal": "113.00",
"iva": "113.00",
"iva_withheld": "113.00",
"total_operation": "113.00",
"total": "113.00"
}
}

Firmado; el MH no respondió a tiempo

Media type application/json
object
id
string
object
Allowed value: mh_event
kind
string
Allowed values: return special_operations
type

CAT-002: 17 Evento de Operaciones Especiales, 18 Evento de Retorno

string
Allowed values: 17 18
emitter_id
string
environment

00 pruebas, 01 producción (CAT-001)

string
Allowed values: 00 01
status

discarded: el emisor abandonó un documento sin sello (rechazado por el MH) con POST /documents/{id}/discard; conserva su historial, ya no se transmite ni se corrige y, si discard.number_released, su número de control lo toma el siguiente documento del mismo alcance y año.

string
Allowed values: draft validated signed sending processed rejected contingency voided error discarded
external_id
string | null
generation_code

CodigoGeneracion del evento

string
reception_stamp

SelloRecibido

string | null
processed_at
string | null format: date-time
event_at

Fecha y hora del evento (fecEmi/horEmi)

string format: date-time
establishment
string
point_of_sale
string
receiver

Retorno: receptor del documento (sección «documento»)

object
name
string | null
document_type
string | null
document_number
string | null
email
string | null
related_documents

Retorno: documentos a los que se aplica y lo retornado de cada uno

Array<object>
object
id
string
type

CAT-002. Implementados: todos (01, 03, 04, 05, 06, 07, 08, 09, 11, 14 y 15)

string
Allowed values: 01 03 04 05 06 07 08 09 11 14 15
generation_code
string
control_number
string
issue_date
string format: date
returned

Montos por categoría (2 decimales). FE: gravado con IVA, como en el DTE

object
taxable

Ventas gravadas

string
/^-?\d+(\.\d{1,8})?$/
exempt
string
/^-?\d+(\.\d{1,8})?$/
non_subject
string
/^-?\d+(\.\d{1,8})?$/
purchases

Compras a sujetos excluidos (FSE)

string
/^-?\d+(\.\d{1,8})?$/
iva_withheld
string
/^-?\d+(\.\d{1,8})?$/
income_tax_withheld
string
/^-?\d+(\.\d{1,8})?$/
totals
object
total_non_subject
string
/^-?\d+(\.\d{1,8})?$/
total_exempt
string
/^-?\d+(\.\d{1,8})?$/
total_taxable

Gravado (en el retorno de FSE, compras)

string
/^-?\d+(\.\d{1,8})?$/
subtotal
string
/^-?\d+(\.\d{1,8})?$/
iva

Retorno de FE: totalIva informativo; EOE: IVA 13 %

string
/^-?\d+(\.\d{1,8})?$/
iva_withheld
string
/^-?\d+(\.\d{1,8})?$/
total_operation
string
/^-?\d+(\.\d{1,8})?$/
total

Retorno: totalPagar; EOE: total

string
/^-?\d+(\.\d{1,8})?$/
total_in_words
string
mh_response
object
code
string | null
message
string | null
observations
Array<string>
public_url

Consulta pública del MH (QR)

string format: uri
json_url
string format: uri
pdf_url
string format: uri
void_deadline

«Invalidar hasta»: 10.º día hábil del mes siguiente al sello (Cuadro 6, ADR 0004)

string | null format: date-time
voided_at
string | null format: date-time
void
object
status
string
reception_stamp
string | null
generation_code
string
warnings
Array<object>
object
code
string
message
string
path
string
events
Array<object>
object
type
string
at
string format: date-time
message
string
created_at
string format: date-time

Example

{
"object": "mh_event",
"kind": "return",
"type": "17",
"environment": "00",
"status": "draft",
"related_documents": [
{
"type": "01",
"returned": {
"taxable": "113.00",
"exempt": "113.00",
"non_subject": "113.00",
"purchases": "113.00",
"iva_withheld": "113.00",
"income_tax_withheld": "113.00"
}
}
],
"totals": {
"total_non_subject": "113.00",
"total_exempt": "113.00",
"total_taxable": "113.00",
"subtotal": "113.00",
"iva": "113.00",
"iva_withheld": "113.00",
"total_operation": "113.00",
"total": "113.00"
}
}

Error (RFC 9457)

Media type application/problem+json
object
type
string format: uri
title
string
status
integer
detail
string
instance
string
request_id
string
errors
Array<object>
object
path
string
message
string
mh
object
codigoMsg
string
descripcionMsg
string
observaciones
Array<string>
blocking_documents

Invalidación rechazada por AV 44: NC/ND vigentes (o pendientes) que ajustan el documento; invalídelas primero

Array<object>
object
id
string
type

CAT-002. Implementados: todos (01, 03, 04, 05, 06, 07, 08, 09, 11, 14 y 15)

string
Allowed values: 01 03 04 05 06 07 08 09 11 14 15
control_number
string
generation_code
string
status

discarded: el emisor abandonó un documento sin sello (rechazado por el MH) con POST /documents/{id}/discard; conserva su historial, ya no se transmite ni se corrige y, si discard.number_released, su número de control lo toma el siguiente documento del mismo alcance y año.

string
Allowed values: draft validated signed sending processed rejected contingency voided error discarded
issue_date
string format: date

Example

{
"blocking_documents": [
{
"type": "01",
"status": "draft"
}
]
}

Error (RFC 9457)

Media type application/problem+json
object
type
string format: uri
title
string
status
integer
detail
string
instance
string
request_id
string
errors
Array<object>
object
path
string
message
string
mh
object
codigoMsg
string
descripcionMsg
string
observaciones
Array<string>
blocking_documents

Invalidación rechazada por AV 44: NC/ND vigentes (o pendientes) que ajustan el documento; invalídelas primero

Array<object>
object
id
string
type

CAT-002. Implementados: todos (01, 03, 04, 05, 06, 07, 08, 09, 11, 14 y 15)

string
Allowed values: 01 03 04 05 06 07 08 09 11 14 15
control_number
string
generation_code
string
status

discarded: el emisor abandonó un documento sin sello (rechazado por el MH) con POST /documents/{id}/discard; conserva su historial, ya no se transmite ni se corrige y, si discard.number_released, su número de control lo toma el siguiente documento del mismo alcance y año.

string
Allowed values: draft validated signed sending processed rejected contingency voided error discarded
issue_date
string format: date

Example

{
"blocking_documents": [
{
"type": "01",
"status": "draft"
}
]
}

Error (RFC 9457)

Media type application/problem+json
object
type
string format: uri
title
string
status
integer
detail
string
instance
string
request_id
string
errors
Array<object>
object
path
string
message
string
mh
object
codigoMsg
string
descripcionMsg
string
observaciones
Array<string>
blocking_documents

Invalidación rechazada por AV 44: NC/ND vigentes (o pendientes) que ajustan el documento; invalídelas primero

Array<object>
object
id
string
type

CAT-002. Implementados: todos (01, 03, 04, 05, 06, 07, 08, 09, 11, 14 y 15)

string
Allowed values: 01 03 04 05 06 07 08 09 11 14 15
control_number
string
generation_code
string
status

discarded: el emisor abandonó un documento sin sello (rechazado por el MH) con POST /documents/{id}/discard; conserva su historial, ya no se transmite ni se corrige y, si discard.number_released, su número de control lo toma el siguiente documento del mismo alcance y año.

string
Allowed values: draft validated signed sending processed rejected contingency voided error discarded
issue_date
string format: date

Example

{
"blocking_documents": [
{
"type": "01",
"status": "draft"
}
]
}