{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cnpj-ai/json-schema/cnpj-ai-resposta-dados-estabelecimento-schema.json",
  "title": "Resposta[DadosEstabelecimento]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cnpj-ai-estabelecimentos-api-openapi.yml#/components/schemas/Resposta_DadosEstabelecimento_",
  "properties": {
    "dados": {
      "$ref": "#/$defs/DadosEstabelecimento"
    },
    "meta": {
      "$ref": "#/$defs/Meta"
    }
  },
  "type": "object",
  "required": [
    "dados",
    "meta"
  ],
  "$defs": {
    "DadosEstabelecimento": {
      "properties": {
        "empresa": {
          "$ref": "#/$defs/Empresa"
        },
        "estabelecimento": {
          "$ref": "#/$defs/Estabelecimento"
        }
      },
      "type": "object",
      "required": [
        "empresa",
        "estabelecimento"
      ],
      "title": "DadosEstabelecimento"
    },
    "Empresa": {
      "properties": {
        "cnpj_basico": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj Basico"
        },
        "razao_social": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Razao Social"
        },
        "natureza_juridica": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Natureza Juridica"
        },
        "qualificacao_responsavel": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Qualificacao Responsavel"
        },
        "capital_social": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Capital Social"
        },
        "porte_empresa": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Porte Empresa"
        },
        "ente_federativo_responsavel": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ente Federativo Responsavel"
        },
        "descricoes": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Descricoes",
          "description": "Descrições oficiais dos códigos presentes neste registro."
        },
        "socios": {
          "$ref": "#/$defs/Pagina_Socio_"
        },
        "simples": {
          "anyOf": [
            {
              "$ref": "#/$defs/Simples"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "cnpj_basico",
        "razao_social",
        "natureza_juridica",
        "qualificacao_responsavel",
        "capital_social",
        "porte_empresa",
        "ente_federativo_responsavel",
        "socios",
        "simples"
      ],
      "title": "Empresa"
    },
    "Estabelecimento": {
      "properties": {
        "cnpj_basico": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj Basico"
        },
        "cnpj_ordem": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj Ordem"
        },
        "cnpj_dv": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj Dv"
        },
        "identificador_matriz_filial": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Identificador Matriz Filial"
        },
        "nome_fantasia": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nome Fantasia"
        },
        "situacao_cadastral": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Situacao Cadastral"
        },
        "data_situacao_cadastral": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Situacao Cadastral"
        },
        "motivo_situacao_cadastral": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Motivo Situacao Cadastral"
        },
        "nome_cidade_exterior": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nome Cidade Exterior"
        },
        "pais": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pais"
        },
        "data_inicio_atividade": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Inicio Atividade"
        },
        "cnae_fiscal_principal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnae Fiscal Principal"
        },
        "cnae_fiscal_secundaria": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnae Fiscal Secundaria"
        },
        "tipo_logradouro": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tipo Logradouro"
        },
        "logradouro": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Logradouro"
        },
        "numero": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Numero"
        },
        "complemento": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Complemento"
        },
        "bairro": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bairro"
        },
        "cep": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cep"
        },
        "uf": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Uf"
        },
        "municipio": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Municipio"
        },
        "ddd1": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ddd1"
        },
        "telefone1": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Telefone1"
        },
        "ddd2": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ddd2"
        },
        "telefone2": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Telefone2"
        },
        "ddd_fax": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ddd Fax"
        },
        "fax": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fax"
        },
        "correio_eletronico": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Correio Eletronico"
        },
        "situacao_especial": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Situacao Especial"
        },
        "data_situacao_especial": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Situacao Especial"
        },
        "cnpj": {
          "type": "string",
          "title": "Cnpj"
        },
        "descricoes": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Descricoes",
          "description": "Descrições oficiais dos códigos presentes neste registro."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "cnpj_basico",
        "cnpj_ordem",
        "cnpj_dv",
        "identificador_matriz_filial",
        "nome_fantasia",
        "situacao_cadastral",
        "data_situacao_cadastral",
        "motivo_situacao_cadastral",
        "nome_cidade_exterior",
        "pais",
        "data_inicio_atividade",
        "cnae_fiscal_principal",
        "cnae_fiscal_secundaria",
        "tipo_logradouro",
        "logradouro",
        "numero",
        "complemento",
        "bairro",
        "cep",
        "uf",
        "municipio",
        "ddd1",
        "telefone1",
        "ddd2",
        "telefone2",
        "ddd_fax",
        "fax",
        "correio_eletronico",
        "situacao_especial",
        "data_situacao_especial",
        "cnpj"
      ],
      "title": "Estabelecimento"
    },
    "Meta": {
      "properties": {
        "versao": {
          "type": "string",
          "const": "v2",
          "title": "Versao",
          "default": "v2"
        },
        "release": {
          "type": "string",
          "const": "2.0.0",
          "title": "Release",
          "default": "2.0.0"
        },
        "recurso": {
          "type": "string",
          "enum": [
            "empresas",
            "estabelecimentos"
          ],
          "title": "Recurso"
        },
        "documento": {
          "type": "string",
          "title": "Documento"
        },
        "competencia_receita": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Competencia Receita"
        },
        "fotografia": {
          "type": "string",
          "title": "Fotografia"
        },
        "requisicao_id": {
          "type": "string",
          "format": "uuid",
          "title": "Requisicao Id"
        },
        "disponibilidade": {
          "type": "string",
          "enum": [
            "completa",
            "parcial"
          ],
          "title": "Disponibilidade",
          "default": "completa"
        }
      },
      "type": "object",
      "required": [
        "recurso",
        "documento",
        "competencia_receita",
        "fotografia",
        "requisicao_id"
      ],
      "title": "Meta"
    },
    "Pagina_Socio_": {
      "properties": {
        "itens": {
          "items": {
            "$ref": "#/$defs/Socio"
          },
          "type": "array",
          "title": "Itens"
        },
        "total": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total"
        },
        "proximo_cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Proximo Cursor"
        },
        "proxima_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Proxima Url"
        }
      },
      "type": "object",
      "required": [
        "itens",
        "total"
      ],
      "title": "Pagina[Socio]"
    },
    "Simples": {
      "properties": {
        "cnpj_basico": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj Basico"
        },
        "opcao_simples": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Opcao Simples"
        },
        "data_opcao_simples": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Opcao Simples"
        },
        "data_exclusao_simples": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Exclusao Simples"
        },
        "opcao_mei": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Opcao Mei"
        },
        "data_opcao_mei": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Opcao Mei"
        },
        "data_exclusao_mei": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Exclusao Mei"
        },
        "descricoes": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Descricoes",
          "description": "Descrições oficiais dos códigos presentes neste registro."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "cnpj_basico",
        "opcao_simples",
        "data_opcao_simples",
        "data_exclusao_simples",
        "opcao_mei",
        "data_opcao_mei",
        "data_exclusao_mei"
      ],
      "title": "Simples"
    },
    "Socio": {
      "properties": {
        "cnpj_basico": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cnpj Basico"
        },
        "identificador_socio": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Identificador Socio"
        },
        "nome_socio_razao_social": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nome Socio Razao Social"
        },
        "cpf_cnpj_socio": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cpf Cnpj Socio"
        },
        "qualificacao_socio": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Qualificacao Socio"
        },
        "data_entrada_sociedade": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Entrada Sociedade"
        },
        "pais": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pais"
        },
        "representante_legal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Representante Legal"
        },
        "nome_representante": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nome Representante"
        },
        "qualificacao_representante_legal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Qualificacao Representante Legal"
        },
        "faixa_etaria": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Faixa Etaria"
        },
        "descricoes": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Descricoes",
          "description": "Descrições oficiais dos códigos presentes neste registro."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "cnpj_basico",
        "identificador_socio",
        "nome_socio_razao_social",
        "cpf_cnpj_socio",
        "qualificacao_socio",
        "data_entrada_sociedade",
        "pais",
        "representante_legal",
        "nome_representante",
        "qualificacao_representante_legal",
        "faixa_etaria"
      ],
      "title": "Socio"
    }
  }
}