{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/foxnfe-com-br/json-schema/foxnfe-com-br-post-api-v1-companies-request-schema.json",
  "title": "post_api_v1_companiesRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": [
    "app/app/Modules/Tenant/Http/Controllers/CompanyController.php:39"
  ],
  "type": "object",
  "properties": {
    "cnpj": {
      "x-laravel-rules": [
        "required",
        "string",
        "max:18"
      ],
      "type": "string",
      "maxLength": 18
    },
    "razao_social": {
      "x-laravel-rules": [
        "required",
        "string",
        "max:255"
      ],
      "type": "string",
      "maxLength": 255
    },
    "nome_fantasia": {
      "x-laravel-rules": [
        "sometimes",
        "nullable",
        "string",
        "max:255"
      ],
      "type": [
        "string",
        "null"
      ],
      "maxLength": 255
    },
    "inscricao_estadual": {
      "x-laravel-rules": [
        "sometimes",
        "nullable",
        "string",
        "max:60"
      ],
      "type": [
        "string",
        "null"
      ],
      "maxLength": 60
    },
    "inscricao_municipal": {
      "x-laravel-rules": [
        "sometimes",
        "nullable",
        "string",
        "max:20"
      ],
      "type": [
        "string",
        "null"
      ],
      "maxLength": 20
    },
    "crt": {
      "x-laravel-rules": [
        "sometimes",
        "integer",
        "in:1,2,3,4"
      ],
      "type": "integer",
      "enum": [
        1,
        2,
        3,
        4
      ]
    },
    "endereco": {
      "x-laravel-rules": [
        "sometimes",
        "nullable",
        "array"
      ],
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "logradouro": {
          "x-laravel-rules": [
            "sometimes",
            "string",
            "max:255"
          ],
          "type": "string",
          "maxLength": 255
        },
        "numero": {
          "x-laravel-rules": [
            "sometimes",
            "string",
            "max:60"
          ],
          "type": "string",
          "maxLength": 60
        },
        "bairro": {
          "x-laravel-rules": [
            "sometimes",
            "string",
            "max:255"
          ],
          "type": "string",
          "maxLength": 255
        },
        "municipio": {
          "x-laravel-rules": [
            "sometimes",
            "string",
            "max:255"
          ],
          "type": "string",
          "maxLength": 255
        },
        "uf": {
          "x-laravel-rules": [
            "sometimes",
            "string",
            "size:2"
          ],
          "type": "string",
          "minLength": 2,
          "maxLength": 2
        },
        "cep": {
          "x-laravel-rules": [
            "sometimes",
            "string",
            "max:9"
          ],
          "type": "string",
          "maxLength": 9
        }
      }
    },
    "nfe_serie_padrao": {
      "x-laravel-rules": [
        "sometimes",
        "integer",
        "min:1",
        "max:999"
      ],
      "type": "integer",
      "minimum": 1,
      "maximum": 999
    },
    "nfe_ambiente": {
      "x-laravel-rules": [
        "sometimes",
        "integer",
        "in:1,2"
      ],
      "type": "integer",
      "enum": [
        1,
        2
      ]
    },
    "cnae_principal": {
      "x-laravel-rules": [
        "sometimes",
        "nullable",
        "string",
        "max:20"
      ],
      "type": [
        "string",
        "null"
      ],
      "maxLength": 20
    },
    "is_default": {
      "x-laravel-rules": [
        "sometimes",
        "boolean"
      ],
      "type": "boolean"
    },
    "dry_run": {
      "x-laravel-rules": [
        "sometimes",
        "boolean"
      ],
      "type": "boolean"
    }
  },
  "required": [
    "cnpj",
    "razao_social"
  ]
}