Ir al contenido

Invalidar un Evento de Retorno u Operaciones Especiales (evento de invalidación v3)

POST
/mh-events/{id}/void
curl --request POST \
--url https://api.sudte.com/v1/mh-events/example/void \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--data '{ "reason_type": "1", "reason": "example", "responsible": { "name": "example", "document_type": "example", "document_number": "example" }, "requester": { "name": "example", "document_type": "example", "document_number": "example" } }'

Sin documento de reemplazo ni número de control (manual funcional §VII, filas EOE y ER). Plazo (Cuadro 6, ADR 0004): hasta el 10.º día hábil del mes siguiente al del sello del evento (void_deadline).

id
obligatorio
string
Idempotency-Key
obligatorio
string
<= 255 characters
Media type application/json
object
reason_type

CAT-024 Motivo del evento

string
default: 2
Allowed values: 1 2 3
reason
obligatorio
string
<= 200 characters
responsible
obligatorio
object
name
obligatorio
string
document_type
obligatorio

CAT-022

string
document_number
obligatorio
string
requester
obligatorio
object
name
obligatorio
string
document_type
obligatorio

CAT-022

string
document_number
obligatorio
string

Invalidación procesada

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"
}
]
}