{
  "title": "Factly API: ejemplos de respuestas e interpretación",
  "edition": "2026-12-03",
  "illustrativeOnly": true,
  "notice": "Todos los datos, importes, identificadores, códigos TEST y URLs QR son ficticios. No ejecutar estas muestras como solicitudes ni abrir sus QR. Las rutas productivas solo documentan el contrato: este archivo no habilita ni envía documentos. Cada caso es independiente salvo referencias explícitas. response.body representa la respuesta HTTP; el resto es metadato de esta guía. Los mensajes pueden variar; programe contra code/status y preserve campos desconocidos.",
  "sources": [
    "docs/openapi/factly-api.v1.openapi.json",
    "api/core/Response.cfc",
    "api/public/index.cfm",
    "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
    "api/modules/factly_api/services/FactlyApiProductionService.cfc",
    "api/modules/factly_api/node/sandbox-dgii.js"
  ],
  "examples": [
    {
      "id": "create-sent",
      "title": "Creación E31 enviada; aprobación pendiente",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 201,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-create-sent"
        },
        "body": {
          "id": 501,
          "requestId": 501,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-501",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "sent",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-sandbox-501",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000501",
            "status": "sent",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/testecf/consultatimbre?rncemisor=999999999&encf=E310009000501&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 501,
            "fechaVencimientoSecuencia": "2028-12-31"
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-501",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "11111111-2222-4333-8444-555555555555",
            "result": {}
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/501",
            "status": "/api/public/v1/sandbox/documents/501/status",
            "pdf": "/api/public/v1/sandbox/documents/501/pdf",
            "xml": "/api/public/v1/sandbox/documents/501/xml",
            "retry": "/api/public/v1/sandbox/documents/501/retry"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "Factly conserva la operación y el e-NCF; sent no equivale a aprobación.",
      "nextAction": "Guardar requestId, externalId y document.encf; consultar links.status con la misma credencial.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "status-approved",
      "title": "Consulta E31 aceptada en sandbox",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/501/status"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-status-approved"
        },
        "body": {
          "id": 501,
          "requestId": 501,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-501",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "approved",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "December, 02 2026 09:00:30 -0400",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-sandbox-501",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000501",
            "status": "approved",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/testecf/consultatimbre?rncemisor=999999999&encf=E310009000501&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": true,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 501,
            "fechaVencimientoSecuencia": "2028-12-31"
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-501",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "11111111-2222-4333-8444-555555555555",
            "result": {
              "environment": "testecf",
              "codigo": "1",
              "estado": "Aceptado",
              "mensajes": [],
              "secuenciaUtilizada": true
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/501",
            "status": "/api/public/v1/sandbox/documents/501/status",
            "pdf": "/api/public/v1/sandbox/documents/501/pdf",
            "xml": "/api/public/v1/sandbox/documents/501/xml",
            "retry": "/api/public/v1/sandbox/documents/501/retry"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "La aceptación corresponde a testecf. isFiscal permanece false en sandbox.",
      "nextAction": "Descargar XML/PDF disponibles y usar document.qrUrl para el QR de la representación propia.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "create-approved",
      "title": "RFCE aceptado en la respuesta de creación",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 201,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-create-approved"
        },
        "body": {
          "id": 502,
          "requestId": 502,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-502",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "approved",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "December, 02 2026 09:00:30 -0400",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-sandbox-502",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E320009000502",
            "status": "approved",
            "isFiscal": false,
            "qrUrl": "https://fc.dgii.gov.do/testecf/consultatimbrefc?rncemisor=999999999&encf=E320009000502&montototal=118.00&codigoseguridad=ABC123",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": true,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 502,
            "fechaVencimientoSecuencia": ""
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-502",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {
              "environment": "testecf",
              "codigo": "1",
              "estado": "Aceptado",
              "mensajes": [],
              "secuenciaUtilizada": true
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/502",
            "status": "/api/public/v1/sandbox/documents/502/status",
            "pdf": "/api/public/v1/sandbox/documents/502/pdf",
            "xml": "/api/public/v1/sandbox/documents/502/xml",
            "retry": "/api/public/v1/sandbox/documents/502/retry"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "Un RFCE puede quedar approved de inmediato y sin trackId.",
      "nextAction": "Guardar la operación y descargar artefactos; no exigir trackId para reconocer la aceptación.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "create-replayed",
      "title": "Repetición idempotente del POST original",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 201,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-create-replayed"
        },
        "body": {
          "id": 501,
          "requestId": 501,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-501",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "approved",
          "replayed": true,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "December, 02 2026 09:00:30 -0400",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-sandbox-501",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000501",
            "status": "approved",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/testecf/consultatimbre?rncemisor=999999999&encf=E310009000501&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": true,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 501,
            "fechaVencimientoSecuencia": "2028-12-31"
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-501",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "11111111-2222-4333-8444-555555555555",
            "result": {
              "environment": "testecf",
              "codigo": "1",
              "estado": "Aceptado",
              "mensajes": [],
              "secuenciaUtilizada": true
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/501",
            "status": "/api/public/v1/sandbox/documents/501/status",
            "pdf": "/api/public/v1/sandbox/documents/501/pdf",
            "xml": "/api/public/v1/sandbox/documents/501/xml",
            "retry": "/api/public/v1/sandbox/documents/501/retry"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "Se devuelve la operación 501 existente; no se crea otro documento ni se asigna otro e-NCF.",
      "nextAction": "Reutilizar este resultado. No cambiar externalId, Idempotency-Key ni cuerpo para recuperar la misma factura.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "sandbox-reserved",
      "title": "Operación sandbox en estado reserved",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/503"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-sandbox-reserved"
        },
        "body": {
          "id": 503,
          "requestId": 503,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-503",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "reserved",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": true,
          "reconciliationRequired": false,
          "document": {
            "documentType": "31",
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000503",
            "status": "reserved",
            "isFiscal": false,
            "qrUrl": "",
            "securityCode": "",
            "signedAt": "",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": false,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf"
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-503",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {}
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/503",
            "status": "/api/public/v1/sandbox/documents/503/status",
            "pdf": "/api/public/v1/sandbox/documents/503/pdf",
            "xml": "/api/public/v1/sandbox/documents/503/xml",
            "retry": "/api/public/v1/sandbox/documents/503/retry"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "El e-NCF ya está reservado; todavía no hay envío ni firma disponible.",
      "nextAction": "Si retryAllowed es true, POST al retry de esta operación con Body none.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "sandbox-submitting",
      "title": "Operación sandbox en estado submitting",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/503"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-sandbox-submitting"
        },
        "body": {
          "id": 503,
          "requestId": 503,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-503",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "submitting",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": true,
          "document": {
            "externalId": "ejemplo-sandbox-503",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000503",
            "status": "submitting",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/testecf/consultatimbre?rncemisor=999999999&encf=E310009000503&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 503,
            "fechaVencimientoSecuencia": "2028-12-31"
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-503",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {}
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/503",
            "status": "/api/public/v1/sandbox/documents/503/status",
            "pdf": "/api/public/v1/sandbox/documents/503/pdf",
            "xml": "/api/public/v1/sandbox/documents/503/xml",
            "retry": "/api/public/v1/sandbox/documents/503/retry"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "Hay un envío en curso o cuyo resultado debe conciliarse.",
      "nextAction": "Consultar estado de la misma operación; no crear otra factura.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "sandbox-failed",
      "title": "Operación sandbox en estado failed",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/503"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-sandbox-failed"
        },
        "body": {
          "id": 503,
          "requestId": 503,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-503",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "failed",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": true,
          "reconciliationRequired": false,
          "document": {
            "documentType": "31",
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000503",
            "status": "failed",
            "isFiscal": false,
            "qrUrl": "",
            "securityCode": "",
            "signedAt": "",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": false,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf"
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-503",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {
              "environment": "testecf",
              "codigo": "",
              "estado": "",
              "mensajes": [],
              "stage": "certificate",
              "code": "API_SANDBOX_CERTIFICATE_REQUIRED",
              "reason": "CERTIFICATE_READ_FAILED",
              "transportCode": "",
              "httpStatus": 0
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/503",
            "status": "/api/public/v1/sandbox/documents/503/status",
            "pdf": "/api/public/v1/sandbox/documents/503/pdf",
            "xml": "/api/public/v1/sandbox/documents/503/xml",
            "retry": "/api/public/v1/sandbox/documents/503/retry"
          },
          "error": {
            "code": "API_SANDBOX_CERTIFICATE_REQUIRED",
            "message": "API_SANDBOX_CERTIFICATE_REQUIRED"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "Fallo previo al envío con reintento permitido en esta muestra.",
      "nextAction": "Resolver la causa indicada y usar retry de la misma operación si retryAllowed es true.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "create-transport-uncertain",
      "title": "Creación persistida con HTTP 500 informado por DGII",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 201,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-create-transport-uncertain"
        },
        "body": {
          "id": 504,
          "requestId": 504,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-504",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "reconciliation_required",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": true,
          "document": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E320009000504",
            "status": "reconciliation_required",
            "isFiscal": false,
            "qrUrl": "https://fc.dgii.gov.do/testecf/consultatimbrefc?rncemisor=999999999&encf=E320009000504&montototal=118.00&codigoseguridad=ABC123",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 504,
            "fechaVencimientoSecuencia": ""
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {
              "environment": "testecf",
              "code": "DGII_TRANSPORT_FAILED",
              "stage": "send",
              "reason": "DGII_HTTP_ERROR",
              "httpStatus": 500,
              "transportCode": "ERR_BAD_RESPONSE",
              "codigo": "",
              "estado": "",
              "mensajes": []
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/504",
            "status": "/api/public/v1/sandbox/documents/504/status",
            "pdf": "/api/public/v1/sandbox/documents/504/pdf",
            "xml": "/api/public/v1/sandbox/documents/504/xml",
            "retry": "/api/public/v1/sandbox/documents/504/retry"
          },
          "error": {
            "code": "DGII_TRANSPORT_FAILED",
            "message": "No se pudo completar la comunicación con DGII. Revisa el detalle antes de reintentar."
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "El HTTP de Factly es 201; el 500 está en dgii.result.httpStatus. No hay rechazo fiscal confirmado.",
      "nextAction": "Conservar la operación y consultar su estado antes de decidir recuperación.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "status-rejected",
      "title": "Consulta de un rechazo de DGII",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/505/status"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-status-rejected"
        },
        "body": {
          "id": 505,
          "requestId": 505,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-505",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "rejected",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "December, 02 2026 09:00:30 -0400",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-sandbox-505",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E320009000505",
            "status": "rejected",
            "isFiscal": false,
            "qrUrl": "https://fc.dgii.gov.do/testecf/consultatimbrefc?rncemisor=999999999&encf=E320009000505&montototal=118.00&codigoseguridad=ABC123",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 505,
            "fechaVencimientoSecuencia": ""
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-505",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {
              "environment": "testecf",
              "codigo": "2",
              "estado": "Rechazado",
              "mensajes": [
                {
                  "codigo": "TEST",
                  "valor": "Motivo ficticio de rechazo para esta muestra."
                }
              ],
              "secuenciaUtilizada": true
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/505",
            "status": "/api/public/v1/sandbox/documents/505/status",
            "pdf": "/api/public/v1/sandbox/documents/505/pdf",
            "xml": "/api/public/v1/sandbox/documents/505/xml",
            "retry": "/api/public/v1/sandbox/documents/505/retry"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "HTTP 200 significa que se pudo consultar. El documento está rejected; TEST es un código ficticio de mensaje.",
      "nextAction": "Detener reenvíos de este documento; revisar los mensajes y la corrección que corresponda, sin renumerar la operación existente.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "status-approved-conditional",
      "title": "Aceptación condicional expuesta como approved",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/506/status"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-status-approved-conditional"
        },
        "body": {
          "id": 506,
          "requestId": 506,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-506",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "approved",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "December, 02 2026 09:00:30 -0400",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-sandbox-506",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E320009000506",
            "status": "approved",
            "isFiscal": false,
            "qrUrl": "https://fc.dgii.gov.do/testecf/consultatimbrefc?rncemisor=999999999&encf=E320009000506&montototal=118.00&codigoseguridad=ABC123",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": true,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 506,
            "fechaVencimientoSecuencia": ""
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-506",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {
              "environment": "testecf",
              "codigo": "4",
              "estado": "Aceptado Condicional",
              "mensajes": [
                {
                  "codigo": "TEST",
                  "valor": "Observación ficticia de aceptación condicional."
                }
              ],
              "secuenciaUtilizada": true
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/506",
            "status": "/api/public/v1/sandbox/documents/506/status",
            "pdf": "/api/public/v1/sandbox/documents/506/pdf",
            "xml": "/api/public/v1/sandbox/documents/506/xml",
            "retry": "/api/public/v1/sandbox/documents/506/retry"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "El estado Factly es approved; dgii.result distingue la aceptación condicional.",
      "nextAction": "Conservar y atender la observación DGII; no tratar como rechazo ni reenviar automáticamente.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "rfce-manual-review",
      "title": "RFCE: consulta alternativa devuelve No encontrado",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/504/status"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-rfce-manual-review"
        },
        "body": {
          "id": 504,
          "requestId": 504,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-504",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "reconciliation_required",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": true,
          "document": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E320009000504",
            "status": "reconciliation_required",
            "isFiscal": false,
            "qrUrl": "https://fc.dgii.gov.do/testecf/consultatimbrefc?rncemisor=999999999&encf=E320009000504&montototal=118.00&codigoseguridad=ABC123",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 504,
            "fechaVencimientoSecuencia": ""
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {
              "environment": "testecf",
              "codigo": "0",
              "estado": "No encontrado",
              "mensajes": [],
              "inquiry": {
                "source": "consultaestado",
                "primaryHttpStatus": 204,
                "httpStatus": 200
              }
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/504",
            "status": "/api/public/v1/sandbox/documents/504/status",
            "pdf": "/api/public/v1/sandbox/documents/504/pdf",
            "xml": "/api/public/v1/sandbox/documents/504/xml",
            "retry": "/api/public/v1/sandbox/documents/504/retry"
          },
          "recovery": {
            "attempts": 2,
            "confirmedResends": 2,
            "decision": "manual_review",
            "eligible": false,
            "checkedAt": "2026-12-02T13:05:00.000Z",
            "lastAttemptAt": "2026-12-02T13:03:00.000Z"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "Un 204 inicial no autoriza por sí solo el reenvío. La consulta alternativa informa ausencia; requiere confirmación del cliente.",
      "nextAction": "Confirmar el mismo RFCE con expectedEncf y el recovery.attempts recién leído; no crear otra operación.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "rfce-confirmed-resend",
      "title": "RFCE: reenvío confirmado y aceptación",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents/504/retry",
        "body": {
          "confirmResendSameSignedRfce": true,
          "expectedEncf": "E320009000504",
          "expectedRecoveryAttempts": 2
        }
      },
      "response": {
        "httpStatus": 202,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-rfce-confirmed-resend"
        },
        "body": {
          "id": 504,
          "requestId": 504,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-504",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "approved",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "December, 02 2026 09:05:08 -0400",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E320009000504",
            "status": "approved",
            "isFiscal": false,
            "qrUrl": "https://fc.dgii.gov.do/testecf/consultatimbrefc?rncemisor=999999999&encf=E320009000504&montototal=118.00&codigoseguridad=ABC123",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": true,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 504,
            "fechaVencimientoSecuencia": ""
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {
              "environment": "testecf",
              "codigo": "1",
              "estado": "Aceptado",
              "mensajes": [],
              "secuenciaUtilizada": true
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/504",
            "status": "/api/public/v1/sandbox/documents/504/status",
            "pdf": "/api/public/v1/sandbox/documents/504/pdf",
            "xml": "/api/public/v1/sandbox/documents/504/xml",
            "retry": "/api/public/v1/sandbox/documents/504/retry"
          },
          "recovery": {
            "attempts": 3,
            "confirmedResends": 3,
            "decision": "resubmitted_confirmed_xml",
            "eligible": false,
            "checkedAt": "2026-12-02T13:05:00.000Z",
            "lastAttemptAt": "2026-12-02T13:05:00.000Z"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "Se reenviaron los bytes firmados originales; requestId y e-NCF se conservan. No se reservó otra secuencia.",
      "nextAction": "Guardar resultado. Una vez approved no enviar de nuevo.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "rfce-confirmation-replayed",
      "title": "RFCE: misma confirmación ya consumida",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents/504/retry",
        "body": {
          "confirmResendSameSignedRfce": true,
          "expectedEncf": "E320009000504",
          "expectedRecoveryAttempts": 2
        }
      },
      "response": {
        "httpStatus": 202,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-rfce-confirmation-replayed"
        },
        "body": {
          "id": 504,
          "requestId": 504,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-504",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "approved",
          "replayed": true,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "December, 02 2026 09:05:08 -0400",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E320009000504",
            "status": "approved",
            "isFiscal": false,
            "qrUrl": "https://fc.dgii.gov.do/testecf/consultatimbrefc?rncemisor=999999999&encf=E320009000504&montototal=118.00&codigoseguridad=ABC123",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": true,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 504,
            "fechaVencimientoSecuencia": ""
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {
              "environment": "testecf",
              "codigo": "1",
              "estado": "Aceptado",
              "mensajes": [],
              "secuenciaUtilizada": true
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/504",
            "status": "/api/public/v1/sandbox/documents/504/status",
            "pdf": "/api/public/v1/sandbox/documents/504/pdf",
            "xml": "/api/public/v1/sandbox/documents/504/xml",
            "retry": "/api/public/v1/sandbox/documents/504/retry"
          },
          "recovery": {
            "attempts": 3,
            "confirmedResends": 3,
            "decision": "resubmitted_confirmed_xml",
            "eligible": false,
            "checkedAt": "2026-12-02T13:05:00.000Z",
            "lastAttemptAt": "2026-12-02T13:05:00.000Z"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "El contador 2 ya fue consumido; attempts sigue en 3 y replayed es true. No es un nuevo intento.",
      "nextAction": "Usar el resultado existente. Un intento posterior solo procede si sigue pendiente, tras nueva consulta y condiciones de recuperación.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "rfce-cooldown",
      "title": "RFCE: confirmación antes de cumplir la espera mínima",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents/504/retry",
        "body": {
          "confirmResendSameSignedRfce": true,
          "expectedEncf": "E320009000504",
          "expectedRecoveryAttempts": 2
        }
      },
      "response": {
        "httpStatus": 202,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-rfce-cooldown"
        },
        "body": {
          "id": 504,
          "requestId": 504,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-504",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "reconciliation_required",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": true,
          "document": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E320009000504",
            "status": "reconciliation_required",
            "isFiscal": false,
            "qrUrl": "https://fc.dgii.gov.do/testecf/consultatimbrefc?rncemisor=999999999&encf=E320009000504&montototal=118.00&codigoseguridad=ABC123",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 504,
            "fechaVencimientoSecuencia": ""
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {
              "environment": "testecf",
              "codigo": "0",
              "estado": "No encontrado",
              "mensajes": [],
              "inquiry": {
                "source": "consultaestado",
                "primaryHttpStatus": 204,
                "httpStatus": 200
              }
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/504",
            "status": "/api/public/v1/sandbox/documents/504/status",
            "pdf": "/api/public/v1/sandbox/documents/504/pdf",
            "xml": "/api/public/v1/sandbox/documents/504/xml",
            "retry": "/api/public/v1/sandbox/documents/504/retry"
          },
          "recovery": {
            "attempts": 2,
            "confirmedResends": 2,
            "decision": "manual_review",
            "eligible": false,
            "checkedAt": "2026-12-02T13:03:20.000Z",
            "lastAttemptAt": "2026-12-02T13:03:00.000Z"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "Con esta consulta alternativa decision permanece manual_review; no existe un estado público cooldown. attempts no aumenta.",
      "nextAction": "Esperar al menos 60 segundos desde lastAttemptAt y volver a consultar. Este cuerpo es una alternativa al caso de reenvío, no su continuación.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "rfce-retry-eligible",
      "title": "RFCE: consulta primaria permite recuperación",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/504/status"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-rfce-retry-eligible"
        },
        "body": {
          "id": 504,
          "requestId": 504,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-504",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "reconciliation_required",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": true,
          "reconciliationRequired": true,
          "document": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E320009000504",
            "status": "reconciliation_required",
            "isFiscal": false,
            "qrUrl": "https://fc.dgii.gov.do/testecf/consultatimbrefc?rncemisor=999999999&encf=E320009000504&montototal=118.00&codigoseguridad=ABC123",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 504,
            "fechaVencimientoSecuencia": ""
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-504",
            "documentType": "32",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "",
            "result": {
              "environment": "testecf",
              "codigo": "0",
              "estado": "No encontrado",
              "mensajes": [],
              "secuenciaUtilizada": false
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/504",
            "status": "/api/public/v1/sandbox/documents/504/status",
            "pdf": "/api/public/v1/sandbox/documents/504/pdf",
            "xml": "/api/public/v1/sandbox/documents/504/xml",
            "retry": "/api/public/v1/sandbox/documents/504/retry"
          },
          "recovery": {
            "attempts": 2,
            "confirmedResends": 2,
            "decision": "not_found",
            "eligible": true,
            "checkedAt": "2026-12-02T13:05:00.000Z",
            "lastAttemptAt": "2026-12-02T13:03:00.000Z"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "La evidencia de ausencia y las condiciones del servidor permiten recuperación ordinaria.",
      "nextAction": "POST al retry de esta misma operación; Factly vuelve a comprobar antes de enviar.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "production-reserved",
      "title": "Producción: estado reserved",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/production/documents/601"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-reserved"
        },
        "body": {
          "id": 601,
          "requestId": 601,
          "invoiceId": 0,
          "externalId": "ejemplo-production-601",
          "environment": "production",
          "effectiveDgiiEnvironment": "ecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.3-production-delivery",
          "requestFormat": "json",
          "status": "reserved",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000601",
            "status": "reserved",
            "isFiscal": false,
            "qrUrl": "",
            "securityCode": "",
            "signedAt": "",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": false,
            "xmlPreviewAvailable": false,
            "documentId": 701
          },
          "normalizedPayload": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "ecf",
            "trackId": "",
            "result": {},
            "submitted": false,
            "submissionAttempted": false
          },
          "links": {
            "self": "/api/public/v1/production/documents/601",
            "status": "/api/public/v1/production/documents/601/status",
            "pdf": "/api/public/v1/production/documents/601/pdf",
            "xml": "/api/public/v1/production/documents/601/xml"
          },
          "documentId": 701,
          "emissionEnabled": false
        }
      },
      "schema": "ProductionDocumentResponse",
      "meaning": "Muestra ficticia del contrato productivo; no habilita ni ejecuta producción.",
      "nextAction": "En approved usar artefactos. En reservado sin emisión solicitar revisión de activación. En incertidumbre conservar identidad y consultar; retry no garantiza retransmisión.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "production-preparing",
      "title": "Producción: estado preparing",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/production/documents/601"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-preparing"
        },
        "body": {
          "id": 601,
          "requestId": 601,
          "invoiceId": 0,
          "externalId": "ejemplo-production-601",
          "environment": "production",
          "effectiveDgiiEnvironment": "ecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.3-production-delivery",
          "requestFormat": "json",
          "status": "preparing",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000601",
            "status": "preparing",
            "isFiscal": false,
            "qrUrl": "",
            "securityCode": "",
            "signedAt": "",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": false,
            "xmlPreviewAvailable": false,
            "documentId": 701
          },
          "normalizedPayload": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "ecf",
            "trackId": "",
            "result": {},
            "submitted": false,
            "submissionAttempted": false
          },
          "links": {
            "self": "/api/public/v1/production/documents/601",
            "status": "/api/public/v1/production/documents/601/status",
            "pdf": "/api/public/v1/production/documents/601/pdf",
            "xml": "/api/public/v1/production/documents/601/xml"
          },
          "documentId": 701,
          "emissionEnabled": true
        }
      },
      "schema": "ProductionDocumentResponse",
      "meaning": "Muestra ficticia del contrato productivo; no habilita ni ejecuta producción.",
      "nextAction": "En approved usar artefactos. En reservado sin emisión solicitar revisión de activación. En incertidumbre conservar identidad y consultar; retry no garantiza retransmisión.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "production-signed",
      "title": "Producción: estado signed",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/production/documents/601"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-signed"
        },
        "body": {
          "id": 601,
          "requestId": 601,
          "invoiceId": 0,
          "externalId": "ejemplo-production-601",
          "environment": "production",
          "effectiveDgiiEnvironment": "ecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.3-production-delivery",
          "requestFormat": "json",
          "status": "signed",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": true,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000601",
            "status": "signed",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/ecf/consultatimbre?rncemisor=999999999&encf=E310009000601&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "documentId": 701
          },
          "normalizedPayload": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "ecf",
            "trackId": "",
            "result": {},
            "submitted": false,
            "submissionAttempted": false
          },
          "links": {
            "self": "/api/public/v1/production/documents/601",
            "status": "/api/public/v1/production/documents/601/status",
            "pdf": "/api/public/v1/production/documents/601/pdf",
            "xml": "/api/public/v1/production/documents/601/xml"
          },
          "documentId": 701,
          "emissionEnabled": true
        }
      },
      "schema": "ProductionDocumentResponse",
      "meaning": "Muestra ficticia del contrato productivo; no habilita ni ejecuta producción.",
      "nextAction": "En approved usar artefactos. En reservado sin emisión solicitar revisión de activación. En incertidumbre conservar identidad y consultar; retry no garantiza retransmisión.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "production-sent",
      "title": "Producción: estado sent",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/production/documents/601"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-sent"
        },
        "body": {
          "id": 601,
          "requestId": 601,
          "invoiceId": 0,
          "externalId": "ejemplo-production-601",
          "environment": "production",
          "effectiveDgiiEnvironment": "ecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.3-production-delivery",
          "requestFormat": "json",
          "status": "sent",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000601",
            "status": "sent",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/ecf/consultatimbre?rncemisor=999999999&encf=E310009000601&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "documentId": 701
          },
          "normalizedPayload": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "ecf",
            "trackId": "11111111-2222-4333-8444-555555555555",
            "result": {},
            "submitted": true,
            "submissionAttempted": true
          },
          "links": {
            "self": "/api/public/v1/production/documents/601",
            "status": "/api/public/v1/production/documents/601/status",
            "pdf": "/api/public/v1/production/documents/601/pdf",
            "xml": "/api/public/v1/production/documents/601/xml"
          },
          "documentId": 701,
          "emissionEnabled": true
        }
      },
      "schema": "ProductionDocumentResponse",
      "meaning": "Muestra ficticia del contrato productivo; no habilita ni ejecuta producción.",
      "nextAction": "En approved usar artefactos. En reservado sin emisión solicitar revisión de activación. En incertidumbre conservar identidad y consultar; retry no garantiza retransmisión.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "production-approved",
      "title": "Producción: estado approved",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/production/documents/601"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-approved"
        },
        "body": {
          "id": 601,
          "requestId": 601,
          "invoiceId": 0,
          "externalId": "ejemplo-production-601",
          "environment": "production",
          "effectiveDgiiEnvironment": "ecf",
          "simulated": false,
          "isFiscal": true,
          "contractVersion": "1.3-production-delivery",
          "requestFormat": "json",
          "status": "approved",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "December, 02 2026 09:00:30 -0400",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000601",
            "status": "approved",
            "isFiscal": true,
            "qrUrl": "https://ecf.dgii.gov.do/ecf/consultatimbre?rncemisor=999999999&encf=E310009000601&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": true,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "documentId": 701
          },
          "normalizedPayload": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "ecf",
            "trackId": "11111111-2222-4333-8444-555555555555",
            "result": {
              "environment": "ecf",
              "codigo": "1",
              "estado": "Aceptado",
              "mensajes": [],
              "secuenciaUtilizada": true
            },
            "submitted": true,
            "submissionAttempted": true
          },
          "links": {
            "self": "/api/public/v1/production/documents/601",
            "status": "/api/public/v1/production/documents/601/status",
            "pdf": "/api/public/v1/production/documents/601/pdf",
            "xml": "/api/public/v1/production/documents/601/xml"
          },
          "documentId": 701,
          "emissionEnabled": true
        }
      },
      "schema": "ProductionDocumentResponse",
      "meaning": "Muestra ficticia del contrato productivo; no habilita ni ejecuta producción.",
      "nextAction": "En approved usar artefactos. En reservado sin emisión solicitar revisión de activación. En incertidumbre conservar identidad y consultar; retry no garantiza retransmisión.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "production-reconciliation_required",
      "title": "Producción: estado reconciliation_required",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/production/documents/601"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-reconciliation_required"
        },
        "body": {
          "id": 601,
          "requestId": 601,
          "invoiceId": 0,
          "externalId": "ejemplo-production-601",
          "environment": "production",
          "effectiveDgiiEnvironment": "ecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.3-production-delivery",
          "requestFormat": "json",
          "status": "reconciliation_required",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": true,
          "document": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000601",
            "status": "reconciliation_required",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/ecf/consultatimbre?rncemisor=999999999&encf=E310009000601&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "documentId": 701
          },
          "normalizedPayload": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "ecf",
            "trackId": "",
            "result": {},
            "submitted": false,
            "submissionAttempted": true
          },
          "links": {
            "self": "/api/public/v1/production/documents/601",
            "status": "/api/public/v1/production/documents/601/status",
            "pdf": "/api/public/v1/production/documents/601/pdf",
            "xml": "/api/public/v1/production/documents/601/xml"
          },
          "documentId": 701,
          "emissionEnabled": true,
          "error": {
            "code": "API_PRODUCTION_SUBMISSION_UNCERTAIN",
            "message": "El envío perdió su resultado. Consulta el estado. No se reenviará el comprobante."
          }
        }
      },
      "schema": "ProductionDocumentResponse",
      "meaning": "Muestra ficticia del contrato productivo; no habilita ni ejecuta producción.",
      "nextAction": "En approved usar artefactos. En reservado sin emisión solicitar revisión de activación. En incertidumbre conservar identidad y consultar; retry no garantiza retransmisión.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "production-uncertain-retry",
      "title": "Producción incierta: retry puede limitarse a consultar",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/production/documents/601/retry"
      },
      "response": {
        "httpStatus": 202,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-uncertain-retry"
        },
        "body": {
          "id": 601,
          "requestId": 601,
          "invoiceId": 0,
          "externalId": "ejemplo-production-601",
          "environment": "production",
          "effectiveDgiiEnvironment": "ecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.3-production-delivery",
          "requestFormat": "json",
          "status": "reconciliation_required",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": true,
          "document": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000601",
            "status": "reconciliation_required",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/ecf/consultatimbre?rncemisor=999999999&encf=E310009000601&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "documentId": 701
          },
          "normalizedPayload": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "ecf",
            "trackId": "",
            "result": {},
            "submitted": false,
            "submissionAttempted": true
          },
          "links": {
            "self": "/api/public/v1/production/documents/601",
            "status": "/api/public/v1/production/documents/601/status",
            "pdf": "/api/public/v1/production/documents/601/pdf",
            "xml": "/api/public/v1/production/documents/601/xml"
          },
          "documentId": 701,
          "emissionEnabled": true,
          "error": {
            "code": "API_PRODUCTION_SUBMISSION_UNCERTAIN",
            "message": "El envío perdió su resultado. Consulta el estado. No se reenviará el comprobante."
          }
        }
      },
      "schema": "ProductionDocumentResponse",
      "meaning": "No está implementado un reenvío general de entregas inciertas productivas. HTTP 202 no confirma un nuevo envío.",
      "nextAction": "Conservar el e-NCF y solicitar conciliación si no se resuelve con consulta; no trasladar el cuerpo RFCE sandbox a producción.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "auth-missing",
      "title": "Falta la credencial",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 401,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-auth-missing"
        },
        "body": {
          "code": "API_AUTH_MISSING_TOKEN",
          "message": "API key requerida",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/middleware/ApiKeyMiddleware.cfc",
        "api/core/Response.cfc"
      ]
    },
    {
      "id": "auth-invalid",
      "title": "Credencial inválida",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 401,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-auth-invalid"
        },
        "body": {
          "code": "API_AUTH_INVALID_TOKEN",
          "message": "API key inválida",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "auth-inactive",
      "title": "Credencial inactiva",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 403,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-auth-inactive"
        },
        "body": {
          "code": "API_AUTH_INACTIVE_CREDENTIAL",
          "message": "La API key está inactiva",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "tenant-inactive",
      "title": "Empresa inactiva",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 403,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-tenant-inactive"
        },
        "body": {
          "code": "API_AUTH_INACTIVE_TENANT",
          "message": "La empresa está inactiva",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "environment-mismatch",
      "title": "Clave del ambiente equivocado",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/production/documents"
      },
      "response": {
        "httpStatus": 403,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-environment-mismatch"
        },
        "body": {
          "code": "API_ENVIRONMENT_MISMATCH",
          "message": "La credencial no corresponde al ambiente solicitado.",
          "details": {
            "credentialEnvironment": "sandbox",
            "requestedEnvironment": "production"
          }
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "module-disabled",
      "title": "Módulo API no disponible",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 403,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-module-disabled"
        },
        "body": {
          "code": "API_MODULE_DISABLED",
          "message": "El módulo API no está incluido para esta empresa",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "sandbox-disabled",
      "title": "Sandbox desactivado para la empresa",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 403,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-sandbox-disabled"
        },
        "body": {
          "code": "API_SANDBOX_DISABLED",
          "message": "El sandbox está desactivado para esta empresa.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "json-disabled",
      "title": "Formato JSON no habilitado",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 403,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-json-disabled"
        },
        "body": {
          "code": "API_JSON_DISABLED",
          "message": "El formato JSON no está habilitado para esta empresa.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "subscription-suspended",
      "title": "Suscripción suspendida",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 403,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-subscription-suspended"
        },
        "body": {
          "code": "SUBSCRIPTION_SUSPENDED",
          "message": "Cuenta suspendida por pagos vencidos. La API queda bloqueada hasta regularizar.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/public/index.cfm"
      ]
    },
    {
      "id": "subscription-past-due",
      "title": "Suscripción en mora: escritura bloqueada",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 403,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-subscription-past-due"
        },
        "body": {
          "code": "SUBSCRIPTION_PAST_DUE",
          "message": "Suscripcion en mora. La API queda en solo lectura hasta regularizar.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/public/index.cfm"
      ]
    },
    {
      "id": "invalid-json",
      "title": "Cuerpo JSON malformado",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 400,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-invalid-json"
        },
        "body": {
          "code": "API_INVALID_JSON",
          "message": "JSON inválido.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "idempotency-missing",
      "title": "Falta Idempotency-Key",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 400,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-idempotency-missing"
        },
        "body": {
          "code": "API_IDEMPOTENCY_REQUIRED",
          "message": "Idempotency-Key debe contener entre 1 y 191 caracteres.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "payload-too-large",
      "title": "Cuerpo superior al máximo",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 413,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-payload-too-large"
        },
        "body": {
          "code": "API_PAYLOAD_TOO_LARGE",
          "message": "El cuerpo JSON supera 1 MB.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "validation-field",
      "title": "Fecha de emisión inválida",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 422,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-validation-field"
        },
        "body": {
          "code": "API_DOCUMENT_VALIDATION_ERROR",
          "message": "issueDate debe ser una fecha real YYYY-MM-DD.",
          "details": {
            "field": "issueDate"
          }
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/modules/factly_api/services/FactlyApiDocumentRules.cfc"
      ]
    },
    {
      "id": "external-expiration-required",
      "title": "E31 externo sin vencimiento de secuencia",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 422,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-external-expiration-required"
        },
        "body": {
          "code": "API_EXTERNAL_EXPIRATION_REQUIRED",
          "message": "Envía sequenceExpirationDate para este tipo con numeración externa.",
          "details": {
            "field": "sequenceExpirationDate"
          }
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/modules/factly_api/services/FactlyApiDocumentRules.cfc"
      ]
    },
    {
      "id": "idempotency-conflict",
      "title": "Misma clave con contenido distinto",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 409,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-idempotency-conflict"
        },
        "body": {
          "code": "API_IDEMPOTENCY_CONFLICT",
          "message": "La misma Idempotency-Key ya tiene otro contenido. Conserva la clave solamente para repetir la misma operación.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Recuperar el cuerpo y la clave originales. No variar valores para forzar un reintento.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "external-id-exists",
      "title": "Referencia de negocio ya registrada",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 409,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-external-id-exists"
        },
        "body": {
          "code": "API_EXTERNAL_ID_EXISTS",
          "message": "Ya existe un documento con ese externalId en sandbox.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Recuperar el requestId guardado por el integrador o repetir el POST con su clave original; no crear otra factura para el mismo pedido.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "sandbox-not-configured",
      "title": "Perfil sandbox sin preparar",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 503,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-sandbox-not-configured"
        },
        "body": {
          "code": "API_SANDBOX_NOT_CONFIGURED",
          "message": "Falta la configuración exclusiva del sandbox API testecf.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Solicitar a Factly revisión de la configuración de la empresa; no cambiar a producción para sortear el error.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "production-creation-disabled",
      "title": "Creación productiva deshabilitada",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/production/documents"
      },
      "response": {
        "httpStatus": 403,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-creation-disabled"
        },
        "body": {
          "code": "API_PRODUCTION_CREATION_DISABLED",
          "message": "La creación del API productivo está deshabilitada para esta empresa. No se reservó ningún número.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionUsageService.cfc"
      ]
    },
    {
      "id": "production-emission-disabled",
      "title": "Envío productivo deshabilitado",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/production/documents/601/retry"
      },
      "response": {
        "httpStatus": 409,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-emission-disabled"
        },
        "body": {
          "code": "API_PRODUCTION_EMISSION_DISABLED",
          "message": "El envío del API productivo está deshabilitado para esta empresa.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionService.cfc"
      ]
    },
    {
      "id": "quota-exceeded",
      "title": "Cuota comercial agotada",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/production/documents"
      },
      "response": {
        "httpStatus": 403,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-quota-exceeded"
        },
        "body": {
          "code": "ECF_MONTHLY_LIMIT_REACHED",
          "message": "Se agotó la capacidad de comprobantes contratada.",
          "details": {
            "cycleStart": "2026-12-01",
            "cycleEnd": "2026-12-31",
            "planLimit": 100,
            "packageLimit": 0,
            "approvedCount": 95,
            "reservedCount": 5,
            "usedCount": 100,
            "planRemaining": 0,
            "remaining": 0,
            "totalLimit": 100
          }
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Consultar usage y ampliar plan o adquirir capacidad adicional; no rotar claves ni reiniciar contadores.",
      "source": [
        "api/core/EcfCapacityPolicy.cfc"
      ]
    },
    {
      "id": "query-limit",
      "title": "Límite técnico de consultas alcanzado",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/501/status"
      },
      "response": {
        "httpStatus": 429,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-query-limit",
          "X-RateLimit-Limit": "60",
          "X-RateLimit-Remaining": "0",
          "X-RateLimit-Reset": "30",
          "Retry-After": "30",
          "Cache-Control": "no-store"
        },
        "body": {
          "code": "API_QUERY_LIMIT_EXCEEDED",
          "message": "Límite de consultas API alcanzado para esta empresa y ambiente. Respeta Retry-After.",
          "details": {
            "scope": "company_environment",
            "retryAfterSeconds": 30
          }
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Esperar Retry-After segundos. Las claves de la misma empresa y ambiente comparten la ventana.",
      "source": [
        "api/modules/factly_api/services/FactlyApiQueryLimitService.cfc",
        "api/core/Response.cfc"
      ]
    },
    {
      "id": "document-not-found",
      "title": "Operación ausente en el ámbito autenticado",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/9999"
      },
      "response": {
        "httpStatus": 404,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-document-not-found"
        },
        "body": {
          "code": "API_DOCUMENT_NOT_FOUND",
          "message": "Documento API no encontrado.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Revisar requestId, empresa y ambiente de la credencial; el API no expone operaciones de otras empresas.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "batch-missing",
      "title": "No hay lote de prueba disponible",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 409,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-batch-missing"
        },
        "body": {
          "code": "API_BATCH_MISSING",
          "message": "La empresa no tiene un lote testecf para este tipo. Configura el lote en Factly.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "En modo automático, solicitar/cargar el lote de pruebas correspondiente. Nunca utilizar una secuencia productiva para resolverlo.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "pdf-unavailable",
      "title": "PDF todavía no disponible",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/504/pdf"
      },
      "response": {
        "httpStatus": 409,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-pdf-unavailable"
        },
        "body": {
          "code": "API_DOCUMENT_PDF_UNAVAILABLE",
          "message": "El PDF de pruebas estará disponible tras la aceptación testecf y la generación de sus datos firmados.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Consultar estado; descargar cuando document.pdfFinalAvailable sea true.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "xml-unavailable",
      "title": "XML firmado todavía no disponible",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/503/xml"
      },
      "response": {
        "httpStatus": 409,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-xml-unavailable"
        },
        "body": {
          "code": "API_DOCUMENT_XML_UNAVAILABLE",
          "message": "El XML firmado testecf todavía no está disponible.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Consultar estado; descargar cuando document.xmlAvailable sea true.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "retry-terminal",
      "title": "Retry ordinario sobre documento definitivo",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents/501/retry"
      },
      "response": {
        "httpStatus": 409,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-retry-terminal"
        },
        "body": {
          "code": "API_DOCUMENT_RETRY_NOT_AVAILABLE",
          "message": "El documento tiene un resultado definitivo; no se reenviará ni renumerará.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Usar el resultado aprobado o atender el rechazo. No reintentar una emisión definitiva.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "recovery-confirmation-invalid",
      "title": "Confirmación RFCE inválida",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents/504/retry"
      },
      "response": {
        "httpStatus": 400,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-recovery-confirmation-invalid"
        },
        "body": {
          "code": "API_SANDBOX_RECOVERY_CONFIRMATION_INVALID",
          "message": "Confirma el reenvío del mismo RFCE firmado e indica su e-NCF exacto.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "recovery-counter-future",
      "title": "Contador de reintento futuro",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents/504/retry"
      },
      "response": {
        "httpStatus": 409,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-recovery-counter-future"
        },
        "body": {
          "code": "API_SANDBOX_RECOVERY_ATTEMPT_MISMATCH",
          "message": "El contador no corresponde a la operación. Consulta su estado antes de confirmar otro intento.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "GET status, copiar recovery.attempts actual y confirmar solo si la operación sigue siendo recuperable.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "xml-input-unsupported",
      "title": "Importación de XML no disponible",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents/xml"
      },
      "response": {
        "httpStatus": 409,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-xml-input-unsupported"
        },
        "body": {
          "code": "API_XML_NOT_SUPPORTED",
          "message": "El API admite creación JSON E31/E32. La importación XML queda pendiente de un contrato de validación; no se simulará una aprobación.",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Usar creación JSON según catálogo. El texto del error conserva una referencia histórica a E31/E32; no define por sí solo el catálogo actual.",
      "source": [
        "api/core/Response.cfc",
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "route-not-found",
      "title": "Ruta inexistente",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/recurso-inexistente"
      },
      "response": {
        "httpStatus": 404,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-route-not-found"
        },
        "body": {
          "code": "NOT_FOUND",
          "message": "Ruta no encontrada",
          "details": {}
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Corregir la causa indicada y conservar la identidad de cualquier operación ya creada.",
      "source": [
        "api/public/index.cfm"
      ]
    },
    {
      "id": "internal-error",
      "title": "Error inesperado de Factly",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 500,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-internal-error"
        },
        "body": {
          "code": "INTERNAL_ERROR",
          "message": "Error interno",
          "details": {
            "requestId": "ficticio-internal-error",
            "action": "factly_api.documents.create_json",
            "exceptionType": "application",
            "hint": "",
            "errorId": "00000000-0000-4000-8000-000000000001"
          }
        }
      },
      "schema": "ErrorResponse",
      "meaning": "La solicitud devuelve un error HTTP de Factly; no es un estado de aprobación o rechazo DGII.",
      "nextAction": "Conservar el X-Request-Id/errorId y la solicitud original. Si no se recibió requestId de operación, repetir con idéntica Idempotency-Key y cuerpo; no asumir que nada se guardó.",
      "source": [
        "api/public/index.cfm",
        "api/core/Response.cfc"
      ]
    },
    {
      "id": "catalog",
      "title": "Catálogo con diez tipos habilitados",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/catalogs/document-types"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-catalog"
        },
        "body": {
          "data": [
            {
              "code": "31",
              "label": "Factura de Crédito Fiscal Electrónica",
              "environment": "sandbox",
              "effectiveDgiiEnvironment": "testecf"
            },
            {
              "code": "32",
              "label": "Factura de Consumo Electrónica",
              "environment": "sandbox",
              "effectiveDgiiEnvironment": "testecf"
            },
            {
              "code": "33",
              "label": "Nota de Débito Electrónica",
              "environment": "sandbox",
              "effectiveDgiiEnvironment": "testecf"
            },
            {
              "code": "34",
              "label": "Nota de Crédito Electrónica",
              "environment": "sandbox",
              "effectiveDgiiEnvironment": "testecf"
            },
            {
              "code": "41",
              "label": "Comprobante de Compras Electrónico",
              "environment": "sandbox",
              "effectiveDgiiEnvironment": "testecf"
            },
            {
              "code": "43",
              "label": "Comprobante para Gastos Menores Electrónico",
              "environment": "sandbox",
              "effectiveDgiiEnvironment": "testecf"
            },
            {
              "code": "44",
              "label": "Comprobante para Regímenes Especiales Electrónico",
              "environment": "sandbox",
              "effectiveDgiiEnvironment": "testecf"
            },
            {
              "code": "45",
              "label": "Comprobante Gubernamental Electrónico",
              "environment": "sandbox",
              "effectiveDgiiEnvironment": "testecf"
            },
            {
              "code": "46",
              "label": "Comprobante para Exportaciones Electrónico",
              "environment": "sandbox",
              "effectiveDgiiEnvironment": "testecf"
            },
            {
              "code": "47",
              "label": "Comprobante para Pagos al Exterior Electrónico",
              "environment": "sandbox",
              "effectiveDgiiEnvironment": "testecf"
            }
          ]
        }
      },
      "schema": "DocumentTypesResponse",
      "meaning": "Los códigos corresponden al ambiente de la clave; la lista puede ser un subconjunto según configuración.",
      "nextAction": "Usar solo tipos disponibles y su contrato particular; estar en el catálogo no sustituye datos, certificado o secuencias.",
      "source": [
        "api/modules/factly_api/services/FactlyApiPublicSandboxService.cfc"
      ]
    },
    {
      "id": "usage-sandbox",
      "title": "Consumo sandbox no facturable",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/usage"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-usage-sandbox"
        },
        "body": {
          "environment": "sandbox",
          "cycleStart": "2026-12-01",
          "cycleEnd": "2026-12-31",
          "cycleTimezone": "America/Santo_Domingo",
          "documentsIncluded": 0,
          "documentsUsed": 0,
          "documentsOverage": 0,
          "amountEstimated": 0,
          "amountEstimatedExact": "0.00",
          "billingStrategy": "none",
          "overagePolicy": "none",
          "quotaScope": "api_only",
          "accountingBasis": "non_billable_sandbox",
          "reconciliationRequired": false
        }
      },
      "schema": "UsageResponse",
      "meaning": "Los contadores comerciales sandbox están en cero aunque existan operaciones de prueba.",
      "nextAction": "No usar usage como lista o contador de facturas de sandbox.",
      "source": [
        "api/modules/factly_api/services/FactlyApiService.cfc"
      ]
    },
    {
      "id": "usage-production",
      "title": "Capacidad compartida web/API",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/production/usage"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-usage-production"
        },
        "body": {
          "environment": "production",
          "cycleStart": "2026-12-01",
          "cycleEnd": "2026-12-31",
          "cycleTimezone": "America/Santo_Domingo",
          "documentsIncluded": 100,
          "documentsUsed": 80,
          "documentsOverage": 0,
          "amountEstimated": 0,
          "amountEstimatedExact": "0.00",
          "billingStrategy": "shared_subscription",
          "overagePolicy": "shared_packages",
          "quotaScope": "shared_web_api",
          "accountingBasis": "shared_web_api",
          "reconciliationRequired": false,
          "isUnlimited": false,
          "approvedCount": 75,
          "reservedCount": 5,
          "packageRemaining": 10,
          "documentsRemaining": 30
        }
      },
      "schema": "UsageResponse",
      "meaning": "Aprobados y pendientes de ambos canales consumen el mismo plan y paquetes.",
      "nextAction": "Leer isUnlimited y documentsRemaining para conocer disponibilidad; conservar la identidad de cada operación al reintentar.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionUsageService.cfc"
      ]
    },
    {
      "id": "download-xml",
      "title": "Descarga de XML",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/501/xml"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/xml; charset=utf-8",
          "Content-Disposition": "inline; filename=\"TESTECF-E310009000501.xml\""
        },
        "bodyDescription": "Contenido real omitido: esta colección no incluye un XML firmado ni un PDF fiscal ficticio."
      },
      "schema": null,
      "meaning": "El cuerpo no es JSON: contiene el XML firmado.",
      "nextAction": "Guardar el archivo en Postman con Save response; en el sistema consumir texto XML o bytes PDF según Content-Type.",
      "source": [
        "api/modules/factly_api/controllers/FactlyApiController.cfc",
        "api/modules/factly_api/templates/sandbox_pdf.cfm"
      ]
    },
    {
      "id": "download-pdf",
      "title": "Descarga de PDF",
      "request": {
        "method": "GET",
        "path": "/api/public/v1/sandbox/documents/501/pdf"
      },
      "response": {
        "httpStatus": 200,
        "headers": {
          "Content-Type": "application/pdf",
          "Content-Disposition": "attachment; filename=\"TESTECF-E310009000501.pdf\""
        },
        "bodyDescription": "Contenido real omitido: esta colección no incluye un XML firmado ni un PDF fiscal ficticio."
      },
      "schema": null,
      "meaning": "El cuerpo no es JSON: contiene el archivo PDF.",
      "nextAction": "Guardar el archivo en Postman con Save response; en el sistema consumir texto XML o bytes PDF según Content-Type.",
      "source": [
        "api/modules/factly_api/controllers/FactlyApiController.cfc",
        "api/modules/factly_api/templates/sandbox_pdf.cfm"
      ]
    },
    {
      "id": "write-rate-limit",
      "title": "Límite global de escrituras por IP",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents"
      },
      "response": {
        "httpStatus": 429,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-write-rate-limit",
          "X-RateLimit-Limit": "240",
          "X-RateLimit-Remaining": "0",
          "X-RateLimit-Reset": "30"
        },
        "body": {
          "code": "RATE_LIMIT_EXCEEDED",
          "message": "Demasiadas solicitudes, intenta nuevamente en unos segundos",
          "details": {
            "scope": "write",
            "resetSeconds": 30
          }
        }
      },
      "schema": "ErrorResponse",
      "meaning": "El límite global de escrituras puede detener el POST antes de autenticar. 240 es el fallback de configuración, no un contrato fijo. Este camino no añade Retry-After.",
      "nextAction": "Esperar details.resetSeconds o X-RateLimit-Reset, conservar Idempotency-Key y cuerpo. Revisar concurrencia de solicitudes desde esa IP.",
      "source": [
        "api/public/index.cfm",
        "api/core/Response.cfc"
      ]
    },
    {
      "id": "production-confirmed-resend",
      "title": "Producción: reenvío confirmado conserva el e-NCF tras otro fallo temporal",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/production/documents/601/retry",
        "body": {
          "confirmResendSameSignedDocument": true,
          "expectedEncf": "E310009000601",
          "expectedRecoveryAttempts": 2
        }
      },
      "response": {
        "httpStatus": 202,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-confirmed-resend"
        },
        "body": {
          "id": 601,
          "requestId": 601,
          "invoiceId": 0,
          "externalId": "ejemplo-production-601",
          "environment": "production",
          "effectiveDgiiEnvironment": "ecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.3-production-delivery",
          "requestFormat": "json",
          "status": "reconciliation_required",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": true,
          "document": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000601",
            "status": "reconciliation_required",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/ecf/consultatimbre?rncemisor=999999999&encf=E310009000601&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "documentId": 701
          },
          "normalizedPayload": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "ecf",
            "trackId": "",
            "result": {},
            "submitted": false,
            "submissionAttempted": true
          },
          "links": {
            "self": "/api/public/v1/production/documents/601",
            "status": "/api/public/v1/production/documents/601/status",
            "pdf": "/api/public/v1/production/documents/601/pdf",
            "xml": "/api/public/v1/production/documents/601/xml",
            "retry": "/api/public/v1/production/documents/601/retry"
          },
          "documentId": 701,
          "emissionEnabled": true,
          "error": {
            "code": "API_PRODUCTION_SUBMISSION_UNCERTAIN",
            "message": "El envío perdió su resultado. Consulta el estado. No se reenviará el comprobante."
          },
          "recovery": {
            "attempts": 3,
            "confirmedResends": 3,
            "eligible": false,
            "confirmedResendAllowed": false,
            "decision": "resubmitted_confirmed_xml",
            "lastAttemptAt": "2026-12-02T14:00:00.000Z",
            "checkedAt": "2026-12-02T14:00:00.000Z",
            "nextAttemptAt": "2026-12-02T14:01:00.000Z"
          }
        }
      },
      "schema": "ProductionDocumentResponse",
      "meaning": "Un nuevo intento confirmado usa los mismos archivos, pero vuelve a perder la respuesta. El HTTP202 no significa aprobación.",
      "nextAction": "Conservar operación y contador; consultar con espera antes de confirmar otro intento.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "production-confirmation-replayed",
      "title": "Producción: repetición de confirmación ya consumida",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/production/documents/601/retry",
        "body": {
          "confirmResendSameSignedDocument": true,
          "expectedEncf": "E310009000601",
          "expectedRecoveryAttempts": 2
        }
      },
      "response": {
        "httpStatus": 202,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-production-confirmation-replayed"
        },
        "body": {
          "id": 601,
          "requestId": 601,
          "invoiceId": 0,
          "externalId": "ejemplo-production-601",
          "environment": "production",
          "effectiveDgiiEnvironment": "ecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.3-production-delivery",
          "requestFormat": "json",
          "status": "reconciliation_required",
          "replayed": true,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "",
          "retryAllowed": false,
          "reconciliationRequired": true,
          "document": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000601",
            "status": "reconciliation_required",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/ecf/consultatimbre?rncemisor=999999999&encf=E310009000601&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": false,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "documentId": 701
          },
          "normalizedPayload": {
            "externalId": "ejemplo-production-601",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "ecf",
            "trackId": "",
            "result": {},
            "submitted": false,
            "submissionAttempted": true
          },
          "links": {
            "self": "/api/public/v1/production/documents/601",
            "status": "/api/public/v1/production/documents/601/status",
            "pdf": "/api/public/v1/production/documents/601/pdf",
            "xml": "/api/public/v1/production/documents/601/xml",
            "retry": "/api/public/v1/production/documents/601/retry"
          },
          "documentId": 701,
          "emissionEnabled": true,
          "error": {
            "code": "API_PRODUCTION_SUBMISSION_UNCERTAIN",
            "message": "El envío perdió su resultado. Consulta el estado. No se reenviará el comprobante."
          },
          "recovery": {
            "attempts": 3,
            "confirmedResends": 3,
            "eligible": false,
            "confirmedResendAllowed": false,
            "decision": "resubmitted_confirmed_xml",
            "lastAttemptAt": "2026-12-02T14:00:00.000Z",
            "checkedAt": "2026-12-02T14:00:00.000Z",
            "nextAttemptAt": "2026-12-02T14:01:00.000Z"
          }
        }
      },
      "schema": "ProductionDocumentResponse",
      "meaning": "El contador 2 ya fue consumido; esta llamada devuelve el resultado sin otro envío.",
      "nextAction": "Conservar operación y contador; consultar con espera antes de confirmar otro intento.",
      "source": [
        "api/modules/factly_api/services/FactlyApiProductionService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    },
    {
      "id": "sandbox-e31-confirmed-resend",
      "title": "E31 sandbox: recuperación confirmada aprobada",
      "request": {
        "method": "POST",
        "path": "/api/public/v1/sandbox/documents/501/retry",
        "body": {
          "confirmResendSameSignedDocument": true,
          "expectedEncf": "E310009000501",
          "expectedRecoveryAttempts": 0
        }
      },
      "response": {
        "httpStatus": 202,
        "headers": {
          "Content-Type": "application/json; charset=utf-8",
          "X-Request-Id": "ficticio-sandbox-e31-confirmed-resend"
        },
        "body": {
          "id": 501,
          "requestId": 501,
          "invoiceId": 0,
          "externalId": "ejemplo-sandbox-501",
          "environment": "sandbox",
          "effectiveDgiiEnvironment": "testecf",
          "simulated": false,
          "isFiscal": false,
          "contractVersion": "1.1-testecf",
          "requestFormat": "json",
          "status": "approved",
          "replayed": false,
          "receivedAt": "December, 02 2026 09:00:00 -0400",
          "completedAt": "December, 02 2026 09:00:30 -0400",
          "retryAllowed": false,
          "reconciliationRequired": false,
          "document": {
            "externalId": "ejemplo-sandbox-501",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43",
                "lineNumber": 1,
                "subtotal": 100,
                "taxAmount": 18,
                "lineTotal": 118
              }
            ],
            "issuer": {
              "rnc": "999999999",
              "legalName": "Empresa de Ejemplo SRL",
              "tradeName": "Ejemplo",
              "address": "Dirección ficticia 123",
              "email": "facturacion@example.invalid"
            },
            "subtotal": 100,
            "taxTotal": 18,
            "discountTotal": 0,
            "total": 118,
            "sequenceExpirationDate": "2028-12-31",
            "invoiceId": 0,
            "encf": "E310009000501",
            "status": "approved",
            "isFiscal": false,
            "qrUrl": "https://ecf.dgii.gov.do/testecf/consultatimbre?rncemisor=999999999&encf=E310009000501&montototal=118.00&codigoseguridad=ABC123&rnccomprador=999999998&fechaemision=02-12-2026&fechafirma=02-12-2026+09%3A00%3A04",
            "securityCode": "ABC123",
            "signedAt": "02-12-2026 09:00:04",
            "numberingMode": "automatic",
            "pdfFinalAvailable": true,
            "xmlAvailable": true,
            "xmlPreviewAvailable": false,
            "simulated": false,
            "effectiveDgiiEnvironment": "testecf",
            "environment": "testecf",
            "tenantId": 9001,
            "requestId": 501,
            "fechaVencimientoSecuencia": "2028-12-31"
          },
          "normalizedPayload": {
            "externalId": "ejemplo-sandbox-501",
            "documentType": "31",
            "issueDate": "2026-12-02",
            "currency": "DOP",
            "billingType": "CONTADO",
            "creditDays": 0,
            "language": "ES",
            "notes": "",
            "customer": {
              "name": "Cliente de ejemplo",
              "document": "999999998",
              "documentType": "rnc",
              "email": "",
              "address": ""
            },
            "lines": [
              {
                "description": "Servicio de ejemplo",
                "qty": 1,
                "unitPrice": 100,
                "taxRate": 18,
                "discountAmount": 0,
                "unidadMedida": "43"
              }
            ]
          },
          "dgii": {
            "environment": "testecf",
            "trackId": "11111111-2222-4333-8444-555555555555",
            "result": {
              "environment": "testecf",
              "codigo": "1",
              "estado": "Aceptado",
              "mensajes": [],
              "secuenciaUtilizada": true
            }
          },
          "links": {
            "self": "/api/public/v1/sandbox/documents/501",
            "status": "/api/public/v1/sandbox/documents/501/status",
            "pdf": "/api/public/v1/sandbox/documents/501/pdf",
            "xml": "/api/public/v1/sandbox/documents/501/xml",
            "retry": "/api/public/v1/sandbox/documents/501/retry"
          },
          "recovery": {
            "attempts": 1,
            "confirmedResends": 1,
            "eligible": false,
            "confirmedResendAllowed": false,
            "decision": "resubmitted_confirmed_xml",
            "lastAttemptAt": "2026-12-02T14:00:00.000Z",
            "checkedAt": "2026-12-02T14:00:00.000Z",
            "nextAttemptAt": "2026-12-02T14:01:00.000Z"
          }
        }
      },
      "schema": "DocumentResponse",
      "meaning": "La recuperación general también aplica a E31 sandbox; conserva el mismo XML y su número.",
      "nextAction": "Detener reenvíos y usar PDF/XML/QR disponibles.",
      "source": [
        "api/modules/factly_api/services/FactlyApiSandboxService.cfc",
        "api/modules/factly_api/controllers/FactlyApiController.cfc"
      ]
    }
  ]
}
