Skip to main content
POST
/
consulta
/
de
/
{format}
Query Electronic Document (DE)
curl --request POST \
  --url https://api.example.com/consulta/de/{format} \
  --header 'Content-Type: application/json' \
  --header 'token: <token>' \
  --data '
{
  "cdc": "<string>"
}
'
{
  "XML Response": "<string>",
  "rResEnviDe": {
    "dCodRes": "<string>",
    "dMsgRes": "<string>",
    "gResProc": {
      "dEstado": "<string>",
      "dCodRes": "<string>"
    }
  }
}

Overview

Query an electronic document from SIFEN using its CDC (Código de Control). This endpoint supports two response formats:
  • XML: Returns the raw XML response from SIFEN
  • JSON: Returns a converted JSON response

Authentication

Both endpoints require authentication via header parameters:
token
string
required
Authentication token for API access
Emisor
string
Emisor identifier. If not provided, the default emisor will be used

CDC Format

The CDC (Código de Control) must be exactly 44 characters long. It uniquely identifies an electronic document in the SIFEN system.

POST /consulta/de/xml

Returns the electronic document information in XML format.

Request Body

cdc
string
required
The 44-character CDC of the document to query

Example Request

curl -X POST https://api.jsifen.com/consulta/de/xml \
  -H "Content-Type: application/json" \
  -H "token: your-api-token" \
  -H "Emisor: 80012345-7" \
  -d '{
    "cdc": "12345678901234567890123456789012345678901234"
  }'

Response

XML Response
string
Returns the complete XML response from SIFEN containing the electronic document details

Success Response (200 OK)

<?xml version="1.0" encoding="UTF-8"?>
<rResEnviDe>
  <dCodRes>0</dCodRes>
  <dMsgRes>Documento procesado correctamente</dMsgRes>
  <gResProc>
    <dEstado>Aprobado</dEstado>
    <dCodRes>0260</dCodRes>
  </gResProc>
</rResEnviDe>

Error Response (500)

Error interno: [error message]

POST /consulta/de/json

Returns the electronic document information in JSON format (converted from XML).

Request Body

cdc
string
required
The 44-character CDC of the document to query

Example Request

curl -X POST https://api.jsifen.com/consulta/de/json \
  -H "Content-Type: application/json" \
  -H "token: your-api-token" \
  -H "Emisor: 80012345-7" \
  -d '{
    "cdc": "12345678901234567890123456789012345678901234"
  }'

Response

rResEnviDe
object
Root response object containing the query result
dCodRes
string
Response code from SIFEN
dMsgRes
string
Response message describing the result
gResProc
object
Processing result details
dEstado
string
Document status (e.g., “Aprobado”, “Rechazado”)
dCodRes
string
Processing result code

Success Response (200 OK)

{
  "rResEnviDe": {
    "dCodRes": "0",
    "dMsgRes": "Documento procesado correctamente",
    "gResProc": {
      "dEstado": "Aprobado",
      "dCodRes": "0260"
    }
  }
}

Error Response (500)

{
  "error": "Error description"
}

Error Handling

Both endpoints return HTTP 500 with error details if:
  • The CDC is invalid or malformed
  • The document is not found
  • SIFEN service is unavailable
  • Authentication fails
  • Any internal processing error occurs

Use Cases

  • Verify the status of a submitted electronic document
  • Check if a document has been approved or rejected
  • Retrieve document processing details
  • Monitor document status changes
  • Integration with external systems requiring different formats (XML vs JSON)

Build docs developers (and LLMs) love