Ir al contenido

Subir a mano un DTE recibido (el archivo JSON del proveedor)

POST
/received-documents/upload
curl --request POST \
--url https://api.sudte.com/v1/received-documents/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "dte": {}, "emitter_id": "example", "pdf_base64": "example" }'

Mismas reglas que el correo: el receptor del DTE debe ser una empresa de la cuenta (o la indicada en emitter_id). Idempotente por código de generación (200 con el que ya estaba).

Media type application/json
object
dte
obligatorio

Archivo JSON del DTE tal como lo entregó el proveedor

object
key
additional properties
any
emitter_id
string
pdf_base64

PDF del proveedor (opcional, máx. 5 MB)

string

Example generated

{
"dte": {},
"emitter_id": "example",
"pdf_base64": "example"
}

Ya estaba

Media type application/json
object
id
string
object
Allowed value: received_document
emitter_id
string
environment

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

string
Allowed values: 00 01
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
issued_at
string format: date-time
issuer
object
nit
string
nrc
string
name
string
trade_name
string
totals
object
taxable
string
exempt
string
non_subject
string
iva
string
iva_withheld
string
iva_perceived
string
total
string
other_taxes

Otros tributos del resumen del DTE distintos del IVA (20) y del IVA de exportación (C3), como mapa código CAT-015 → monto (string). Por ejemplo {"D1": "3.58", "C8": "1.79"} (D1 FOVIAL, C8 COTRANS, 59 turismo…). Objeto vacío si el documento no trae otros tributos.

object
key
additional properties
string
reception_stamp
string | null
status

Estado en Hacienda: pending sin consultar todavía, valid transmitido satisfactoriamente, voided invalidado por el emisor, not_found Hacienda no lo tiene

string
Allowed values: pending valid voided not_found
mh
object
state

Estado según la consulta pública (SR, INV, EE…)

string | null
description
string | null
checked_at
string | null format: date-time
next_check_at
string | null format: date-time
void
object
voided_at
string | null format: date-time
reason
string | null
replacement_generation_code
string | null
source
string
Allowed values: email upload
has_pdf

True si el proveedor envió su PDF (si no, /pdf entrega la representación de sudte)

boolean
external_id

Registro en el sistema del cliente (ack)

string | null
acked_at
string | null format: date-time
received_at
string format: date-time

Example

{
"object": "received_document",
"environment": "00",
"type": "01",
"status": "pending",
"source": "email"
}

Guardado

Media type application/json
object
id
string
object
Allowed value: received_document
emitter_id
string
environment

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

string
Allowed values: 00 01
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
issued_at
string format: date-time
issuer
object
nit
string
nrc
string
name
string
trade_name
string
totals
object
taxable
string
exempt
string
non_subject
string
iva
string
iva_withheld
string
iva_perceived
string
total
string
other_taxes

Otros tributos del resumen del DTE distintos del IVA (20) y del IVA de exportación (C3), como mapa código CAT-015 → monto (string). Por ejemplo {"D1": "3.58", "C8": "1.79"} (D1 FOVIAL, C8 COTRANS, 59 turismo…). Objeto vacío si el documento no trae otros tributos.

object
key
additional properties
string
reception_stamp
string | null
status

Estado en Hacienda: pending sin consultar todavía, valid transmitido satisfactoriamente, voided invalidado por el emisor, not_found Hacienda no lo tiene

string
Allowed values: pending valid voided not_found
mh
object
state

Estado según la consulta pública (SR, INV, EE…)

string | null
description
string | null
checked_at
string | null format: date-time
next_check_at
string | null format: date-time
void
object
voided_at
string | null format: date-time
reason
string | null
replacement_generation_code
string | null
source
string
Allowed values: email upload
has_pdf

True si el proveedor envió su PDF (si no, /pdf entrega la representación de sudte)

boolean
external_id

Registro en el sistema del cliente (ack)

string | null
acked_at
string | null format: date-time
received_at
string format: date-time

Example

{
"object": "received_document",
"environment": "00",
"type": "01",
"status": "pending",
"source": "email"
}

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