{
  "openapi": "3.0.3",
  "info": {
    "title": "SintegrAPI — Calculadora da Reforma Tributária via API",
    "version": "1.0.0",
    "description": "API da calculadora da reforma tributária com consultas ilimitadas, sem franquia mensal, para clientes com plano pago vigente, inclusive com saldo zero, e clientes pós-pagos habilitados. Free Tier e bônus gratuito não concedem acesso. Sem desconto de créditos ou cobrança adicional no pós-pago. O limite de frequência segue o plano, com padrão de 120 requisições por minuto, compartilhado entre as chaves da conta. Após mudanças no plano, aguarde até 60 segundos para atualização do acesso. JSON até 256 KiB e XML até 1 MiB. Prazo máximo de 60 segundos por requisição. Versões indisponíveis são indicadas por metadados null, com os headers correspondentes omitidos."
  },
  "servers": [
    {
      "url": "https://api.sintegrapi.com.br"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/consultas/v1/reforma-tributaria/capacidades": {
      "get": {
        "summary": "Recursos disponíveis, documentos XML e estágio beta de NFS-e",
        "tags": [
          "Reforma tributária"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Consulta concluída. success não significa compatibilidade ou XML válido; confira data.",
            "headers": {
              "X-Tax-Engine-Version": {
                "$ref": "#/components/headers/X-Tax-Engine-Version"
              },
              "X-Tax-Tables-Version": {
                "$ref": "#/components/headers/X-Tax-Tables-Version"
              },
              "X-Tax-Tables-Updated-At": {
                "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "X-Robots-Tag": {
                "$ref": "#/components/headers/X-Robots-Tag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Response"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/CapabilitiesData"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "501": {
            "$ref": "#/components/responses/Error501"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "operationId": "taxApi1"
      }
    },
    "/consultas/v1/reforma-tributaria/referencias/{tipo}": {
      "get": {
        "summary": "Referências oficiais",
        "tags": [
          "Reforma tributária"
        ],
        "parameters": [
          {
            "name": "tipo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "states",
                "municipalities",
                "documents",
                "situations",
                "classifications",
                "legal_grounds",
                "nomenclature",
                "government_reductions",
                "selective_situations",
                "selective_classifications"
              ]
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Obrigatória exceto para states, municipalities e government_reductions."
          },
          {
            "name": "argument",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 24
            }
          },
          {
            "name": "classification",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{6}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. success não significa compatibilidade ou XML válido; confira data.",
            "headers": {
              "X-Tax-Engine-Version": {
                "$ref": "#/components/headers/X-Tax-Engine-Version"
              },
              "X-Tax-Tables-Version": {
                "$ref": "#/components/headers/X-Tax-Tables-Version"
              },
              "X-Tax-Tables-Updated-At": {
                "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "X-Robots-Tag": {
                "$ref": "#/components/headers/X-Robots-Tag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "501": {
            "$ref": "#/components/responses/Error501"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "operationId": "taxApi2"
      }
    },
    "/consultas/v1/reforma-tributaria/classificacoes": {
      "get": {
        "summary": "Pesquisa paginada de CST/cClassTrib",
        "tags": [
          "Reforma tributária"
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "cst",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{3}$"
            }
          },
          {
            "name": "document",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 24
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. success não significa compatibilidade ou XML válido; confira data.",
            "headers": {
              "X-Tax-Engine-Version": {
                "$ref": "#/components/headers/X-Tax-Engine-Version"
              },
              "X-Tax-Tables-Version": {
                "$ref": "#/components/headers/X-Tax-Tables-Version"
              },
              "X-Tax-Tables-Updated-At": {
                "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "X-Robots-Tag": {
                "$ref": "#/components/headers/X-Robots-Tag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Response"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/ClassificationSearchData"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "501": {
            "$ref": "#/components/responses/Error501"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "operationId": "taxApi3"
      }
    },
    "/consultas/v1/reforma-tributaria/classificacoes/{codigo}": {
      "get": {
        "summary": "Detalhes e fundamentação",
        "tags": [
          "Reforma tributária"
        ],
        "parameters": [
          {
            "name": "codigo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{6}$"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. success não significa compatibilidade ou XML válido; confira data.",
            "headers": {
              "X-Tax-Engine-Version": {
                "$ref": "#/components/headers/X-Tax-Engine-Version"
              },
              "X-Tax-Tables-Version": {
                "$ref": "#/components/headers/X-Tax-Tables-Version"
              },
              "X-Tax-Tables-Updated-At": {
                "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "X-Robots-Tag": {
                "$ref": "#/components/headers/X-Robots-Tag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Response"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/ClassificationDetailData"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "501": {
            "$ref": "#/components/responses/Error501"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "operationId": "taxApi4"
      }
    },
    "/consultas/v1/reforma-tributaria/calcular-ibs-cbs": {
      "post": {
        "summary": "Calcular IBS/CBS com até 100 itens",
        "tags": [
          "Reforma tributária"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Consulta concluída. success não significa compatibilidade ou XML válido; confira data.",
            "headers": {
              "X-Tax-Engine-Version": {
                "$ref": "#/components/headers/X-Tax-Engine-Version"
              },
              "X-Tax-Tables-Version": {
                "$ref": "#/components/headers/X-Tax-Tables-Version"
              },
              "X-Tax-Tables-Updated-At": {
                "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "X-Robots-Tag": {
                "$ref": "#/components/headers/X-Robots-Tag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "501": {
            "$ref": "#/components/responses/Error501"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxOperationInput"
              }
            }
          }
        },
        "operationId": "taxApi5"
      }
    },
    "/consultas/v1/reforma-tributaria/verificar-ncm-nbs": {
      "post": {
        "summary": "Verificar compatibilidade NCM/NBS",
        "tags": [
          "Reforma tributária"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Consulta concluída. success não significa compatibilidade ou XML válido; confira data.",
            "headers": {
              "X-Tax-Engine-Version": {
                "$ref": "#/components/headers/X-Tax-Engine-Version"
              },
              "X-Tax-Tables-Version": {
                "$ref": "#/components/headers/X-Tax-Tables-Version"
              },
              "X-Tax-Tables-Updated-At": {
                "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "X-Robots-Tag": {
                "$ref": "#/components/headers/X-Robots-Tag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Response"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/CompatibilityData"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "501": {
            "$ref": "#/components/responses/Error501"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompatibilityInput"
              }
            }
          }
        },
        "operationId": "taxApi6"
      }
    },
    "/consultas/v1/reforma-tributaria/xml/gerar/{documento}": {
      "post": {
        "summary": "Gerar grupos XML a partir de cálculo oficial",
        "tags": [
          "Reforma tributária"
        ],
        "parameters": [
          {
            "name": "documento",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Mnemonico presente em generation_documents de capacidades."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. success não significa compatibilidade ou XML válido; confira data.",
            "headers": {
              "X-Tax-Engine-Version": {
                "$ref": "#/components/headers/X-Tax-Engine-Version"
              },
              "X-Tax-Tables-Version": {
                "$ref": "#/components/headers/X-Tax-Tables-Version"
              },
              "X-Tax-Tables-Updated-At": {
                "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "X-Robots-Tag": {
                "$ref": "#/components/headers/X-Robots-Tag"
              }
            },
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "501": {
            "$ref": "#/components/responses/Error501"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxOperationInput"
              }
            }
          }
        },
        "operationId": "taxApi7"
      }
    },
    "/consultas/v1/reforma-tributaria/xml/validar/{documento}": {
      "post": {
        "summary": "Validar grupo ou documento XML UTF-8",
        "tags": [
          "Reforma tributária"
        ],
        "parameters": [
          {
            "name": "documento",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Mnemonico presente em validation_documents de capacidades."
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "grupo",
                "nota"
              ],
              "default": "grupo"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. success não significa compatibilidade ou XML válido; confira data.",
            "headers": {
              "X-Tax-Engine-Version": {
                "$ref": "#/components/headers/X-Tax-Engine-Version"
              },
              "X-Tax-Tables-Version": {
                "$ref": "#/components/headers/X-Tax-Tables-Version"
              },
              "X-Tax-Tables-Updated-At": {
                "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "X-Robots-Tag": {
                "$ref": "#/components/headers/X-Robots-Tag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Response"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "boolean"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "501": {
            "$ref": "#/components/responses/Error501"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/xml": {
              "schema": {
                "type": "string",
                "description": "Até 1 MiB UTF-8. DTD, entidades externas e referências remotas são proibidos."
              }
            }
          }
        },
        "operationId": "taxApi8"
      }
    },
    "/consultas/v1/reforma-tributaria/nfse/{acao}": {
      "post": {
        "summary": "Assistente NFS-e beta",
        "tags": [
          "Reforma tributária"
        ],
        "parameters": [
          {
            "name": "acao",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "classifications",
                "indicators",
                "validate_indicator",
                "operation_location",
                "tax_base"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consulta concluída. success não significa compatibilidade ou XML válido; confira data.",
            "headers": {
              "X-Tax-Engine-Version": {
                "$ref": "#/components/headers/X-Tax-Engine-Version"
              },
              "X-Tax-Tables-Version": {
                "$ref": "#/components/headers/X-Tax-Tables-Version"
              },
              "X-Tax-Tables-Updated-At": {
                "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "X-Robots-Tag": {
                "$ref": "#/components/headers/X-Robots-Tag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "413": {
            "$ref": "#/components/responses/Error413"
          },
          "415": {
            "$ref": "#/components/responses/Error415"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "501": {
            "$ref": "#/components/responses/Error501"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NfseInput"
              }
            }
          }
        },
        "operationId": "taxApi9"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "TaxOperationInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "readOnly": true,
            "description": "Identificador da operação, preenchido automaticamente."
          },
          "versao": {
            "type": "string",
            "readOnly": true,
            "description": "Versão do formato da operação (ROC), atualmente 0.0.1, preenchida automaticamente. Consulte metadata.engine_version para a versão do motor."
          },
          "dhFatoGerador": {
            "type": "string",
            "format": "date-time",
            "description": "Data/hora ISO 8601 com Z ou deslocamento UTC explícito."
          },
          "uf": {
            "type": "string"
          },
          "municipio": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9999999
          },
          "tpDoc": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 999
          },
          "gCompraGov": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GovernmentPurchaseInput"
              }
            ],
            "nullable": true
          },
          "itens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxOperationItem"
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "required": [
          "dhFatoGerador",
          "uf",
          "municipio",
          "tpDoc",
          "itens"
        ],
        "additionalProperties": false
      },
      "TaxOperationItem": {
        "type": "object",
        "properties": {
          "numero": {
            "type": "integer",
            "format": "int32",
            "readOnly": true,
            "description": "Posição do item na operação, preenchida automaticamente em sequência a partir de 1."
          },
          "ncm": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9]{8}$"
          },
          "nbs": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9]{9}$"
          },
          "cst": {
            "type": "string",
            "pattern": "^[0-9]{3}$"
          },
          "cClassTrib": {
            "type": "string",
            "pattern": "^[0-9]{6}$"
          },
          "baseCalculo": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "quantidade": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "unidade": {
            "type": "string",
            "nullable": true
          },
          "tributacaoRegular": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RegularTaxInput"
              }
            ],
            "nullable": true
          },
          "impostoSeletivo": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SelectiveTaxInput"
              }
            ],
            "nullable": true
          },
          "gComponentesBC": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TaxBaseComponents"
              }
            ],
            "nullable": true
          },
          "aliquotasNominais": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NominalTaxRates"
              }
            ],
            "nullable": true
          }
        },
        "required": [
          "cst",
          "cClassTrib"
        ],
        "additionalProperties": false,
        "description": "Informe baseCalculo, gComponentesBC ou impostoSeletivo. NCM e NBS são alternativos. Campos opcionais ausentes não são convertidos em zero."
      },
      "NominalTaxRates": {
        "type": "object",
        "properties": {
          "cbs": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "ibsEstadual": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "ibsMunicipal": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "impostoSeletivo": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NominalSelectiveTaxRates"
              }
            ],
            "nullable": true
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "NominalSelectiveTaxRates": {
        "type": "object",
        "properties": {
          "adValorem": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "adRem": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "GovernmentPurchaseInput": {
        "type": "object",
        "properties": {
          "tpEnteGov": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 6
          },
          "tpOperGov": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 5
          }
        },
        "required": [
          "tpEnteGov",
          "tpOperGov"
        ],
        "additionalProperties": false
      },
      "RegularTaxInput": {
        "type": "object",
        "properties": {
          "cst": {
            "type": "string",
            "pattern": "^[0-9]{3}$"
          },
          "cClassTrib": {
            "type": "string",
            "pattern": "^[0-9]{6}$"
          }
        },
        "required": [
          "cst",
          "cClassTrib"
        ],
        "additionalProperties": false
      },
      "SelectiveTaxInput": {
        "type": "object",
        "properties": {
          "cst": {
            "type": "string",
            "pattern": "^[0-9]{3}$"
          },
          "cClassTrib": {
            "type": "string",
            "pattern": "^[0-9]{6}$"
          },
          "baseCalculo": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático."
          },
          "quantidade": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "unidade": {
            "type": "string",
            "nullable": true
          },
          "impostoInformado": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          }
        },
        "required": [
          "cst",
          "cClassTrib",
          "baseCalculo"
        ],
        "additionalProperties": false
      },
      "TaxBaseComponents": {
        "type": "object",
        "properties": {
          "vProd": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vFrete": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vSeg": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vOutro": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vII": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vIS": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vDesc": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vPIS": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vCOFINS": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vICMS": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vICMSUFDest": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vICMSMono": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vFCP": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vFCPUFDest": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          },
          "vISSQN": {
            "type": "number",
            "description": "Valor decimal em formato JSON, sem aspas. Valores com precisão não suportada são rejeitados, sem arredondamento automático.",
            "nullable": true
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "CompatibilityInput": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "kind": {
            "type": "string",
            "enum": [
              "ncm",
              "nbs"
            ],
            "default": "ncm"
          },
          "code": {
            "type": "string",
            "pattern": "^[0-9]{8,9}$"
          },
          "classification": {
            "type": "string",
            "pattern": "^[0-9]{6}$"
          }
        },
        "required": [
          "date",
          "code",
          "classification"
        ],
        "additionalProperties": false
      },
      "NfseInput": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "nbs": {
            "type": "string",
            "pattern": "^[0-9]{9}$"
          },
          "classification": {
            "type": "string",
            "pattern": "^[0-9]{6}$"
          },
          "indicator": {
            "type": "string",
            "pattern": "^[0-9]{6}$"
          },
          "national_tax_code": {
            "type": "string",
            "pattern": "^(?:[0-9]{4}|[0-9]{6})$"
          },
          "service_value": {
            "type": "number",
            "nullable": true
          },
          "discount": {
            "type": "number",
            "nullable": true
          },
          "reimbursements": {
            "type": "number",
            "nullable": true
          },
          "deductions": {
            "type": "number",
            "nullable": true
          },
          "iss": {
            "type": "number",
            "nullable": true
          },
          "pis": {
            "type": "number",
            "nullable": true
          },
          "cofins": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "date"
        ],
        "additionalProperties": false,
        "description": "classifications exige nbs; validate_indicator exige nbs, classification e indicator; operation_location exige indicator; tax_base exige service_value. Indicadores aceitam nbs opcional. Recursos beta."
      },
      "Metadata": {
        "type": "object",
        "properties": {
          "engine_version": {
            "type": "string",
            "nullable": true
          },
          "tax_tables_version": {
            "type": "string",
            "nullable": true
          },
          "tax_tables_updated_at": {
            "type": "string",
            "nullable": true,
            "format": "date"
          }
        },
        "required": [
          "engine_version",
          "tax_tables_version",
          "tax_tables_updated_at"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "Response": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "success": {
            "type": "boolean"
          },
          "error": {
            "type": "boolean"
          },
          "error_message": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Error"
              }
            ],
            "nullable": true
          },
          "data": {
            "nullable": true,
            "description": "Resultado oficial preservado; pode ser objeto, lista, booleano ou null. Na compatibilidade contém status e response."
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        },
        "required": [
          "request_id",
          "success",
          "error",
          "error_message",
          "data",
          "metadata"
        ],
        "additionalProperties": false
      },
      "XmlDocumentType": {
        "type": "object",
        "required": [
          "nome",
          "mnemonico"
        ],
        "properties": {
          "nome": {
            "type": "string"
          },
          "mnemonico": {
            "type": "string"
          },
          "versao_nota_tecnica": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CapabilitiesData": {
        "type": "object",
        "properties": {
          "calculation": {
            "type": "boolean"
          },
          "classifications": {
            "type": "boolean"
          },
          "classification_details": {
            "type": "boolean"
          },
          "references": {
            "type": "object",
            "properties": {
              "states": {
                "type": "boolean"
              },
              "municipalities": {
                "type": "boolean"
              },
              "documents": {
                "type": "boolean"
              },
              "situations": {
                "type": "boolean"
              },
              "classifications": {
                "type": "boolean"
              },
              "legal_grounds": {
                "type": "boolean"
              },
              "nomenclature": {
                "type": "boolean"
              },
              "government_reductions": {
                "type": "boolean"
              },
              "selective_situations": {
                "type": "boolean"
              },
              "selective_classifications": {
                "type": "boolean"
              }
            },
            "required": [
              "states",
              "municipalities",
              "documents",
              "situations",
              "classifications",
              "legal_grounds",
              "nomenclature",
              "government_reductions",
              "selective_situations",
              "selective_classifications"
            ],
            "additionalProperties": false
          },
          "compatibility": {
            "type": "object",
            "properties": {
              "ncm": {
                "type": "boolean"
              },
              "nbs": {
                "type": "boolean"
              }
            },
            "required": [
              "ncm",
              "nbs"
            ],
            "additionalProperties": false
          },
          "generation_documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/XmlDocumentType"
            }
          },
          "validation_documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/XmlDocumentType"
            }
          },
          "xml_generation": {
            "type": "boolean"
          },
          "xml_validation": {
            "type": "boolean"
          },
          "nfse": {
            "type": "object",
            "properties": {
              "stage": {
                "type": "string",
                "enum": [
                  "beta"
                ]
              },
              "classifications": {
                "type": "boolean"
              },
              "indicators": {
                "type": "boolean"
              },
              "validate_indicator": {
                "type": "boolean"
              },
              "operation_location": {
                "type": "boolean"
              },
              "tax_base": {
                "type": "boolean"
              }
            },
            "required": [
              "stage",
              "classifications",
              "indicators",
              "validate_indicator",
              "operation_location",
              "tax_base"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "calculation",
          "classifications",
          "classification_details",
          "references",
          "compatibility",
          "generation_documents",
          "validation_documents",
          "xml_generation",
          "xml_validation",
          "nfse"
        ],
        "additionalProperties": false
      },
      "ClassificationSearchData": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {}
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer",
            "enum": [
              25
            ]
          }
        },
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "additionalProperties": false
      },
      "ClassificationDetailData": {
        "type": "object",
        "properties": {
          "classification": {},
          "legal_grounds": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "classification",
          "legal_grounds"
        ],
        "additionalProperties": false
      },
      "CompatibilityData": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "compatible",
              "incompatible",
              "insufficient_data",
              "unsupported",
              "unavailable"
            ]
          },
          "response": {
            "nullable": true
          }
        },
        "required": [
          "status",
          "response"
        ],
        "additionalProperties": false
      }
    },
    "responses": {
      "Error400": {
        "description": "Entrada inválida",
        "headers": {
          "X-Tax-Engine-Version": {
            "$ref": "#/components/headers/X-Tax-Engine-Version"
          },
          "X-Tax-Tables-Version": {
            "$ref": "#/components/headers/X-Tax-Tables-Version"
          },
          "X-Tax-Tables-Updated-At": {
            "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/Cache-Control"
          },
          "X-Robots-Tag": {
            "$ref": "#/components/headers/X-Robots-Tag"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Response"
            }
          }
        }
      },
      "Error401": {
        "description": "API key ausente/inválida",
        "headers": {
          "X-Tax-Engine-Version": {
            "$ref": "#/components/headers/X-Tax-Engine-Version"
          },
          "X-Tax-Tables-Version": {
            "$ref": "#/components/headers/X-Tax-Tables-Version"
          },
          "X-Tax-Tables-Updated-At": {
            "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/Cache-Control"
          },
          "X-Robots-Tag": {
            "$ref": "#/components/headers/X-Robots-Tag"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Response"
            }
          }
        }
      },
      "Error403": {
        "description": "Plano pago necessário",
        "headers": {
          "X-Tax-Engine-Version": {
            "$ref": "#/components/headers/X-Tax-Engine-Version"
          },
          "X-Tax-Tables-Version": {
            "$ref": "#/components/headers/X-Tax-Tables-Version"
          },
          "X-Tax-Tables-Updated-At": {
            "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/Cache-Control"
          },
          "X-Robots-Tag": {
            "$ref": "#/components/headers/X-Robots-Tag"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Response"
            }
          }
        }
      },
      "Error413": {
        "description": "Corpo excedido",
        "headers": {
          "X-Tax-Engine-Version": {
            "$ref": "#/components/headers/X-Tax-Engine-Version"
          },
          "X-Tax-Tables-Version": {
            "$ref": "#/components/headers/X-Tax-Tables-Version"
          },
          "X-Tax-Tables-Updated-At": {
            "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/Cache-Control"
          },
          "X-Robots-Tag": {
            "$ref": "#/components/headers/X-Robots-Tag"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Response"
            }
          }
        }
      },
      "Error415": {
        "description": "Formato não suportado",
        "headers": {
          "X-Tax-Engine-Version": {
            "$ref": "#/components/headers/X-Tax-Engine-Version"
          },
          "X-Tax-Tables-Version": {
            "$ref": "#/components/headers/X-Tax-Tables-Version"
          },
          "X-Tax-Tables-Updated-At": {
            "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/Cache-Control"
          },
          "X-Robots-Tag": {
            "$ref": "#/components/headers/X-Robots-Tag"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Response"
            }
          }
        }
      },
      "Error429": {
        "description": "Limite excedido",
        "headers": {
          "X-Tax-Engine-Version": {
            "$ref": "#/components/headers/X-Tax-Engine-Version"
          },
          "X-Tax-Tables-Version": {
            "$ref": "#/components/headers/X-Tax-Tables-Version"
          },
          "X-Tax-Tables-Updated-At": {
            "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/Cache-Control"
          },
          "X-Robots-Tag": {
            "$ref": "#/components/headers/X-Robots-Tag"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Response"
            }
          }
        }
      },
      "Error500": {
        "description": "Não foi possível concluir a solicitação; informe request_id ao suporte.",
        "headers": {
          "X-Tax-Engine-Version": {
            "$ref": "#/components/headers/X-Tax-Engine-Version"
          },
          "X-Tax-Tables-Version": {
            "$ref": "#/components/headers/X-Tax-Tables-Version"
          },
          "X-Tax-Tables-Updated-At": {
            "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/Cache-Control"
          },
          "X-Robots-Tag": {
            "$ref": "#/components/headers/X-Robots-Tag"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Response"
            }
          }
        }
      },
      "Error501": {
        "description": "Capacidade não suportada",
        "headers": {
          "X-Tax-Engine-Version": {
            "$ref": "#/components/headers/X-Tax-Engine-Version"
          },
          "X-Tax-Tables-Version": {
            "$ref": "#/components/headers/X-Tax-Tables-Version"
          },
          "X-Tax-Tables-Updated-At": {
            "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/Cache-Control"
          },
          "X-Robots-Tag": {
            "$ref": "#/components/headers/X-Robots-Tag"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Response"
            }
          }
        }
      },
      "Error503": {
        "description": "Serviço temporariamente indisponível ou prazo de resposta excedido.",
        "headers": {
          "X-Tax-Engine-Version": {
            "$ref": "#/components/headers/X-Tax-Engine-Version"
          },
          "X-Tax-Tables-Version": {
            "$ref": "#/components/headers/X-Tax-Tables-Version"
          },
          "X-Tax-Tables-Updated-At": {
            "$ref": "#/components/headers/X-Tax-Tables-Updated-At"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/Cache-Control"
          },
          "X-Robots-Tag": {
            "$ref": "#/components/headers/X-Robots-Tag"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Response"
            }
          }
        }
      }
    },
    "headers": {
      "X-Tax-Engine-Version": {
        "description": "Mesmo valor de metadata.engine_version; omitido quando não confirmado.",
        "schema": {
          "type": "string"
        }
      },
      "X-Tax-Tables-Version": {
        "description": "Mesmo valor de metadata.tax_tables_version; omitido quando não confirmado.",
        "schema": {
          "type": "string"
        }
      },
      "X-Tax-Tables-Updated-At": {
        "description": "Data de atualização das tabelas informada pela fonte oficial, no formato YYYY-MM-DD.",
        "schema": {
          "type": "string"
        }
      },
      "X-Request-Id": {
        "description": "Identificador da requisição para atendimento pelo suporte.",
        "schema": {
          "type": "string"
        }
      },
      "Cache-Control": {
        "description": "no-store",
        "schema": {
          "type": "string"
        }
      },
      "X-Robots-Tag": {
        "description": "noindex, nofollow",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "Segundos até nova tentativa.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      }
    }
  }
}
