{
  "openapi": "3.0.4",
  "info": {
    "title": "RNC ",
    "description": "API gratuita para consultar el RNC. Datos publicos de la DGII (https://dgii.gov.do/app/WebApps/Consultas/RNC/DGII_RNC.zip), actualizados diariamente. Servicio no oficial, sin garantia ni afiliacion con la DGII. Limites de uso por IP: 60 solicitudes por minuto y 10,000 por dia (HTTP 429 al excederlos, ver cabecera Retry-After). Soporte: info@oscarsoft.net",
    "contact": {
      "name": "OscarSoft.net",
      "url": "https://www.OscarSoft.Net",
      "email": "Oscar.portorreal@OscarSoft.Net"
    },
    "license": {
      "name": "www.OscarSoft.net",
      "url": "https://www.OscarSoft.Net/licenses/"
    },
    "version": "v1"
  },
  "paths": {
    "/api/DGII/{rnc}": {
      "get": {
        "tags": [
          "DGII"
        ],
        "summary": "Buscar por RNC o cedula",
        "description": "Buscar por RNC o cedula sin guiones formato (#########)",
        "parameters": [
          {
            "name": "rnc",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ContribuyenteDGII"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContribuyenteDGII"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContribuyenteDGII"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/api/DGII/GetByName/{nombre}": {
      "get": {
        "tags": [
          "DGII"
        ],
        "summary": "Buscar RNC por Nombre o Razon Social",
        "description": "Buscar RNC por Nombre o Razon Social",
        "parameters": [
          {
            "name": "nombre",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ContribuyenteDGII"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContribuyenteDGII"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContribuyenteDGII"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/api/DGII/search/{term}": {
      "get": {
        "tags": [
          "DGII"
        ],
        "summary": "Buscar Contribuyentes por Nombre Comercial (máximo 10 resultados)",
        "description": "Buscar Contribuyentes por Nombre Comercial (máximo 10 resultados)",
        "parameters": [
          {
            "name": "term",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContribuyenteDGII"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContribuyenteDGII"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContribuyenteDGII"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable"
          }
        }
      }
    },
    "/api/DGII/empresas/sitemap": {
      "get": {
        "tags": [
          "DGII"
        ],
        "summary": "Listado paginado de empresas (personas juridicas) para sitemaps",
        "description": "Solo personas juridicas (RNC de 9 digitos que empieza con 1 o 4). Las personas fisicas se excluyen. Maximo 10,000 por pagina.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 5000
            }
          },
          {
            "name": "soloActivos",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmpresasSitemapPage"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmpresasSitemapPage"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmpresasSitemapPage"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContribuyenteDGII": {
        "type": "object",
        "properties": {
          "rnc": {
            "type": "string",
            "nullable": true
          },
          "nombreCompleto": {
            "type": "string",
            "nullable": true
          },
          "nombreComercial": {
            "type": "string",
            "nullable": true
          },
          "actividad": {
            "type": "string",
            "nullable": true
          },
          "fechaRegistro": {
            "type": "string",
            "nullable": true
          },
          "estado": {
            "type": "string",
            "nullable": true
          },
          "categoria": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EmpresaSitemapItem": {
        "type": "object",
        "properties": {
          "rnc": {
            "type": "string",
            "nullable": true
          },
          "nombre": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EmpresasSitemapPage": {
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalItems": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmpresaSitemapItem"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      }
    }
  }
}