{
  "info": {
    "name": "PES2B NFSe Emissor Service",
    "description": "Exemplos fictícios. Adaptar empresa, CNPJ e enquadramento antes de uso. A instalação atual está em homologação.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://emissor.service.pes2b.com"
    },
    {
      "key": "apiKey",
      "value": ""
    },
    {
      "key": "solicitacaoId",
      "value": ""
    },
    {
      "key": "idempotencyKey",
      "value": "DEFINIR-CHAVE-ESTAVEL"
    }
  ],
  "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": "Conferir ambiente",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api/v1/ambiente",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Validar DPS sem transmitir",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api/v1/nfse/validar",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"empresa_codigo\": \"EMPRESA_AUTORIZADA\",\n  \"leiaute\": \"restrita_20261020\",\n  \"dados_dps\": {\n    \"serie\": \"1\",\n    \"nDPS\": \"1\",\n    \"dCompet\": \"2026-11-10\",\n    \"dhEmi\": \"2026-11-10T10:00:00-03:00\",\n    \"cLocEmi\": \"4314902\",\n    \"prest\": {\n      \"CNPJ\": \"11222333000181\",\n      \"regTrib\": {\n        \"opSimpNac\": \"1\",\n        \"regEspTrib\": \"0\"\n      }\n    },\n    \"serv\": {\n      \"locPrest\": {\n        \"cLocPrestacao\": \"4314902\"\n      },\n      \"cServ\": {\n        \"cTribNac\": \"170101\",\n        \"xDescServ\": \"Exemplo fictício para validação local de IBS/CBS\"\n      }\n    },\n    \"valores\": {\n      \"vServPrest\": {\n        \"vServ\": \"100.00\"\n      },\n      \"trib\": {\n        \"tribMun\": {\n          \"tribISSQN\": \"1\",\n          \"tpRetISSQN\": \"1\"\n        },\n        \"totTrib\": {\n          \"indTotTrib\": \"0\"\n        }\n      }\n    },\n    \"finNFSe\": \"0\",\n    \"IBSCBS\": {\n      \"indFinal\": \"1\",\n      \"cIndOp\": \"100301\",\n      \"indDest\": \"0\",\n      \"valores\": {\n        \"trib\": {\n          \"CST\": \"000\",\n          \"cClassTrib\": \"000001\",\n          \"gIBSCBS\": {\n            \"gTribRegular\": {\n              \"CSTReg\": \"000\",\n              \"cClassTribReg\": \"000001\"\n            },\n            \"gDif\": {\n              \"pDifUF\": \"0.00\",\n              \"pDifMun\": \"0.00\",\n              \"pDifCBS\": \"0.00\"\n            }\n          }\n        }\n      }\n    }\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Emitir DPS",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api/v1/nfse/emitir",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotencyKey}}"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"empresa_codigo\": \"EMPRESA_AUTORIZADA\",\n  \"leiaute\": \"restrita_20261020\",\n  \"dados_dps\": {\n    \"serie\": \"1\",\n    \"nDPS\": \"1\",\n    \"dCompet\": \"2026-11-10\",\n    \"dhEmi\": \"2026-11-10T10:00:00-03:00\",\n    \"cLocEmi\": \"4314902\",\n    \"prest\": {\n      \"CNPJ\": \"11222333000181\",\n      \"regTrib\": {\n        \"opSimpNac\": \"1\",\n        \"regEspTrib\": \"0\"\n      }\n    },\n    \"serv\": {\n      \"locPrest\": {\n        \"cLocPrestacao\": \"4314902\"\n      },\n      \"cServ\": {\n        \"cTribNac\": \"170101\",\n        \"xDescServ\": \"Exemplo fictício para validação local de IBS/CBS\"\n      }\n    },\n    \"valores\": {\n      \"vServPrest\": {\n        \"vServ\": \"100.00\"\n      },\n      \"trib\": {\n        \"tribMun\": {\n          \"tribISSQN\": \"1\",\n          \"tpRetISSQN\": \"1\"\n        },\n        \"totTrib\": {\n          \"indTotTrib\": \"0\"\n        }\n      }\n    },\n    \"finNFSe\": \"0\",\n    \"IBSCBS\": {\n      \"indFinal\": \"1\",\n      \"cIndOp\": \"100301\",\n      \"indDest\": \"0\",\n      \"valores\": {\n        \"trib\": {\n          \"CST\": \"000\",\n          \"cClassTrib\": \"000001\",\n          \"gIBSCBS\": {\n            \"gTribRegular\": {\n              \"CSTReg\": \"000\",\n              \"cClassTribReg\": \"000001\"\n            },\n            \"gDif\": {\n              \"pDifUF\": \"0.00\",\n              \"pDifMun\": \"0.00\",\n              \"pDifCBS\": \"0.00\"\n            }\n          }\n        }\n      }\n    }\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Consultar solicitação",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api/v1/solicitacoes/{{solicitacaoId}}",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Reconciliar sem retransmitir",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api/v1/solicitacoes/{{solicitacaoId}}/reconciliar",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Obter XML",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api/v1/solicitacoes/{{solicitacaoId}}/xml",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Obter DANFSe",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api/v1/solicitacoes/{{solicitacaoId}}/danfse",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Obter eventos",
      "request": {
        "method": "GET",
        "url": "{{baseUrl}}/api/v1/solicitacoes/{{solicitacaoId}}/eventos",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ]
      }
    },
    {
      "name": "Cancelar NFS-e",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api/v1/nfse/cancelar",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{idempotencyKey}}"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"empresa_codigo\": \"EMPRESA_AUTORIZADA\",\n  \"chave_acesso\": \"PREENCHER_50_DIGITOS\",\n  \"motivo\": \"1\",\n  \"justificativa\": \"PREENCHER JUSTIFICATIVA REAL\",\n  \"data_evento\": \"2026-11-10T10:00:00-03:00\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    }
  ]
}
