{
  "info": {
    "_postman_id": "f1c2d3e4-a5b6-7c8d-9e0f-1a2b3c4d5e6f",
    "name": "Fiscum Classifica API",
    "description": "Motor de regras fiscais tributárias brasileiras via API REST.\n\n**Versão:** 1.0.0\n\n**Base URL:** `https://api.fiscum.com.br`\n\n**Documentação:** https://fiscum.com.br/docs\n\n**MCP Server:** https://mcp.fiscum.com.br\n\nO Fiscum Classifica recebe NCM ou GTIN/EAN e retorna as regras fiscais completas para emissão de NF-e/NFC-e, incluindo ICMS por UF, PIS/COFINS, IPI, CEST e os novos tributos da Reforma Tributária (CBS/IBS).\n\n## Autenticação\n\nTodas as requisições (exceto Health Check) exigem API Key:\n\n- Header `X-API-Key: fsc_live_...`\n- Ou `Authorization: Bearer fsc_live_...`\n\nPreencha a variável `apiKey` no environment selecionado.\n\n## Limites\n\n- Máximo 500 produtos por requisição em POST /v1/regras-fiscais.\n- Rate limiting por parceiro (token bucket).\n\n## Variáveis\n\n| Variável | Descrição |\n|---|---|\n| `baseUrl` | URL base da API |\n| `apiKey` | Sua API Key (fsc_live_...) |\n| `cnpj` | CNPJ da empresa consultante |",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.fiscum.com.br",
      "type": "string",
      "description": "URL base da API Fiscum"
    },
    {
      "key": "apiKey",
      "value": "",
      "type": "string",
      "description": "API Key (formato: fsc_live_... ou fsc_test_...)"
    },
    {
      "key": "cnpj",
      "value": "",
      "type": "string",
      "description": "CNPJ da empresa consultante (14 dígitos, sem pontuação)"
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-API-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{apiKey}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Auth",
      "description": "Gerenciamento de API Keys",
      "item": [
        {
          "name": "Rotacionar API Key",
          "description": "Gera uma nova API Key para o parceiro autenticado, invalidando a anterior. A chave completa é exibida apenas uma vez na resposta.\n\nA nova chave é salva automaticamente na variável `apiKey`.",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 201', () => pm.response.to.have.status(201));",
                  "",
                  "if (pm.response.code === 201) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has api_key', () => pm.expect(json.api_key).to.be.a('string'));",
                  "    pm.test('Has prefix', () => pm.expect(json.prefix).to.be.a('string'));",
                  "",
                  "    pm.collectionVariables.set('apiKey', json.api_key);",
                  "    console.log('Nova API Key salva: ' + json.prefix + '...');",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/api-key/gerar",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "auth", "api-key", "gerar"]
            }
          }
        },
        {
          "name": "Revogar API Key",
          "description": "Revoga a API Key do parceiro autenticado. Após revogar, nenhuma requisição será possível até gerar uma nova chave.",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has mensagem', () => pm.expect(json.mensagem).to.be.a('string'));",
                  "    pm.collectionVariables.set('apiKey', '');",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/api-key/:id",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "auth", "api-key", ":id"],
              "variable": [
                {
                  "key": "id",
                  "value": "00000000-0000-0000-0000-000000000000",
                  "description": "ID (UUID) do parceiro"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Regras Fiscais",
      "description": "Consulta principal de regras fiscais tributárias",
      "item": [
        {
          "name": "Consultar Regras - Lucro Real",
          "description": "Consulta regras fiscais para empresa no regime Lucro Real (regimeTrib=R, crt=3).",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has grupo', () => pm.expect(json.grupo).to.be.an('array'));",
                  "    pm.test('Has cabecalho', () => pm.expect(json.cabecalho).to.be.an('object'));",
                  "    pm.test('Mensagem OK', () => pm.expect(json.cabecalho.mensagem).to.include('OK'));",
                  "    pm.test('Has _fiscum', () => pm.expect(json._fiscum).to.be.an('object'));",
                  "    pm.test('Has ibptax', () => pm.expect(json.grupo[0].ibptax).to.be.an('object'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"cabecalho\": {\n    \"cnpj\": \"{{cnpj}}\",\n    \"cnae\": \"4711302\",\n    \"crt\": 3,\n    \"codFaixa\": 99,\n    \"regimeTrib\": \"R\",\n    \"amb\": 1,\n    \"contribuinte\": 1\n  },\n  \"uf\": [\"SP\", \"MG\"],\n  \"produto\": [\n    {\n      \"codigo\": \"7891000315507\",\n      \"descricao\": \"NESCAFE CAFE SOLUVEL 100G\",\n      \"ncm\": \"21011110\",\n      \"tipoCodigo\": 0\n    }\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/regras-fiscais",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "regras-fiscais"]
            }
          }
        },
        {
          "name": "Consultar Regras - Lucro Presumido",
          "description": "Consulta regras fiscais para empresa no regime Lucro Presumido (regimeTrib=P, crt=3).",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has grupo', () => pm.expect(json.grupo).to.be.an('array'));",
                  "    pm.test('Has cabecalho', () => pm.expect(json.cabecalho).to.be.an('object'));",
                  "    pm.test('Mensagem OK', () => pm.expect(json.cabecalho.mensagem).to.include('OK'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"cabecalho\": {\n    \"cnpj\": \"{{cnpj}}\",\n    \"cnae\": \"4711302\",\n    \"crt\": 3,\n    \"regimeTrib\": \"P\",\n    \"amb\": 1,\n    \"contribuinte\": 1,\n    \"ufOrigem\": \"SP\"\n  },\n  \"uf\": [\"SP\"],\n  \"produto\": [\n    {\n      \"codigo\": \"7891234567890\",\n      \"descricao\": \"ARROZ BRANCO TIPO 1 5KG\",\n      \"ncm\": \"10063021\",\n      \"tipoCodigo\": 0\n    }\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/regras-fiscais",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "regras-fiscais"]
            }
          }
        },
        {
          "name": "Consultar Regras - Simples Nacional",
          "description": "Consulta regras fiscais para empresa no Simples Nacional (regimeTrib=S, crt=1).",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has grupo', () => pm.expect(json.grupo).to.be.an('array'));",
                  "    pm.test('Has cabecalho', () => pm.expect(json.cabecalho).to.be.an('object'));",
                  "    pm.test('Mensagem OK', () => pm.expect(json.cabecalho.mensagem).to.include('OK'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"cabecalho\": {\n    \"cnpj\": \"{{cnpj}}\",\n    \"cnae\": \"4711302\",\n    \"crt\": 1,\n    \"regimeTrib\": \"S\",\n    \"amb\": 1,\n    \"contribuinte\": 0\n  },\n  \"uf\": [\"SP\"],\n  \"produto\": [\n    {\n      \"codigo\": \"7894900011517\",\n      \"descricao\": \"REFRIGERANTE COCA COLA 2L\",\n      \"ncm\": \"22021000\",\n      \"tipoCodigo\": 0,\n      \"refeicao\": \"S\"\n    }\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/regras-fiscais",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "regras-fiscais"]
            }
          }
        }
      ]
    },
    {
      "name": "NCM",
      "description": "Consulta, validação e sugestão de NCM",
      "item": [
        {
          "name": "Consultar NCM",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has ncm', () => pm.expect(json.ncm).to.be.a('string'));",
                  "    pm.test('Has descricao', () => pm.expect(json.descricao).to.be.a('string'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/ncm/:ncm",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "ncm", ":ncm"],
              "variable": [
                {
                  "key": "ncm",
                  "value": "21011110"
                }
              ]
            }
          }
        },
        {
          "name": "Validar NCM",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has valido', () => pm.expect(json.valido).to.be.a('boolean'));",
                  "    pm.test('NCM is valid', () => pm.expect(json.valido).to.be.true);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/ncm/:ncm/validar",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "ncm", ":ncm", "validar"],
              "variable": [
                {
                  "key": "ncm",
                  "value": "21011110"
                }
              ]
            }
          }
        },
        {
          "name": "Sugerir NCM",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has descricao_pesquisada', () => pm.expect(json.descricao_pesquisada).to.be.a('string'));",
                  "    pm.test('Has total', () => pm.expect(json.total).to.be.a('number'));",
                  "    pm.test('Has sugestoes array', () => pm.expect(json.sugestoes).to.be.an('array'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"descricao\": \"Arroz branco tipo 1 pacote 5kg\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/ncm/sugerir",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "ncm", "sugerir"]
            }
          }
        },
        {
          "name": "Histórico NCM",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200 or 404', () => pm.expect([200, 404]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/ncm/:ncm/historico?uf=SP",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "ncm", ":ncm", "historico"],
              "query": [
                { "key": "uf", "value": "SP" }
              ],
              "variable": [
                {
                  "key": "ncm",
                  "value": "21011110"
                }
              ]
            }
          }
        },
        {
          "name": "Reforma Tributária NCM",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200 or 404', () => pm.expect([200, 404]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/ncm/:ncm/reforma?uf=SP",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "ncm", ":ncm", "reforma"],
              "query": [
                { "key": "uf", "value": "SP" }
              ],
              "variable": [
                {
                  "key": "ncm",
                  "value": "21011110"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "GTIN",
      "description": "Validação e enriquecimento de GTIN/EAN",
      "item": [
        {
          "name": "Validar GTIN",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has valido', () => pm.expect(json.valido).to.be.a('boolean'));",
                  "    pm.test('Has gtin', () => pm.expect(json.gtin).to.be.a('string'));",
                  "    pm.test('Has formato', () => pm.expect(json.formato).to.be.a('string'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/gtin/:gtin/validar",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "gtin", ":gtin", "validar"],
              "variable": [
                {
                  "key": "gtin",
                  "value": "7891000315507"
                }
              ]
            }
          }
        },
        {
          "name": "Enriquecer GTIN",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200 or 404', () => pm.expect([200, 404]).to.include(pm.response.code));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/gtin/:gtin/enriquecer",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "gtin", ":gtin", "enriquecer"],
              "variable": [
                {
                  "key": "gtin",
                  "value": "7891000315507"
                }
              ]
            }
          }
        },
        {
          "name": "Enriquecer GTINs em Lote",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has encontrados', () => pm.expect(json.encontrados).to.be.an('array'));",
                  "    pm.test('Has total_enviados', () => pm.expect(json.total_enviados).to.be.a('number'));",
                  "    pm.test('Has total_encontrados', () => pm.expect(json.total_encontrados).to.be.a('number'));",
                  "    pm.test('Has nao_encontrados', () => pm.expect(json.nao_encontrados).to.be.an('array'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"gtins\": [\n    \"7891000315507\",\n    \"7894900011517\",\n    \"7891234567890\"\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/gtin/bulk",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "gtin", "bulk"]
            }
          }
        }
      ]
    },
    {
      "name": "Cálculos",
      "description": "Cálculos tributários (DIFAL, ICMS-ST, Transparência Fiscal, Município)",
      "item": [
        {
          "name": "Calcular DIFAL",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ncm\": \"21011110\",\n  \"uf_origem\": \"SP\",\n  \"uf_destino\": \"MG\",\n  \"valor\": 1000.00,\n  \"crt\": 3,\n  \"contribuinte\": 0\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/calcular/difal",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "calcular", "difal"]
            }
          }
        },
        {
          "name": "Calcular ICMS-ST",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ncm\": \"22021000\",\n  \"uf\": \"SP\",\n  \"valor\": 500.00,\n  \"iva\": 40.0\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/calcular/icms-st",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "calcular", "icms-st"]
            }
          }
        },
        {
          "name": "Calcular Transparência Fiscal",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ncm\": \"10063021\",\n  \"uf\": \"SP\",\n  \"valor\": 25.90\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/calcular/transparencia-fiscal",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "calcular", "transparencia-fiscal"]
            }
          }
        },
        {
          "name": "Calcular Município",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ncm\": \"10063021\",\n  \"uf\": \"SP\",\n  \"municipio_ibge\": \"3550308\",\n  \"valor\": 1000.00\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/calcular/municipio",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "calcular", "municipio"]
            }
          }
        }
      ]
    },
    {
      "name": "Produto",
      "description": "Classificação e análise de produtos",
      "item": [
        {
          "name": "Classificar Produto (Curva ABC)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"codigo\": \"PROD-001\",\n  \"descricao\": \"ARROZ BRANCO TIPO 1 5KG\",\n  \"ncm\": \"10063021\",\n  \"valor_unitario\": 25.90,\n  \"volume_vendas_mensal\": 3000\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/produto/classificar",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "produto", "classificar"]
            }
          }
        }
      ]
    },
    {
      "name": "Regime Especial",
      "description": "Consulta de regimes especiais tributários por UF",
      "item": [
        {
          "name": "Buscar Regimes Especiais",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"uf\": \"SP\",\n  \"cnae\": \"4711302\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/regime-especial/buscar",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "regime-especial", "buscar"]
            }
          }
        }
      ]
    },
    {
      "name": "Status",
      "description": "Saúde e status do sistema",
      "item": [
        {
          "name": "Health Check",
          "description": "Não requer autenticação.",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('DB ok', () => pm.expect(json.db).to.equal('ok'));",
                  "    pm.test('Has status', () => pm.expect(json.status).to.be.a('string'));",
                  "    pm.test('Has version', () => pm.expect(json.version).to.be.a('string'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/health",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "health"]
            }
          }
        },
        {
          "name": "Métricas do Sistema",
          "description": "Retorna métricas operacionais do sistema (requisições, latência, cache, uptime). Requer autenticação.",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has requests', () => pm.expect(json.requests).to.be.an('object'));",
                  "    pm.test('Has latency', () => pm.expect(json.latency).to.be.an('object'));",
                  "    pm.test('Has cache', () => pm.expect(json.cache).to.be.an('object'));",
                  "    pm.test('Has uptime', () => pm.expect(json.uptime).to.be.a('number'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/metrics",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "metrics"]
            }
          }
        },
        {
          "name": "Status Cliente",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has sucesso', () => pm.expect(json.sucesso).to.be.a('boolean'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/status-cliente/:cnpj",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "status-cliente", ":cnpj"],
              "variable": [
                {
                  "key": "cnpj",
                  "value": "{{cnpj}}"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Changelog",
      "description": "Histórico de alterações regulatórias",
      "item": [
        {
          "name": "Listar Changelog",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has alteracoes', () => pm.expect(json.alteracoes).to.be.an('array'));",
                  "    pm.test('Has total', () => pm.expect(json.total).to.be.a('number'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/changelog?page=1&limit=20&uf=SP",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "changelog"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "limit", "value": "20" },
                { "key": "uf", "value": "SP" },
                { "key": "desde", "value": "2026-01-01", "disabled": true },
                { "key": "tipo", "value": "icms", "disabled": true },
                { "key": "fonte", "value": "dou", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "Produtos Alterados",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has cabecalho', () => pm.expect(json.cabecalho).to.be.an('object'));",
                  "    pm.test('Has produto', () => pm.expect(json.produto).to.be.an('array'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nomeServico\": \"ALTERADOS\",\n  \"dados\": \"{{cnpj}}|SP|100\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/alterados",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "alterados"]
            }
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "description": "Inscrição em notificações de mudanças fiscais",
      "item": [
        {
          "name": "Inscrever Webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 201', () => pm.response.to.have.status(201));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://meusite.com.br/webhook/fiscum\",\n  \"eventos\": [\"regra.icms.alterada\", \"ncm.adicionado\"],\n  \"ufs\": [\"SP\", \"MG\"]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/subscribe",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "webhooks", "subscribe"]
            }
          }
        },
        {
          "name": "Listar Webhooks",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "webhooks"]
            }
          }
        },
        {
          "name": "Deletar Webhook",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:id",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "webhooks", ":id"],
              "variable": [
                {
                  "key": "id",
                  "value": "00000000-0000-0000-0000-000000000000"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Conta",
      "description": "Métricas de uso",
      "item": [
        {
          "name": "Métricas de Uso",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has metricas', () => pm.expect(json.metricas).to.be.an('object'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/minha-conta/uso",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "minha-conta", "uso"]
            }
          }
        }
      ]
    },
    {
      "name": "IBPT",
      "description": "Consulta de carga tributária IBPT (Lei da Transparência Fiscal)",
      "item": [
        {
          "name": "Consultar IBPT por UF",
          "description": "Retorna a carga tributária IBPT para um NCM em uma UF específica.",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has ncm', () => pm.expect(json.ncm).to.be.a('string'));",
                  "    pm.test('Has uf', () => pm.expect(json.uf).to.be.a('string'));",
                  "    pm.test('Has federal_nacional', () => pm.expect(json.federal_nacional).to.be.a('number'));",
                  "    pm.test('Has estadual', () => pm.expect(json.estadual).to.be.a('number'));",
                  "    pm.test('Has carga_total_nacional', () => pm.expect(json.carga_total_nacional).to.be.a('number'));",
                  "    pm.test('Has vigencia_ini', () => pm.expect(json.vigencia_ini).to.be.a('string'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/ibpt/:ncm?uf=SP",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "ibpt", ":ncm"],
              "query": [
                { "key": "uf", "value": "SP" }
              ],
              "variable": [
                {
                  "key": "ncm",
                  "value": "21011110"
                }
              ]
            }
          }
        },
        {
          "name": "Consultar IBPT todas UFs",
          "description": "Retorna a carga tributária IBPT para um NCM em todas as UFs disponíveis.",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "",
                  "if (pm.response.code === 200) {",
                  "    const json = pm.response.json();",
                  "    pm.test('Has ncm', () => pm.expect(json.ncm).to.be.a('string'));",
                  "    pm.test('Has total_ufs', () => pm.expect(json.total_ufs).to.be.a('number'));",
                  "    pm.test('Has dados array', () => pm.expect(json.dados).to.be.an('array'));",
                  "    pm.test('Dados not empty', () => pm.expect(json.dados.length).to.be.greaterThan(0));",
                  "    pm.test('Dado has uf', () => pm.expect(json.dados[0].uf).to.be.a('string'));",
                  "    pm.test('Dado has federal_nacional', () => pm.expect(json.dados[0].federal_nacional).to.be.a('number'));",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/ibpt/:ncm",
              "host": ["{{baseUrl}}"],
              "path": ["v1", "ibpt", ":ncm"],
              "variable": [
                {
                  "key": "ncm",
                  "value": "21011110"
                }
              ]
            }
          }
        }
      ]
    }
  ]
}
