{
  "openapi": "3.1.0",
  "info": {
    "title": "emite.do API",
    "description": "API pública para emitir, consultar y operar e-CF ante la DGII. Autenticación por header X-API-Key. El POST /api/v1/ecf no promete el estado fiscal final: consulta o webhook.",
    "version": "1.0.0"
  },
  "paths": {
    "/api/v1/public/register": {
      "post": {
        "tags": [
          "public"
        ],
        "summary": "Public Signup",
        "description": "Registro público desde el sitio web.\n\nCrea empresa, certificado (si viene P12) y API key.\nLuego notifica al Portal Odoo (fire-and-forget).",
        "operationId": "public_signup_api_v1_public_register_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicSignupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSignupResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/client/company": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "Get Company Profile",
        "operationId": "get_company_profile_api_v1_client_company_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientCompanyResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "client"
        ],
        "summary": "Update Company Profile",
        "operationId": "update_company_profile_api_v1_client_company_patch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientCompanyUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientCompanyResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/sequences": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "List Sequences",
        "operationId": "list_sequences_api_v1_client_sequences_get",
        "parameters": [
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Environment"
            }
          },
          {
            "name": "ecf_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 2
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ecf Type"
            }
          },
          {
            "name": "active_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true,
              "title": "Active Only"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSequenceListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/certificates": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "List Certificates",
        "operationId": "list_certificates_api_v1_client_certificates_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClientCertificateResponse"
                  },
                  "title": "Response List Certificates Api V1 Client Certificates Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "client"
        ],
        "summary": "Upload Certificate",
        "operationId": "upload_certificate_api_v1_client_certificates_post",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_certificate_api_v1_client_certificates_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientCertificateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/summary": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "Get Client Summary",
        "operationId": "get_client_summary_api_v1_client_summary_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSummaryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/audit-export": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "Download Audit Export",
        "description": "ZIP de evidencia fiscal: XML, RFCE, RI, respuesta DGII y ficha X.509. Sin P12/PIN.",
        "operationId": "download_audit_export_api_v1_client_audit_export_get",
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date From"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date To"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/inbox": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "List Inbox",
        "description": "e-CF recibidos por /fe/recepcion para que Odoo cree facturas de compra.",
        "operationId": "list_inbox_api_v1_client_inbox_get",
        "parameters": [
          {
            "name": "acked",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": false,
              "title": "Acked"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientInboxListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/inbox/{public_id}/ack": {
      "post": {
        "tags": [
          "client"
        ],
        "summary": "Ack Inbox Item",
        "operationId": "ack_inbox_item_api_v1_client_inbox__public_id__ack_post",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientInboxAckResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/inbox/{public_id}/xml": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "Download Inbox Xml",
        "operationId": "download_inbox_xml_api_v1_client_inbox__public_id__xml_get",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/inbox/{public_id}/arecf": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "Download Inbox Arecf",
        "operationId": "download_inbox_arecf_api_v1_client_inbox__public_id__arecf_get",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/documents": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "List Documents",
        "operationId": "list_documents_api_v1_client_documents_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "ecf_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 2
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ecf Type"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Environment"
            }
          },
          {
            "name": "encf",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Encf"
            }
          },
          {
            "name": "external_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "External Id"
            }
          },
          {
            "name": "track_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Track Id"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date From"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date To"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientDocumentListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/documents/{public_id}": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "Get Document",
        "operationId": "get_document_api_v1_client_documents__public_id__get",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientDocumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/documents/{public_id}/artifacts": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "Get Document Artifacts",
        "operationId": "get_document_artifacts_api_v1_client_documents__public_id__artifacts_get",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientArtifactSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/documents/{public_id}/artifacts/{artifact_type}": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "Download Document Artifact",
        "operationId": "download_document_artifact_api_v1_client_documents__public_id__artifacts__artifact_type__get",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          },
          {
            "name": "artifact_type",
            "in": "path",
            "required": true,
            "schema": {
              "enum": [
                "generated-xml",
                "signed-xml",
                "rfce",
                "ri",
                "dgii-response"
              ],
              "type": "string",
              "title": "Artifact Type"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Regenerar la RI antes de descargar",
              "default": false,
              "title": "Refresh"
            },
            "description": "Regenerar la RI antes de descargar"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/webhooks": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "List Webhooks",
        "operationId": "list_webhooks_api_v1_client_webhooks_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClientWebhookResponse"
                  },
                  "title": "Response List Webhooks Api V1 Client Webhooks Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "client"
        ],
        "summary": "Create Webhook",
        "operationId": "create_webhook_api_v1_client_webhooks_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientWebhookCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientWebhookCreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/webhooks/{public_id}": {
      "patch": {
        "tags": [
          "client"
        ],
        "summary": "Update Webhook",
        "operationId": "update_webhook_api_v1_client_webhooks__public_id__patch",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientWebhookUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientWebhookResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "client"
        ],
        "summary": "Disable Webhook",
        "operationId": "disable_webhook_api_v1_client_webhooks__public_id__delete",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/webhooks/{public_id}/rotate-secret": {
      "post": {
        "tags": [
          "client"
        ],
        "summary": "Rotate Webhook Secret",
        "operationId": "rotate_webhook_secret_api_v1_client_webhooks__public_id__rotate_secret_post",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientWebhookRotateSecretRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientWebhookRotateSecretResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/webhooks/{public_id}/test": {
      "post": {
        "tags": [
          "client"
        ],
        "summary": "Test Webhook",
        "description": "Dry-run: POST JSON plano firmado al endpoint (mismo contrato que notify_webhook).",
        "operationId": "test_webhook_api_v1_client_webhooks__public_id__test_post",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientWebhookTestResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/client/webhooks/{public_id}/deliveries": {
      "get": {
        "tags": [
          "client"
        ],
        "summary": "List Webhook Deliveries",
        "operationId": "list_webhook_deliveries_api_v1_client_webhooks__public_id__deliveries_get",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientWebhookDeliveryListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/ecf": {
      "post": {
        "tags": [
          "ECF Documents"
        ],
        "summary": "Submit Ecf",
        "operationId": "submit_ecf_api_v1_ecf_post",
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(online|deferred)$",
              "default": "online",
              "title": "Mode"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcfSubmitRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDocumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "200": {
            "description": "Replay de la misma idempotency_key. Mismo cuerpo que 201.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDocumentResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "tags": [
          "ECF Documents"
        ],
        "summary": "List Ecf",
        "operationId": "list_ecf_api_v1_ecf_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/ecf/states": {
      "get": {
        "tags": [
          "ECF Documents"
        ],
        "summary": "Get Ecf State Contract",
        "operationId": "get_ecf_state_contract_api_v1_ecf_states_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfStateContractResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/ecf/status-public/{external_id}": {
      "get": {
        "tags": [
          "ECF Documents"
        ],
        "summary": "Get Ecf Status Public",
        "description": "Consulta de estado pública (sin API key) por ID externo y RNC de la empresa.",
        "operationId": "get_ecf_status_public_api_v1_ecf_status_public__external_id__get",
        "parameters": [
          {
            "name": "external_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "External Id"
            }
          },
          {
            "name": "company_rnc",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 9,
              "maxLength": 11,
              "title": "Company Rnc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDocumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/ecf/{public_id}": {
      "get": {
        "tags": [
          "ECF Documents"
        ],
        "summary": "Get Ecf",
        "operationId": "get_ecf_api_v1_ecf__public_id__get",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDocumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/ecf/{public_id}/xml": {
      "get": {
        "tags": [
          "ECF Documents"
        ],
        "summary": "Get Ecf Xml",
        "description": "Download the signed XML for an ECF document.",
        "operationId": "get_ecf_xml_api_v1_ecf__public_id__xml_get",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/ecf/{public_id}/rfce": {
      "get": {
        "tags": [
          "ECF Documents"
        ],
        "summary": "Get Ecf Rfce Xml",
        "description": "Download the signed RFCE XML for an E32 document under RD$250,000.",
        "operationId": "get_ecf_rfce_xml_api_v1_ecf__public_id__rfce_get",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/ecf/{public_id}/mark-incapacity": {
      "post": {
        "tags": [
          "ECF Documents"
        ],
        "summary": "Mark Incapacity",
        "description": "Mark a document as 'Incapacidad Técnica' — generates non-electronic fiscal doc.",
        "operationId": "mark_incapacity_api_v1_ecf__public_id__mark_incapacity_post",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcfDocumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/ecf/{public_id}/pdf": {
      "get": {
        "tags": [
          "ECF Documents"
        ],
        "summary": "Get Ecf Pdf",
        "description": "Download the Representación Impresa (PDF) for an ECF document.",
        "operationId": "get_ecf_pdf_api_v1_ecf__public_id__pdf_get",
        "parameters": [
          {
            "name": "public_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Public Id"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Regenerar la RI antes de descargar",
              "default": false,
              "title": "Refresh"
            },
            "description": "Regenerar la RI antes de descargar"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/ecf/cancellations": {
      "post": {
        "tags": [
          "ANECF"
        ],
        "summary": "Submit Anecf",
        "description": "Submit an ANECF (cancellation of e-NCF sequences).",
        "operationId": "submit_anecf_api_v1_ecf_cancellations_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnecfSubmitRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnecfResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/ecf/acecf/inbound": {
      "post": {
        "tags": [
          "ACECF"
        ],
        "summary": "Receive Acecf",
        "description": "Receive an ACECF from another facturador. Public endpoint authenticated via API key.",
        "operationId": "receive_acecf_api_v1_ecf_acecf_inbound_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcecfInboundRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcecfResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/ecf/acecf/outbound": {
      "post": {
        "tags": [
          "ACECF"
        ],
        "summary": "Send Acecf",
        "description": "Queue an ACECF for delivery to another facturador.",
        "operationId": "send_acecf_api_v1_ecf_acecf_outbound_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcecfInboundRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcecfResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/ecf/acecf/submit": {
      "post": {
        "tags": [
          "ACECF"
        ],
        "summary": "Submit Acecf",
        "description": "Generate ACECF XML, sign with the company cert and send it to DGII.",
        "operationId": "submit_acecf_api_v1_ecf_acecf_submit_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcecfSubmitRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcecfResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/v1/dgii/rnc/{rnc}": {
      "get": {
        "tags": [
          "DGII"
        ],
        "summary": "Query Rnc",
        "description": "Lookup taxpayer data via the rnc.emite.do microservice.",
        "operationId": "query_rnc_api_v1_dgii_rnc__rnc__get",
        "parameters": [
          {
            "name": "rnc",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Rnc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/dgii/directory": {
      "get": {
        "tags": [
          "DGII"
        ],
        "summary": "Query Directory",
        "description": "Query DGII Directorio Facturadores for a given RNC. Cached 24h.",
        "operationId": "query_directory_api_v1_dgii_directory_get",
        "parameters": [
          {
            "name": "rnc",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 9,
              "maxLength": 11,
              "description": "RNC to query",
              "title": "Rnc"
            },
            "description": "RNC to query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/dgii/status/services": {
      "get": {
        "tags": [
          "DGII Status"
        ],
        "summary": "Get Services Status",
        "description": "Get current status of all DGII services (from Redis cache).",
        "operationId": "get_services_status_api_v1_dgii_status_services_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/dgii/status/maintenance": {
      "get": {
        "tags": [
          "DGII Status"
        ],
        "summary": "Get Maintenance Windows",
        "description": "Get scheduled DGII maintenance windows (from Redis cache).",
        "operationId": "get_maintenance_windows_api_v1_dgii_status_maintenance_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/dgii/status/environment/{environment}": {
      "get": {
        "tags": [
          "DGII Status"
        ],
        "summary": "Get Environment Status",
        "description": "Get cached DGII status for a specific environment.",
        "operationId": "get_environment_status_api_v1_dgii_status_environment__environment__get",
        "parameters": [
          {
            "name": "environment",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/dgii/status/refresh": {
      "get": {
        "tags": [
          "DGII Status"
        ],
        "summary": "Refresh Status",
        "description": "Force a fresh query to StatusECF API and update cache.",
        "operationId": "refresh_status_api_v1_dgii_status_refresh_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/health": {
      "get": {
        "summary": "Health",
        "operationId": "health_api_v1_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/docs/publica": {
      "get": {
        "tags": [
          "Documentacion"
        ],
        "summary": "Public Api Documentation",
        "description": "Devuelve la documentacion publica de integracion en Markdown.",
        "operationId": "public_api_documentation_api_v1_docs_publica_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/docs/examples/{filename}": {
      "get": {
        "tags": [
          "Documentacion"
        ],
        "summary": "Public Api Example",
        "description": "Descarga ejemplos JSON de requests para POST /api/v1/ecf.",
        "operationId": "public_api_example_api_v1_docs_examples__filename__get",
        "parameters": [
          {
            "name": "filename",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Filename"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "schemas": {
      "AcecfCaseResult": {
        "properties": {
          "case_id": {
            "type": "string",
            "title": "Case Id"
          },
          "encf": {
            "type": "string",
            "title": "Encf"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "xsd_valid": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xsd Valid"
          },
          "xsd_errors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Xsd Errors",
            "default": []
          },
          "payload": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payload"
          },
          "signed_xml": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed Xml",
            "description": "XML ACECF firmado en base64"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "dgii_response": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Response"
          }
        },
        "type": "object",
        "required": [
          "case_id",
          "encf",
          "status"
        ],
        "title": "AcecfCaseResult",
        "description": "One ACECF case outcome for Portal listing / retry."
      },
      "AcecfInboundRequest": {
        "properties": {
          "idempotency_key": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Idempotency Key"
          },
          "sender_rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Sender Rnc"
          },
          "receiver_rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Receiver Rnc"
          },
          "ecf_type": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "pattern": "^(31|32|33|34|41|43|44|45|46|47)$",
            "title": "Ecf Type"
          },
          "encf": {
            "type": "string",
            "maxLength": 13,
            "minLength": 13,
            "title": "Encf"
          },
          "signed_xml": {
            "type": "string",
            "title": "Signed Xml",
            "description": "Base64-encoded signed XML from sender"
          },
          "environment": {
            "type": "string",
            "maxLength": 20,
            "title": "Environment",
            "default": "TesteCF"
          },
          "receiver_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Receiver Url",
            "description": "Base URL del receptor (se POST a /fe/aprobacioncomercial/api/ecf)."
          }
        },
        "type": "object",
        "required": [
          "idempotency_key",
          "sender_rnc",
          "receiver_rnc",
          "ecf_type",
          "encf",
          "signed_xml"
        ],
        "title": "AcecfInboundRequest",
        "description": "ACECF received from another facturador."
      },
      "AcecfResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "dgii_response": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Response"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "status",
          "message"
        ],
        "title": "AcecfResponse"
      },
      "AcecfResubmitRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "payload": {
            "additionalProperties": true,
            "type": "object",
            "title": "Payload",
            "description": "DetalleAprobacionComercial fields"
          },
          "case_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "encf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Encf"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "payload"
        ],
        "title": "AcecfResubmitRequest",
        "description": "Reenviar un ACECF individual (Paso 3) desde el listado del Portal."
      },
      "AcecfSubmitRequest": {
        "properties": {
          "idempotency_key": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Idempotency Key"
          },
          "encf": {
            "type": "string",
            "maxLength": 13,
            "minLength": 13,
            "title": "Encf"
          },
          "rnc_emisor": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc Emisor"
          },
          "rnc_comprador": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc Comprador"
          },
          "fecha_emision": {
            "type": "string",
            "maxLength": 10,
            "minLength": 10,
            "title": "Fecha Emision"
          },
          "monto_total": {
            "type": "string",
            "title": "Monto Total"
          },
          "estado": {
            "type": "string",
            "pattern": "^[12]$",
            "title": "Estado"
          },
          "detalle_motivo_rechazo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detalle Motivo Rechazo"
          },
          "fecha_hora_aprobacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Hora Aprobacion"
          },
          "environment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Environment"
          },
          "ecf_type": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "pattern": "^(31|32|33|34|41|43|44|45|46|47)$",
            "title": "Ecf Type",
            "default": "31"
          }
        },
        "type": "object",
        "required": [
          "idempotency_key",
          "encf",
          "rnc_emisor",
          "rnc_comprador",
          "fecha_emision",
          "monto_total",
          "estado"
        ],
        "title": "AcecfSubmitRequest",
        "description": "Generate, sign and send ACECF to DGII (buyer commercial approval)."
      },
      "AffidavitGenerateRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "provider_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rnc"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password"
        ],
        "title": "AffidavitGenerateRequest"
      },
      "AffidavitGenerateResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "xml_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml Content"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "AffidavitGenerateResponse"
      },
      "AffidavitRunResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "AffidavitRunResponse"
      },
      "AffidavitSubmitRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "provider_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rnc"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "signed_xml": {
            "type": "string",
            "minLength": 1,
            "title": "Signed Xml"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password",
          "signed_xml"
        ],
        "title": "AffidavitSubmitRequest"
      },
      "AffidavitSubmitResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "AffidavitSubmitResponse"
      },
      "AnecfResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "status",
          "message"
        ],
        "title": "AnecfResponse"
      },
      "AnecfSubmitRequest": {
        "properties": {
          "idempotency_key": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Idempotency Key"
          },
          "cancellations": {
            "items": {
              "$ref": "#/components/schemas/CancellationLine"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 1,
            "title": "Cancellations"
          }
        },
        "type": "object",
        "required": [
          "idempotency_key",
          "cancellations"
        ],
        "title": "AnecfSubmitRequest"
      },
      "ApiKeyCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Scopes",
            "default": [
              "ecf:read"
            ]
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "ApiKeyCreate"
      },
      "ApiKeyCreateResponse": {
        "properties": {
          "api_key": {
            "type": "string",
            "title": "Api Key"
          },
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "key_prefix": {
            "type": "string",
            "title": "Key Prefix"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "scopes": {
            "items": {},
            "type": "array",
            "title": "Scopes"
          },
          "only_shown_once": {
            "type": "boolean",
            "title": "Only Shown Once",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "api_key",
          "public_id",
          "key_prefix",
          "name",
          "scopes"
        ],
        "title": "ApiKeyCreateResponse"
      },
      "Body_fe_aprobacion_comercial_fe_AprobacionComercial_api_ecf_post": {
        "properties": {
          "xml": {
            "anyOf": [
              {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml"
          }
        },
        "type": "object",
        "title": "Body_fe_aprobacion_comercial_fe_AprobacionComercial_api_ecf_post"
      },
      "Body_fe_aprobacion_comercial_fe_aprobacionComercial_api_ecf_post": {
        "properties": {
          "xml": {
            "anyOf": [
              {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml"
          }
        },
        "type": "object",
        "title": "Body_fe_aprobacion_comercial_fe_aprobacionComercial_api_ecf_post"
      },
      "Body_fe_aprobacion_comercial_fe_aprobacioncomercial_api_ecf_post": {
        "properties": {
          "xml": {
            "anyOf": [
              {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml"
          }
        },
        "type": "object",
        "title": "Body_fe_aprobacion_comercial_fe_aprobacioncomercial_api_ecf_post"
      },
      "Body_fe_recepcion_ecf_fe_Recepcion_api_ecf_post": {
        "properties": {
          "xml": {
            "anyOf": [
              {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml"
          }
        },
        "type": "object",
        "title": "Body_fe_recepcion_ecf_fe_Recepcion_api_ecf_post"
      },
      "Body_fe_recepcion_ecf_fe_recepcion_api_ecf_post": {
        "properties": {
          "xml": {
            "anyOf": [
              {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml"
          }
        },
        "type": "object",
        "title": "Body_fe_recepcion_ecf_fe_recepcion_api_ecf_post"
      },
      "Body_fe_validacion_certificado_fe_autenticacion_api_ValidacionCertificado_post": {
        "properties": {
          "xml": {
            "anyOf": [
              {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml"
          }
        },
        "type": "object",
        "title": "Body_fe_validacion_certificado_fe_autenticacion_api_ValidacionCertificado_post"
      },
      "Body_fe_validacion_certificado_fe_autenticacion_api_validacionCertificado_post": {
        "properties": {
          "xml": {
            "anyOf": [
              {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml"
          }
        },
        "type": "object",
        "title": "Body_fe_validacion_certificado_fe_autenticacion_api_validacionCertificado_post"
      },
      "Body_fe_validacion_certificado_fe_autenticacion_api_validacioncertificado_post": {
        "properties": {
          "xml": {
            "anyOf": [
              {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml"
          }
        },
        "type": "object",
        "title": "Body_fe_validacion_certificado_fe_autenticacion_api_validacioncertificado_post"
      },
      "Body_upload_certificate_api_v1_client_certificates_post": {
        "properties": {
          "certificate": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "Certificate"
          },
          "pin": {
            "type": "string",
            "title": "Pin"
          },
          "environment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Environment"
          }
        },
        "type": "object",
        "required": [
          "certificate",
          "pin"
        ],
        "title": "Body_upload_certificate_api_v1_client_certificates_post"
      },
      "BootstrapTokenIssueRequest": {
        "properties": {
          "issued_by": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Issued By"
          },
          "ttl_hours": {
            "type": "integer",
            "maximum": 168.0,
            "minimum": 1.0,
            "title": "Ttl Hours",
            "default": 24
          }
        },
        "type": "object",
        "required": [
          "issued_by"
        ],
        "title": "BootstrapTokenIssueRequest"
      },
      "BootstrapTokenResponse": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "issued_by": {
            "type": "string",
            "title": "Issued By"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "default": "Bootstrap token emitido. Único uso."
          }
        },
        "type": "object",
        "required": [
          "token",
          "expires_at",
          "issued_by"
        ],
        "title": "BootstrapTokenResponse"
      },
      "CancellationLine": {
        "properties": {
          "ecf_type": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "pattern": "^(31|32|33|34|41|43|44|45|46|47)$",
            "title": "Ecf Type"
          },
          "sequence_from": {
            "type": "string",
            "maxLength": 13,
            "minLength": 13,
            "title": "Sequence From"
          },
          "sequence_to": {
            "type": "string",
            "maxLength": 13,
            "minLength": 13,
            "title": "Sequence To"
          },
          "quantity": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Quantity"
          }
        },
        "type": "object",
        "required": [
          "ecf_type",
          "sequence_from",
          "sequence_to",
          "quantity"
        ],
        "title": "CancellationLine"
      },
      "CertificationArtifact": {
        "properties": {
          "case_id": {
            "type": "string",
            "title": "Case Id"
          },
          "sheet": {
            "type": "string",
            "title": "Sheet"
          },
          "ecf_type": {
            "type": "string",
            "title": "Ecf Type"
          },
          "encf": {
            "type": "string",
            "title": "Encf"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "xsd_valid": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xsd Valid"
          },
          "xsd_errors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Xsd Errors",
            "default": []
          },
          "payload": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payload"
          },
          "unsigned_xml": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unsigned Xml",
            "description": "XML sin firmar en base64"
          },
          "signed_xml": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed Xml",
            "description": "XML firmado en base64"
          },
          "rfce_xml": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rfce Xml",
            "description": "RFCE firmado en base64 cuando aplica"
          },
          "ri_pdf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ri Pdf",
            "description": "Representacion Impresa PDF en base64"
          },
          "security_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Security Code"
          },
          "electronic_stamp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Electronic Stamp",
            "description": "URL de consulta timbre DGII"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "case_id",
          "sheet",
          "ecf_type",
          "encf",
          "status"
        ],
        "title": "CertificationArtifact"
      },
      "CertificationGenerateRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "excel_file": {
            "type": "string",
            "title": "Excel File",
            "description": "Archivo Excel del set DGII en base64"
          },
          "dgii_portal_password": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Portal Password",
            "description": "Clave del portal DGII del cliente. Si se envia, el servicio valida si DGII ofrece un set de pruebas descargable para el Paso 4 y lo usa antes del Excel precargado."
          },
          "ncf_sequence_offset": {
            "type": "integer",
            "maximum": 999999.0,
            "minimum": 0.0,
            "title": "Ncf Sequence Offset",
            "description": "Incremento aplicado al correlativo final de cada e-NCF generado.",
            "default": 0
          },
          "certification_stage": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(data_tests|ecf_tests)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certification Stage",
            "description": "Paso de certificacion que solicita los artefactos. data_tests (Paso 2): respeta fecha y datos de emisor del set DGII (solo se fuerza RNCEmisor). ecf_tests (Paso 4 / simulacion): FechaEmision actual y datos de emisor de la empresa a certificar (facturas reales)."
          },
          "skip_dgii_download": {
            "type": "boolean",
            "title": "Skip Dgii Download",
            "description": "Si true, no intenta descargar el set desde el portal DGII con Playwright aunque haya password; usa excel_file del portal. Acelera regeneraciones.",
            "default": false
          },
          "target_encfs": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Encfs",
            "description": "Si se indica, solo se firman/generan estos e-NCF (tras aplicar offset). Usado al regenerar uno o pocos comprobantes."
          },
          "target_ecf_types": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Ecf Types",
            "description": "Si se indica, solo se generan casos de estos tipos (31, 32, …)."
          },
          "issuer_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuer Name"
          },
          "issuer_trade_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuer Trade Name"
          },
          "issuer_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuer Email"
          },
          "issuer_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuer Phone"
          },
          "issuer_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuer Address"
          },
          "issuer_logo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuer Logo",
            "description": "Logo del emisor en base64"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "excel_file"
        ],
        "title": "CertificationGenerateRequest"
      },
      "CertificationGenerateResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "excel_source": {
            "type": "string",
            "title": "Excel Source",
            "description": "'dgii_portal' si DGII entrego set de pruebas; 'portal_config' si se uso fallback.",
            "default": "portal_config"
          },
          "excel_filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Excel Filename"
          },
          "dgii_test_set_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Test Set Status"
          },
          "dgii_test_set_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Test Set Message"
          },
          "total_cases": {
            "type": "integer",
            "title": "Total Cases"
          },
          "signed_cases": {
            "type": "integer",
            "title": "Signed Cases"
          },
          "xsd_valid_cases": {
            "type": "integer",
            "title": "Xsd Valid Cases"
          },
          "rfce_cases": {
            "type": "integer",
            "title": "Rfce Cases"
          },
          "artifacts": {
            "items": {
              "$ref": "#/components/schemas/CertificationArtifact"
            },
            "type": "array",
            "title": "Artifacts"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "total_cases",
          "signed_cases",
          "xsd_valid_cases",
          "rfce_cases",
          "artifacts"
        ],
        "title": "CertificationGenerateResponse"
      },
      "CertificationPortalStatusRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password"
        ],
        "title": "CertificationPortalStatusRequest"
      },
      "CertificationPortalStatusResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "active_step_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active Step Number"
          },
          "active_step_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active Step Title"
          },
          "certification_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certification Stage"
          },
          "data_tests_completed": {
            "type": "boolean",
            "title": "Data Tests Completed",
            "default": false
          },
          "is_finalized": {
            "type": "boolean",
            "title": "Is Finalized",
            "default": false
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/CertificationPortalStep"
            },
            "type": "array",
            "title": "Steps",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "CertificationPortalStatusResponse"
      },
      "CertificationPortalStep": {
        "properties": {
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Number"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "state": {
            "type": "string",
            "title": "State"
          }
        },
        "type": "object",
        "required": [
          "title",
          "state"
        ],
        "title": "CertificationPortalStep"
      },
      "CertificationRiRegenerateItem": {
        "properties": {
          "case_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "encf": {
            "type": "string",
            "minLength": 1,
            "title": "Encf"
          },
          "ecf_type": {
            "type": "string",
            "minLength": 1,
            "title": "Ecf Type"
          },
          "signed_xml": {
            "type": "string",
            "minLength": 1,
            "title": "Signed Xml",
            "description": "XML e-CF firmado en base64"
          },
          "security_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Security Code"
          }
        },
        "type": "object",
        "required": [
          "encf",
          "ecf_type",
          "signed_xml"
        ],
        "title": "CertificationRiRegenerateItem"
      },
      "CertificationRiRegenerateRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "issuer_logo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuer Logo",
            "description": "Logo del emisor en base64"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/CertificationRiRegenerateItem"
            },
            "type": "array",
            "minItems": 1,
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "items"
        ],
        "title": "CertificationRiRegenerateRequest"
      },
      "CertificationRiRegenerateResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "success_count": {
            "type": "integer",
            "title": "Success Count"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/CertificationRiRegenerateResult"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "total",
          "success_count",
          "results"
        ],
        "title": "CertificationRiRegenerateResponse"
      },
      "CertificationRiRegenerateResult": {
        "properties": {
          "case_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Case Id"
          },
          "encf": {
            "type": "string",
            "title": "Encf"
          },
          "ecf_type": {
            "type": "string",
            "title": "Ecf Type"
          },
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "ri_pdf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ri Pdf"
          },
          "electronic_stamp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Electronic Stamp"
          },
          "security_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Security Code"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "encf",
          "ecf_type",
          "success"
        ],
        "title": "CertificationRiRegenerateResult"
      },
      "CertificationSubmitArtifact": {
        "properties": {
          "case_id": {
            "type": "string",
            "title": "Case Id"
          },
          "ecf_type": {
            "type": "string",
            "title": "Ecf Type"
          },
          "encf": {
            "type": "string",
            "title": "Encf"
          },
          "channel": {
            "type": "string",
            "pattern": "^(ecf|rfce)$",
            "title": "Channel"
          },
          "signed_xml": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed Xml",
            "description": "XML e-CF firmado en base64"
          },
          "rfce_xml": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rfce Xml",
            "description": "RFCE firmado en base64"
          }
        },
        "type": "object",
        "required": [
          "case_id",
          "ecf_type",
          "encf",
          "channel"
        ],
        "title": "CertificationSubmitArtifact"
      },
      "CertificationSubmitRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "phase": {
            "type": "string",
            "pattern": "^(phase1|phase2|phase3|phase4)$",
            "title": "Phase"
          },
          "artifacts": {
            "items": {
              "$ref": "#/components/schemas/CertificationSubmitArtifact"
            },
            "type": "array",
            "title": "Artifacts"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "phase",
          "artifacts"
        ],
        "title": "CertificationSubmitRequest"
      },
      "CertificationSubmitResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "phase": {
            "type": "string",
            "title": "Phase"
          },
          "submitted_cases": {
            "type": "integer",
            "title": "Submitted Cases"
          },
          "success_cases": {
            "type": "integer",
            "title": "Success Cases"
          },
          "error_cases": {
            "type": "integer",
            "title": "Error Cases"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/CertificationSubmitResult"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "phase",
          "submitted_cases",
          "success_cases",
          "error_cases",
          "results"
        ],
        "title": "CertificationSubmitResponse"
      },
      "CertificationSubmitResult": {
        "properties": {
          "case_id": {
            "type": "string",
            "title": "Case Id"
          },
          "ecf_type": {
            "type": "string",
            "title": "Ecf Type"
          },
          "encf": {
            "type": "string",
            "title": "Encf"
          },
          "channel": {
            "type": "string",
            "title": "Channel"
          },
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "track_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Track Id"
          },
          "response": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response"
          },
          "response_xml": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Xml",
            "description": "Respuesta DGII XML en base64"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "case_id",
          "ecf_type",
          "encf",
          "channel",
          "success",
          "status"
        ],
        "title": "CertificationSubmitResult"
      },
      "CertificationTaskStatusResponse": {
        "properties": {
          "task_id": {
            "type": "string",
            "title": "Task Id"
          },
          "task_type": {
            "type": "string",
            "title": "Task Type"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "result": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result"
          }
        },
        "type": "object",
        "required": [
          "task_id",
          "task_type",
          "status",
          "created_at"
        ],
        "title": "CertificationTaskStatusResponse"
      },
      "CertificationXmlSignRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "xml_type": {
            "type": "string",
            "pattern": "^(postulation|affidavit)$",
            "title": "Xml Type"
          },
          "xml_content": {
            "type": "string",
            "title": "Xml Content",
            "description": "XML DGII en base64 o texto plano"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "xml_type",
          "xml_content"
        ],
        "title": "CertificationXmlSignRequest"
      },
      "CertificationXmlSignResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "xml_type": {
            "type": "string",
            "title": "Xml Type"
          },
          "signed_xml": {
            "type": "string",
            "title": "Signed Xml"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "xml_type",
          "signed_xml",
          "message"
        ],
        "title": "CertificationXmlSignResponse"
      },
      "ClientArtifactSummary": {
        "properties": {
          "generated_xml": {
            "type": "boolean",
            "title": "Generated Xml"
          },
          "signed_xml": {
            "type": "boolean",
            "title": "Signed Xml"
          },
          "rfce": {
            "type": "boolean",
            "title": "Rfce"
          },
          "ri": {
            "type": "boolean",
            "title": "Ri"
          },
          "dgii_response": {
            "type": "boolean",
            "title": "Dgii Response"
          },
          "links": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Links"
          },
          "retention_years": {
            "type": "integer",
            "title": "Retention Years"
          }
        },
        "type": "object",
        "required": [
          "generated_xml",
          "signed_xml",
          "rfce",
          "ri",
          "dgii_response",
          "links",
          "retention_years"
        ],
        "title": "ClientArtifactSummary"
      },
      "ClientCertificateResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "alias": {
            "type": "string",
            "title": "Alias"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "subject_cn": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject Cn"
          },
          "issuer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issuer"
          },
          "serial_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Serial Number"
          },
          "not_before": {
            "type": "string",
            "format": "date-time",
            "title": "Not Before"
          },
          "not_after": {
            "type": "string",
            "format": "date-time",
            "title": "Not After"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "uploaded_at": {
            "type": "string",
            "format": "date-time",
            "title": "Uploaded At"
          },
          "days_until_expiry": {
            "type": "integer",
            "title": "Days Until Expiry"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "alias",
          "environment",
          "subject_cn",
          "issuer",
          "serial_number",
          "not_before",
          "not_after",
          "is_active",
          "uploaded_at",
          "days_until_expiry"
        ],
        "title": "ClientCertificateResponse"
      },
      "ClientCompanyCertificate": {
        "properties": {
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "environment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Environment"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "days_until_expiry": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Days Until Expiry"
          },
          "subject_cn": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject Cn"
          },
          "serial_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Serial Number"
          }
        },
        "type": "object",
        "required": [
          "active"
        ],
        "title": "ClientCompanyCertificate"
      },
      "ClientCompanyResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "rnc": {
            "type": "string",
            "title": "Rnc"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "trade_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trade Name"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "default_environment": {
            "type": "string",
            "title": "Default Environment"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "certificate": {
            "$ref": "#/components/schemas/ClientCompanyCertificate"
          },
          "active_ncf_types": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Active Ncf Types"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "rnc",
          "name",
          "trade_name",
          "address",
          "email",
          "phone",
          "default_environment",
          "is_active",
          "certificate",
          "active_ncf_types"
        ],
        "title": "ClientCompanyResponse"
      },
      "ClientCompanyUpdateRequest": {
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          }
        },
        "type": "object",
        "title": "ClientCompanyUpdateRequest"
      },
      "ClientDocumentListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ClientDocumentResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "ClientDocumentListResponse"
      },
      "ClientDocumentResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "idempotency_key": {
            "type": "string",
            "title": "Idempotency Key"
          },
          "external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "ecf_type": {
            "type": "string",
            "title": "Ecf Type"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "encf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Encf"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "scheduled_for": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled For"
          },
          "dgii_track_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Track Id"
          },
          "dgii_security_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Security Code"
          },
          "electronic_stamp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Electronic Stamp"
          },
          "sign_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sign Date"
          },
          "submitted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitted At"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "dgii_response": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Response"
          },
          "artifacts": {
            "$ref": "#/components/schemas/ClientArtifactSummary"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "idempotency_key",
          "external_id",
          "ecf_type",
          "environment",
          "encf",
          "status",
          "scheduled_for",
          "dgii_track_id",
          "dgii_security_code",
          "electronic_stamp",
          "sign_date",
          "submitted_at",
          "completed_at",
          "error_code",
          "error_message",
          "dgii_response",
          "artifacts",
          "created_at",
          "updated_at"
        ],
        "title": "ClientDocumentResponse"
      },
      "ClientEnvironmentCount": {
        "properties": {
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "environment",
          "count"
        ],
        "title": "ClientEnvironmentCount"
      },
      "ClientInboxAckResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "acked": {
            "type": "boolean",
            "title": "Acked"
          },
          "acked_at": {
            "type": "string",
            "format": "date-time",
            "title": "Acked At"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "acked",
          "acked_at"
        ],
        "title": "ClientInboxAckResponse"
      },
      "ClientInboxItem": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "encf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Encf"
          },
          "ecf_type": {
            "type": "string",
            "title": "Ecf Type"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "rnc_emisor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rnc Emisor"
          },
          "rnc_comprador": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rnc Comprador"
          },
          "razon_social_emisor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Razon Social Emisor"
          },
          "monto_total": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Monto Total"
          },
          "fecha_emision": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fecha Emision"
          },
          "acked": {
            "type": "boolean",
            "title": "Acked"
          },
          "xml_available": {
            "type": "boolean",
            "title": "Xml Available"
          },
          "arecf_available": {
            "type": "boolean",
            "title": "Arecf Available"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "encf",
          "ecf_type",
          "environment",
          "status",
          "rnc_emisor",
          "rnc_comprador",
          "razon_social_emisor",
          "monto_total",
          "fecha_emision",
          "acked",
          "xml_available",
          "arecf_available",
          "created_at"
        ],
        "title": "ClientInboxItem"
      },
      "ClientInboxListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ClientInboxItem"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "ClientInboxListResponse"
      },
      "ClientSequenceListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ClientSequenceResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "ClientSequenceListResponse"
      },
      "ClientSequenceResponse": {
        "properties": {
          "ecf_type": {
            "type": "string",
            "title": "Ecf Type"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "range_start": {
            "type": "integer",
            "title": "Range Start"
          },
          "range_end": {
            "type": "integer",
            "title": "Range End"
          },
          "next_sequence": {
            "type": "integer",
            "title": "Next Sequence"
          },
          "used": {
            "type": "integer",
            "title": "Used"
          },
          "available": {
            "type": "integer",
            "title": "Available"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "valid_until": {
            "type": "string",
            "format": "date",
            "title": "Valid Until"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "state": {
            "type": "string",
            "title": "State"
          }
        },
        "type": "object",
        "required": [
          "ecf_type",
          "environment",
          "range_start",
          "range_end",
          "next_sequence",
          "used",
          "available",
          "total",
          "valid_until",
          "is_active",
          "state"
        ],
        "title": "ClientSequenceResponse"
      },
      "ClientStatusCount": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "status",
          "count"
        ],
        "title": "ClientStatusCount"
      },
      "ClientSummaryResponse": {
        "properties": {
          "documents_total": {
            "type": "integer",
            "title": "Documents Total"
          },
          "documents_by_status": {
            "items": {
              "$ref": "#/components/schemas/ClientStatusCount"
            },
            "type": "array",
            "title": "Documents By Status"
          },
          "documents_by_environment": {
            "items": {
              "$ref": "#/components/schemas/ClientEnvironmentCount"
            },
            "type": "array",
            "title": "Documents By Environment"
          },
          "documents_by_type": {
            "items": {
              "$ref": "#/components/schemas/ClientTypeCount"
            },
            "type": "array",
            "title": "Documents By Type"
          },
          "sequence_ranges_total": {
            "type": "integer",
            "title": "Sequence Ranges Total"
          },
          "sequence_available_total": {
            "type": "integer",
            "title": "Sequence Available Total"
          },
          "sequence_alerts": {
            "type": "integer",
            "title": "Sequence Alerts"
          }
        },
        "type": "object",
        "required": [
          "documents_total",
          "documents_by_status",
          "documents_by_environment",
          "documents_by_type",
          "sequence_ranges_total",
          "sequence_available_total",
          "sequence_alerts"
        ],
        "title": "ClientSummaryResponse"
      },
      "ClientTypeCount": {
        "properties": {
          "ecf_type": {
            "type": "string",
            "title": "Ecf Type"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "ecf_type",
          "count"
        ],
        "title": "ClientTypeCount"
      },
      "ClientWebhookCreateRequest": {
        "properties": {
          "url": {
            "type": "string",
            "minLength": 1,
            "format": "uri",
            "title": "Url"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Events"
          },
          "secret": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "ClientWebhookCreateRequest"
      },
      "ClientWebhookCreateResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Events"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "secret": {
            "type": "string",
            "title": "Secret"
          },
          "only_shown_once": {
            "type": "boolean",
            "title": "Only Shown Once",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "url",
          "events",
          "is_active",
          "created_at",
          "secret"
        ],
        "title": "ClientWebhookCreateResponse"
      },
      "ClientWebhookDeliveryListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ClientWebhookDeliveryResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "ClientWebhookDeliveryListResponse"
      },
      "ClientWebhookDeliveryResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "event": {
            "type": "string",
            "title": "Event"
          },
          "attempt": {
            "type": "integer",
            "title": "Attempt"
          },
          "status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Code"
          },
          "response_excerpt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Excerpt"
          },
          "succeeded": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Succeeded"
          },
          "sent_at": {
            "type": "string",
            "format": "date-time",
            "title": "Sent At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "event",
          "attempt",
          "status_code",
          "response_excerpt",
          "succeeded",
          "sent_at"
        ],
        "title": "ClientWebhookDeliveryResponse"
      },
      "ClientWebhookResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Events"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "url",
          "events",
          "is_active",
          "created_at"
        ],
        "title": "ClientWebhookResponse"
      },
      "ClientWebhookRotateSecretRequest": {
        "properties": {
          "secret": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret"
          }
        },
        "type": "object",
        "title": "ClientWebhookRotateSecretRequest"
      },
      "ClientWebhookRotateSecretResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "secret": {
            "type": "string",
            "title": "Secret"
          },
          "only_shown_once": {
            "type": "boolean",
            "title": "Only Shown Once",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "secret"
        ],
        "title": "ClientWebhookRotateSecretResponse"
      },
      "ClientWebhookTestResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "event": {
            "type": "string",
            "title": "Event"
          },
          "status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Code"
          },
          "succeeded": {
            "type": "boolean",
            "title": "Succeeded"
          },
          "response_excerpt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Excerpt"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "url",
          "event",
          "status_code",
          "succeeded",
          "response_excerpt"
        ],
        "title": "ClientWebhookTestResponse"
      },
      "ClientWebhookUpdateRequest": {
        "properties": {
          "url": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "format": "uri"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "events": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Events"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          }
        },
        "type": "object",
        "title": "ClientWebhookUpdateRequest"
      },
      "CommunicationReadyRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "provider_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rnc"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password"
        ],
        "title": "CommunicationReadyRequest"
      },
      "CommunicationReadyResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "action": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Action"
          },
          "page_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Url"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "CommunicationReadyResponse"
      },
      "CompanyCreate": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "trade_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trade Name"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "TesteCF"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "name"
        ],
        "title": "CompanyCreate"
      },
      "CompanyResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "rnc": {
            "type": "string",
            "title": "Rnc"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "trade_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trade Name"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "default_environment": {
            "type": "string",
            "title": "Default Environment"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "rnc",
          "name",
          "trade_name",
          "address",
          "email",
          "phone",
          "default_environment",
          "is_active"
        ],
        "title": "CompanyResponse"
      },
      "EcfDocumentResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "idempotency_key": {
            "type": "string",
            "title": "Idempotency Key"
          },
          "external_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "ecf_type": {
            "type": "string",
            "title": "Ecf Type"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "encf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Encf"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "scheduled_for": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled For"
          },
          "dgii_track_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Track Id"
          },
          "dgii_security_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Security Code"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "idempotency_key",
          "external_id",
          "ecf_type",
          "environment",
          "encf",
          "status",
          "scheduled_for",
          "dgii_track_id",
          "dgii_security_code",
          "error_code",
          "error_message",
          "created_at",
          "updated_at"
        ],
        "title": "EcfDocumentResponse"
      },
      "EcfEventDerivedStage": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "event": {
            "type": "string",
            "title": "Event"
          },
          "description": {
            "type": "string",
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "name",
          "event",
          "description"
        ],
        "title": "EcfEventDerivedStage"
      },
      "EcfListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/EcfDocumentResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "EcfListResponse"
      },
      "EcfStateContractResponse": {
        "properties": {
          "source_of_truth": {
            "type": "string",
            "title": "Source Of Truth"
          },
          "mutation_policy": {
            "type": "string",
            "title": "Mutation Policy"
          },
          "states": {
            "items": {
              "$ref": "#/components/schemas/EcfStateDefinition"
            },
            "type": "array",
            "title": "States"
          },
          "event_derived_stages": {
            "items": {
              "$ref": "#/components/schemas/EcfEventDerivedStage"
            },
            "type": "array",
            "title": "Event Derived Stages"
          }
        },
        "type": "object",
        "required": [
          "source_of_truth",
          "mutation_policy",
          "states",
          "event_derived_stages"
        ],
        "title": "EcfStateContractResponse"
      },
      "EcfStateDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "terminal": {
            "type": "boolean",
            "title": "Terminal"
          },
          "transitions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Transitions"
          }
        },
        "type": "object",
        "required": [
          "name",
          "type",
          "terminal",
          "transitions"
        ],
        "title": "EcfStateDefinition"
      },
      "EcfSubmitRequest": {
        "properties": {
          "idempotency_key": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Idempotency Key"
          },
          "external_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "ecf_type": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "pattern": "^(31|32|33|34|41|43|44|45|46|47)$",
            "title": "Ecf Type"
          },
          "environment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Environment"
          },
          "payload": {
            "additionalProperties": true,
            "type": "object",
            "title": "Payload"
          },
          "scheduled_for": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled For",
            "description": "ISO8601 datetime for deferred mode. Required when mode=deferred."
          }
        },
        "type": "object",
        "required": [
          "idempotency_key",
          "ecf_type",
          "payload"
        ],
        "title": "EcfSubmitRequest"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "InvoiceSimulationUploadRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "provider_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rnc"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "signed_xml": {
            "type": "string",
            "minLength": 1,
            "title": "Signed Xml"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "encf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Encf"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password",
          "signed_xml"
        ],
        "title": "InvoiceSimulationUploadRequest"
      },
      "InvoiceSimulationUploadResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "encf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Encf"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "InvoiceSimulationUploadResponse"
      },
      "NcfRangeInput": {
        "properties": {
          "ecf_type": {
            "type": "string",
            "maxLength": 2,
            "minLength": 2,
            "title": "Ecf Type"
          },
          "range_start": {
            "type": "integer",
            "title": "Range Start"
          },
          "range_end": {
            "type": "integer",
            "title": "Range End"
          },
          "valid_until": {
            "type": "string",
            "format": "date",
            "title": "Valid Until"
          }
        },
        "type": "object",
        "required": [
          "ecf_type",
          "range_start",
          "range_end",
          "valid_until"
        ],
        "title": "NcfRangeInput"
      },
      "PortalCompanySyncRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "trade_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trade Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "logo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo"
          },
          "service_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Stage"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "TesteCF"
          },
          "certificate_p12": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certificate P12",
            "description": "P12 en base64"
          },
          "certificate_pin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certificate Pin"
          },
          "ncf_ranges": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/NcfRangeInput"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ncf Ranges"
          }
        },
        "type": "object",
        "required": [
          "rnc"
        ],
        "title": "PortalCompanySyncRequest",
        "description": "Request del Portal para refrescar datos operativos en el servicio."
      },
      "PortalCompanySyncResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_public_id": {
            "type": "string",
            "title": "Company Public Id"
          },
          "has_certificate": {
            "type": "boolean",
            "title": "Has Certificate",
            "default": false
          },
          "ncf_ranges_count": {
            "type": "integer",
            "title": "Ncf Ranges Count"
          },
          "active_ncf_types": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Active Ncf Types",
            "default": []
          },
          "semilla_valid": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Semilla Valid"
          },
          "semilla_expires": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Semilla Expires"
          },
          "semilla_validation_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Semilla Validation Message"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_public_id",
          "ncf_ranges_count",
          "message"
        ],
        "title": "PortalCompanySyncResponse"
      },
      "PortalEndpointRegisterRequest": {
        "properties": {
          "base_url": {
            "type": "string",
            "maxLength": 2083,
            "minLength": 1,
            "format": "uri",
            "title": "Base Url"
          },
          "service_secret": {
            "type": "string",
            "maxLength": 500,
            "minLength": 16,
            "title": "Service Secret"
          },
          "label": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Label"
          },
          "timeout_seconds": {
            "type": "integer",
            "maximum": 120.0,
            "minimum": 1.0,
            "title": "Timeout Seconds",
            "default": 10
          },
          "make_default": {
            "type": "boolean",
            "title": "Make Default",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "base_url",
          "service_secret",
          "label"
        ],
        "title": "PortalEndpointRegisterRequest"
      },
      "PortalEndpointRegisterResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "base_url": {
            "type": "string",
            "title": "Base Url"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "timeout_seconds": {
            "type": "integer",
            "title": "Timeout Seconds"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "registered_at": {
            "type": "string",
            "format": "date-time",
            "title": "Registered At"
          },
          "companies_count": {
            "type": "integer",
            "title": "Companies Count"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "default": "Portal endpoint registrado"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "base_url",
          "label",
          "timeout_seconds",
          "is_active",
          "is_default",
          "registered_at",
          "companies_count"
        ],
        "title": "PortalEndpointRegisterResponse"
      },
      "PortalEndpointResponse": {
        "properties": {
          "public_id": {
            "type": "string",
            "title": "Public Id"
          },
          "base_url": {
            "type": "string",
            "title": "Base Url"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "timeout_seconds": {
            "type": "integer",
            "title": "Timeout Seconds"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "registered_at": {
            "type": "string",
            "format": "date-time",
            "title": "Registered At"
          },
          "companies_count": {
            "type": "integer",
            "title": "Companies Count"
          }
        },
        "type": "object",
        "required": [
          "public_id",
          "base_url",
          "label",
          "timeout_seconds",
          "is_active",
          "is_default",
          "registered_at",
          "companies_count"
        ],
        "title": "PortalEndpointResponse"
      },
      "PortalEndpointUpdateRequest": {
        "properties": {
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "is_default": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Default"
          },
          "service_secret": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500,
                "minLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Secret"
          },
          "label": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "base_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500,
                "minLength": 8
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Url"
          },
          "timeout_seconds": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 120.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Timeout Seconds"
          }
        },
        "type": "object",
        "title": "PortalEndpointUpdateRequest"
      },
      "PortalRegisterRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "trade_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trade Name"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "logo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "TesteCF"
          },
          "certificate_p12": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certificate P12",
            "description": "P12 en base64"
          },
          "certificate_pin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certificate Pin"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          },
          "ncf_ranges": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/NcfRangeInput"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ncf Ranges"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "name"
        ],
        "title": "PortalRegisterRequest",
        "description": "Request del Portal ECF para registrar empresa completa."
      },
      "PortalRegisterResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_public_id": {
            "type": "string",
            "title": "Company Public Id"
          },
          "api_key": {
            "type": "string",
            "title": "Api Key"
          },
          "has_certificate": {
            "type": "boolean",
            "title": "Has Certificate"
          },
          "ncf_ranges_count": {
            "type": "integer",
            "title": "Ncf Ranges Count"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_public_id",
          "api_key",
          "has_certificate",
          "ncf_ranges_count",
          "message"
        ],
        "title": "PortalRegisterResponse"
      },
      "PortalValidateSemillaRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "TesteCF"
          },
          "certificate_p12": {
            "type": "string",
            "title": "Certificate P12",
            "description": "P12 en base64"
          },
          "certificate_pin": {
            "type": "string",
            "title": "Certificate Pin"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "certificate_p12",
          "certificate_pin"
        ],
        "title": "PortalValidateSemillaRequest"
      },
      "PortalValidateSemillaResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "valid": {
            "type": "boolean",
            "title": "Valid"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "expires": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "success",
          "valid",
          "environment",
          "message"
        ],
        "title": "PortalValidateSemillaResponse"
      },
      "PostulationGenerateRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "provider_rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Provider Rnc"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "provider_portal_password": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Portal Password"
          },
          "representative_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Representative Rnc"
          },
          "production_services_base_url": {
            "type": "string",
            "minLength": 1,
            "title": "Production Services Base Url"
          },
          "software_name": {
            "type": "string",
            "title": "Software Name",
            "default": "Odoo"
          },
          "software_version": {
            "type": "string",
            "title": "Software Version",
            "default": "1.0"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "provider_rnc",
          "dgii_portal_password",
          "production_services_base_url"
        ],
        "title": "PostulationGenerateRequest"
      },
      "PostulationGenerateResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "xml_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Xml Content"
          },
          "software_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Software Name"
          },
          "software_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Software Version"
          },
          "url_autenticacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Autenticacion"
          },
          "url_recepcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Recepcion"
          },
          "url_aprobacion_comercial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Aprobacion Comercial"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "PostulationGenerateResponse"
      },
      "PostulationRunResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "provider_approval_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Approval Status"
          },
          "provider_approval_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Approval Message"
          },
          "software_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Software Name"
          },
          "software_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Software Version"
          },
          "url_autenticacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Autenticacion"
          },
          "url_recepcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Recepcion"
          },
          "url_aprobacion_comercial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Aprobacion Comercial"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "PostulationRunResponse"
      },
      "PostulationSubmitRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "provider_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rnc"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "signed_xml": {
            "type": "string",
            "minLength": 1,
            "title": "Signed Xml"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password",
          "signed_xml"
        ],
        "title": "PostulationSubmitRequest"
      },
      "PostulationSubmitResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "PostulationSubmitResponse"
      },
      "PrintedRepresentationUploadFile": {
        "properties": {
          "field_name": {
            "type": "string",
            "minLength": 1,
            "title": "Field Name"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "title": "Filename"
          },
          "pdf": {
            "type": "string",
            "minLength": 1,
            "title": "Pdf",
            "description": "Representación impresa PDF en base64"
          }
        },
        "type": "object",
        "required": [
          "field_name",
          "filename",
          "pdf"
        ],
        "title": "PrintedRepresentationUploadFile"
      },
      "PrintedRepresentationsUploadRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "provider_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rnc"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/PrintedRepresentationUploadFile"
            },
            "type": "array",
            "title": "Files"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password",
          "files"
        ],
        "title": "PrintedRepresentationsUploadRequest"
      },
      "PrintedRepresentationsUploadResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "uploaded_files": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Uploaded Files",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "PrintedRepresentationsUploadResponse"
      },
      "ProductionUrlsConfirmRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "provider_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rnc"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "production_services_base_url": {
            "type": "string",
            "minLength": 1,
            "title": "Production Services Base Url"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password",
          "production_services_base_url"
        ],
        "title": "ProductionUrlsConfirmRequest"
      },
      "ProductionUrlsConfirmResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "url_autenticacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Autenticacion"
          },
          "url_recepcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Recepcion"
          },
          "url_aprobacion_comercial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Aprobacion Comercial"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "ProductionUrlsConfirmResponse"
      },
      "ProviderApprovalAcceptRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "provider_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rnc"
          },
          "provider_portal_password": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Portal Password"
          },
          "dgii_portal_password": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Dgii Portal Password",
            "description": "Clave del portal del cliente (empresa en certificación). Se usa en ACECF."
          },
          "approval_flow": {
            "type": "string",
            "pattern": "^(auto|acecf_data_tests|provider_inbox)$",
            "title": "Approval Flow",
            "description": "acecf_data_tests = set Excel/API ACECF; provider_inbox = Acepto en bandeja del proveedor; auto = decide según RNC y excel_file.",
            "default": "auto"
          },
          "excel_file": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Excel File",
            "description": "Set ACECF DGII (hoja ACEECF_Generadas) en base64. Opcional si se descarga del portal."
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          },
          "max_pages": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 20.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Pages"
          }
        },
        "type": "object",
        "required": [
          "rnc"
        ],
        "title": "ProviderApprovalAcceptRequest",
        "description": "Paso 3 de certificación: dos flujos distintos en DGII.\n\n- ``acecf_data_tests``: Pruebas de Datos Aprobaciones Comerciales. La\n  empresa en certificación (comprador) descarga/usa el set Excel, genera\n  ACECF y los envía a la API de Aprobación Comercial. No requiere ser\n  proveedor de software autorizado.\n- ``provider_inbox``: el proveedor de software acepta la postulación en su\n  bandeja DGII (solo cuando ya opera como proveedor).\n- ``auto``: si hay Excel ACECF o el RNC proveedor coincide con la empresa\n  → ACECF; si el proveedor es otro RNC y no hay Excel → bandeja."
      },
      "ProviderApprovalAcceptResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "message_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message Id"
          },
          "bizagi_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bizagi Id"
          },
          "action_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Action Url"
          },
          "submitted_cases": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Submitted Cases"
          },
          "success_cases": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Success Cases"
          },
          "error_cases": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Cases"
          },
          "approval_flow": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approval Flow"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/AcecfCaseResult"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "ProviderApprovalAcceptResponse"
      },
      "ProviderPostulationGenerateRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "representative_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Representative Rnc"
          },
          "production_services_base_url": {
            "type": "string",
            "minLength": 1,
            "title": "Production Services Base Url"
          },
          "software_name": {
            "type": "string",
            "title": "Software Name",
            "default": "Odoo"
          },
          "software_version": {
            "type": "string",
            "title": "Software Version",
            "default": "1.0"
          },
          "software_type": {
            "type": "string",
            "pattern": "^[01]$",
            "title": "Software Type",
            "description": "Tipo de software DGII: 1=PROPIO, 0=EXTERNO",
            "default": "1"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password",
          "production_services_base_url"
        ],
        "title": "ProviderPostulationGenerateRequest",
        "description": "Request for provider (software vendor) postulation on DGII CerteCF."
      },
      "ProviderPostulationSubmitRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "signed_xml": {
            "type": "string",
            "minLength": 1,
            "title": "Signed Xml"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password",
          "signed_xml"
        ],
        "title": "ProviderPostulationSubmitRequest"
      },
      "PublicSignupRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "trade_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trade Name"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Name"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "TesteCF"
          },
          "certificate_p12": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certificate P12",
            "description": "P12 en base64"
          },
          "certificate_pin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certificate Pin"
          },
          "erp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Erp"
          },
          "volume": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "name",
          "email"
        ],
        "title": "PublicSignupRequest"
      },
      "PublicSignupResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_public_id": {
            "type": "string",
            "title": "Company Public Id"
          },
          "api_key": {
            "type": "string",
            "title": "Api Key"
          },
          "has_certificate": {
            "type": "boolean",
            "title": "Has Certificate"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_public_id",
          "api_key",
          "has_certificate",
          "message"
        ],
        "title": "PublicSignupResponse"
      },
      "ReceptionReadinessCheckResponse": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          }
        },
        "type": "object",
        "required": [
          "code",
          "ok",
          "message"
        ],
        "title": "ReceptionReadinessCheckResponse"
      },
      "ReceptionReadinessRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "services_base_url": {
            "type": "string",
            "minLength": 1,
            "title": "Services Base Url",
            "description": "Dominio publico del cliente (mismas rutas /fe/* de prueba)."
          },
          "probe_http": {
            "type": "boolean",
            "title": "Probe Http",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "services_base_url"
        ],
        "title": "ReceptionReadinessRequest"
      },
      "ReceptionReadinessResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "ready": {
            "type": "boolean",
            "title": "Ready"
          },
          "base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Url"
          },
          "url_autenticacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Autenticacion"
          },
          "url_recepcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Recepcion"
          },
          "url_aprobacion_comercial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Aprobacion Comercial"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/ReceptionReadinessCheckResponse"
            },
            "type": "array",
            "title": "Checks",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message",
          "ready"
        ],
        "title": "ReceptionReadinessResponse"
      },
      "RegisterApiKeyRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "api_key": {
            "type": "string",
            "minLength": 1,
            "title": "Api Key",
            "description": "API key generada externamente"
          },
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Nombre descriptivo de la API key"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "trade_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trade Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "logo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo"
          },
          "service_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Stage"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "TesteCF"
          },
          "certificate_p12": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certificate P12",
            "description": "P12 en base64"
          },
          "certificate_pin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certificate Pin"
          },
          "ncf_ranges": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/NcfRangeInput"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ncf Ranges"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "api_key",
          "name"
        ],
        "title": "RegisterApiKeyRequest",
        "description": "Request para registrar una API key generada externamente."
      },
      "RegisterApiKeyResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "company_public_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Public Id"
          },
          "api_key_public_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Public Id"
          },
          "has_certificate": {
            "type": "boolean",
            "title": "Has Certificate",
            "default": false
          },
          "ncf_ranges_count": {
            "type": "integer",
            "title": "Ncf Ranges Count",
            "default": 0
          },
          "semilla_valid": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Semilla Valid"
          },
          "semilla_expires": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Semilla Expires"
          },
          "semilla_validation_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Semilla Validation Message"
          }
        },
        "type": "object",
        "required": [
          "success",
          "message"
        ],
        "title": "RegisterApiKeyResponse"
      },
      "ReplayDlqResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "replayed_count": {
            "type": "integer",
            "title": "Replayed Count"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "success",
          "replayed_count",
          "message"
        ],
        "title": "ReplayDlqResponse"
      },
      "ReplayStuckRequest": {
        "properties": {
          "stuck_minutes": {
            "type": "integer",
            "title": "Stuck Minutes",
            "description": "Minutes to consider a document stuck",
            "default": 15
          }
        },
        "type": "object",
        "title": "ReplayStuckRequest"
      },
      "ReplayStuckResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "replayed_count": {
            "type": "integer",
            "title": "Replayed Count"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "success",
          "replayed_count",
          "message"
        ],
        "title": "ReplayStuckResponse"
      },
      "SimulationStatusCounterResponse": {
        "properties": {
          "ecf_type": {
            "type": "string",
            "title": "Ecf Type"
          },
          "channel": {
            "type": "string",
            "title": "Channel"
          },
          "sent": {
            "type": "integer",
            "title": "Sent"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "label": {
            "type": "string",
            "title": "Label"
          }
        },
        "type": "object",
        "required": [
          "ecf_type",
          "channel",
          "sent",
          "total",
          "label"
        ],
        "title": "SimulationStatusCounterResponse"
      },
      "SimulationStatusRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password"
        ],
        "title": "SimulationStatusRequest"
      },
      "SimulationStatusResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "counters": {
            "items": {
              "$ref": "#/components/schemas/SimulationStatusCounterResponse"
            },
            "type": "array",
            "title": "Counters",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "SimulationStatusResponse"
      },
      "TestUrlsConfirmRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment",
            "default": "CerteCF"
          },
          "provider_rnc": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 11,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rnc"
          },
          "dgii_portal_password": {
            "type": "string",
            "minLength": 1,
            "title": "Dgii Portal Password"
          },
          "services_base_url": {
            "type": "string",
            "minLength": 1,
            "title": "Services Base Url"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "dgii_portal_password",
          "services_base_url"
        ],
        "title": "TestUrlsConfirmRequest"
      },
      "TestUrlsConfirmResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "company_rnc": {
            "type": "string",
            "title": "Company Rnc"
          },
          "environment": {
            "type": "string",
            "title": "Environment"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "url_autenticacion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Autenticacion"
          },
          "url_recepcion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Recepcion"
          },
          "url_aprobacion_comercial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url Aprobacion Comercial"
          }
        },
        "type": "object",
        "required": [
          "success",
          "company_rnc",
          "environment",
          "status",
          "message"
        ],
        "title": "TestUrlsConfirmResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VerifyCompanyRequest": {
        "properties": {
          "rnc": {
            "type": "string",
            "maxLength": 11,
            "minLength": 9,
            "title": "Rnc"
          },
          "api_key": {
            "type": "string",
            "minLength": 1,
            "title": "Api Key",
            "description": "API key del servicio"
          }
        },
        "type": "object",
        "required": [
          "rnc",
          "api_key"
        ],
        "title": "VerifyCompanyRequest",
        "description": "Request del addon cliente para verificar empresa."
      },
      "VerifyCompanyResponse": {
        "properties": {
          "registered": {
            "type": "boolean",
            "title": "Registered"
          },
          "company": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompanyResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "has_certificate": {
            "type": "boolean",
            "title": "Has Certificate",
            "default": false
          },
          "has_api_key": {
            "type": "boolean",
            "title": "Has Api Key",
            "default": false
          },
          "active_ncf_types": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Active Ncf Types",
            "default": []
          },
          "environment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Environment"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "default": ""
          },
          "api_key_valid": {
            "type": "boolean",
            "title": "Api Key Valid",
            "default": false
          },
          "api_key_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Name"
          },
          "api_key_public_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Public Id"
          }
        },
        "type": "object",
        "required": [
          "registered"
        ],
        "title": "VerifyCompanyResponse"
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "API key de la empresa. Se muestra una sola vez al crearla."
      }
    }
  },
  "servers": [
    {
      "url": "https://api.emite.do",
      "description": "Producción"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}
