{
  "info": {
    "_postman_id": "c519be19-e1f9-4282-ac9b-c29c150767cd",
    "name": "Progem - API (Spring)",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "12366598",
    "_collection_link": "https://go.postman.co/collection/12366598-c519be19-e1f9-4282-ac9b-c29c150767cd?source=collection_link",
    "description": "Colecao PROGEM API — 3 fluxos de autenticacao independentes.\n\n**Ordem recomendada:** 00 Inicio rapido → escolha um fluxo abaixo.\n\n1. **OAuth2 M2M** (`Autenticacao`): integracao server-to-server — `oauth_access_token` + `X-Progem-ID`.\n2. **Whitelabel** (`Usuarios`): associado site/app — `app_access_token` + `X-Progem-ID`.\n3. **Mobile TAMS-513** (`Mobile Auth`): app operacional multi-tenant — `mobile_*` tokens, sem `X-Progem-ID` pos-select.\n\nGuia: docs/TAMS-513/POSTMAN-GUIDE.md | Swagger: /swagger-ui/index.html\nMobile requer `mobile.auth.enabled=true`.\nOperacional TAMS-532: cobrancas/caixas/vendedor (token mobile + vinculo TAMS-530)."
  },
  "item": [
    {
      "name": "00 - Inicio rapido",
      "description": "Comece aqui: health check e links dos 3 fluxos de autenticacao.\n\nGuia completo: docs/TAMS-513/POSTMAN-GUIDE.md\nSwagger: {{url_base}}/swagger-ui/index.html",
      "item": [
        {
          "name": "Health check (sem auth)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/actuator/health",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "actuator",
                "health"
              ]
            },
            "description": "Verifica se a API esta no ar. Nao requer autenticacao."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('API online (200)', function () { pm.response.to.have.status(200); });",
                  "pm.test('Status UP', function () {",
                  "  const j = pm.response.json();",
                  "  pm.expect(j.status).to.eql('UP');",
                  "});"
                ]
              }
            }
          ],
          "response": []
        },
        {
          "name": "Swagger UI (abrir no browser)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/swagger-ui/index.html",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "swagger-ui",
                "index.html"
              ]
            },
            "description": "Documentacao OpenAPI interativa. Tags mobile-auth e mobile-me para TAMS-513."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Autenticacao",
      "item": [
        {
          "name": "Obter token (Basic Auth)",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Status e 200', function () { pm.response.to.have.status(200); });",
                  "let data = {};",
                  "try { data = pm.response.json(); } catch (e) { data = {}; }",
                  "if (data.access_token) {",
                  "  pm.collectionVariables.set('access_token', data.access_token);",
                  "  pm.collectionVariables.set('oauth_access_token', data.access_token);",
                  "  if (data.token_type) pm.collectionVariables.set('token_type', data.token_type);",
                  "  if (data.expires_in !== undefined) pm.collectionVariables.set('expires_in', String(data.expires_in));",
                  "  if (data.scope) pm.collectionVariables.set('scope', data.scope);",
                  "  console.log('OAuth token salvo em access_token e oauth_access_token');",
                  "} else {",
                  "  console.warn('Resposta nao contem access_token');",
                  "}"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                {
                  "key": "password",
                  "value": "{{oauth_client_secret}}",
                  "type": "string"
                },
                {
                  "key": "username",
                  "value": "{{oauth_client_id}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"grant_type\": \"client_credentials\",\n  \"scope\": \"read:unidades write:pessoas,read:pessoas,read:contratos,write:contratos,write:dependentes,read:dependentes,read:duplicatas,read:parceiros,read:planos\"\n}"
            },
            "url": {
              "raw": "{{url_base}}/oauth2/token",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "oauth2",
                "token"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Mobile Auth (TAMS-513)",
      "description": "Fluxo mobile multi-tenant (/api/v1/mobile/*). Requer mobile.auth.enabled=true. Apos select-tenant NAO enviar X-Progem-ID; access_token mobile e propagado para {{access_token}}.",
      "item": [
        {
          "name": "Fluxo de autenticacao",
          "item": [
            {
              "name": "01 - Login global (sem X-Progem-ID)",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Device-ID",
                    "value": "{{mobile_device_id}}",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{url_base}}/api/v1/mobile/auth/login",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "mobile",
                    "auth",
                    "login"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"identificador\": \"{{mobile_identificador}}\",\n  \"senha\": \"{{mobile_senha}}\"\n}"
                },
                "description": "Emite preAuthToken e availableTenants. Anti-enumeracao: 401 generico."
              },
              "response": [],
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "pm.test('Login mobile responde 200 ou 404 (flag off)', function () {",
                      "  pm.expect([200, 401, 404]).to.include(pm.response.code);",
                      "});",
                      "if (pm.response.code === 200) {",
                      "  const j = pm.response.json();",
                      "  if (j.preAuthToken) pm.collectionVariables.set('mobile_pre_auth_token', j.preAuthToken);",
                      "  if (j.availableTenants && j.availableTenants.length) {",
                      "    const t = j.availableTenants[0];",
                      "    pm.collectionVariables.set('mobile_empresa_id', String(t.empresaId));",
                      "    pm.collectionVariables.set('empresa_id', String(t.empresaId));",
                      "    if (t.usuarioAppId) pm.collectionVariables.set('usuario_app_id', String(t.usuarioAppId));",
                      "  }",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ]
            },
            {
              "name": "02 - Listar tenants",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{mobile_pre_auth_token}}",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{url_base}}/api/v1/mobile/auth/tenants",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "mobile",
                    "auth",
                    "tenants"
                  ]
                },
                "description": "Bearer pre_auth (typ=pre_auth, authFlow=mobile)."
              },
              "response": []
            },
            {
              "name": "03 - Select tenant",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Device-ID",
                    "value": "{{mobile_device_id}}",
                    "type": "text"
                  },
                  {
                    "key": "Authorization",
                    "value": "Bearer {{mobile_pre_auth_token}}",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{url_base}}/api/v1/mobile/auth/select-tenant",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "mobile",
                    "auth",
                    "select-tenant"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"empresaId\": {{mobile_empresa_id}}\n}"
                },
                "description": "Troca pre_auth por access/refresh contextualizados. Atualiza {{access_token}} e {{empresa_id}}."
              },
              "response": [],
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "exec": [
                      "const id = pm.collectionVariables.get('mobile_empresa_id');",
                      "if (!id) {",
                      "  throw new Error('Execute 01 - Login global antes. mobile_empresa_id vazio.');",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "pm.test('Select tenant responde 200 ou 403', function () {",
                      "  pm.expect([200, 401, 403, 404]).to.include(pm.response.code);",
                      "});",
                      "if (pm.response.code === 200) {",
                      "  const j = pm.response.json();",
                      "  if (j.access_token) {",
                      "    pm.collectionVariables.set('mobile_access_token', j.access_token);",
                      "    pm.collectionVariables.set('access_token', j.access_token);",
                      "  }",
                      "  if (j.refresh_token) pm.collectionVariables.set('mobile_refresh_token', j.refresh_token);",
                      "  if (j.empresaId) {",
                      "    pm.collectionVariables.set('mobile_empresa_id', String(j.empresaId));",
                      "    pm.collectionVariables.set('empresa_id', String(j.empresaId));",
                      "  }",
                      "  if (j.usuarioAppId) pm.collectionVariables.set('usuario_app_id', String(j.usuarioAppId));",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ]
            },
            {
              "name": "04 - Refresh mobile",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Device-ID",
                    "value": "{{mobile_device_id}}",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{url_base}}/api/v1/mobile/auth/refresh",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "mobile",
                    "auth",
                    "refresh"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"refreshToken\": \"{{mobile_refresh_token}}\"\n}"
                }
              },
              "response": [],
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "pm.test('Refresh mobile responde 200 ou 401', function () {",
                      "  pm.expect([200, 401, 404]).to.include(pm.response.code);",
                      "});",
                      "if (pm.response.code === 200) {",
                      "  const j = pm.response.json();",
                      "  if (j.accessToken) {",
                      "    pm.collectionVariables.set('mobile_access_token', j.accessToken);",
                      "    pm.collectionVariables.set('access_token', j.accessToken);",
                      "  }",
                      "  if (j.refreshToken) pm.collectionVariables.set('mobile_refresh_token', j.refreshToken);",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ]
            },
            {
              "name": "05 - Switch tenant",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Device-ID",
                    "value": "{{mobile_device_id}}",
                    "type": "text"
                  },
                  {
                    "key": "Authorization",
                    "value": "Bearer {{mobile_access_token}}",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{url_base}}/api/v1/mobile/auth/switch-tenant",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "mobile",
                    "auth",
                    "switch-tenant"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"empresaId\": {{mobile_empresa_id}}\n}"
                },
                "description": "Requer access mobile. empresaId deve ser diferente do tenant atual."
              },
              "response": [],
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "pm.test('Switch tenant responde 200 ou 4xx', function () {",
                      "  pm.expect([200, 400, 401, 403, 404]).to.include(pm.response.code);",
                      "});",
                      "if (pm.response.code === 200) {",
                      "  const j = pm.response.json();",
                      "  if (j.access_token) {",
                      "    pm.collectionVariables.set('mobile_access_token', j.access_token);",
                      "    pm.collectionVariables.set('access_token', j.access_token);",
                      "  }",
                      "  if (j.refresh_token) pm.collectionVariables.set('mobile_refresh_token', j.refresh_token);",
                      "  if (j.empresaId) {",
                      "    pm.collectionVariables.set('mobile_empresa_id', String(j.empresaId));",
                      "    pm.collectionVariables.set('empresa_id', String(j.empresaId));",
                      "  }",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ]
            },
            {
              "name": "06 - Logout mobile",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Device-ID",
                    "value": "{{mobile_device_id}}",
                    "type": "text"
                  },
                  {
                    "key": "Authorization",
                    "value": "Bearer {{mobile_access_token}}",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{url_base}}/api/v1/mobile/auth/logout",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "mobile",
                    "auth",
                    "logout"
                  ]
                },
                "description": "Revoga refresh mobile (auth_flow=mobile). Nao afeta sessao whitelabel."
              },
              "response": []
            }
          ]
        },
        {
          "name": "Perfil mobile",
          "item": [
            {
              "name": "GET /mobile/me",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{url_base}}/api/v1/mobile/me",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "mobile",
                    "me"
                  ]
                },
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{mobile_access_token}}",
                      "type": "string"
                    }
                  ]
                },
                "description": "Requer authFlow=mobile. Sem X-Progem-ID."
              },
              "response": []
            },
            {
              "name": "GET /mobile/me/modules",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{url_base}}/api/v1/mobile/me/modules",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "mobile",
                    "me",
                    "modules"
                  ]
                },
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{mobile_access_token}}",
                      "type": "string"
                    }
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "APIs operacionais (token mobile)",
          "description": "Endpoints operacionais TAMS-532 (cobrador/vendedor) com token mobile.\n\nFluxo: Mobile Auth 01-03 (login → select-tenant) → requests abaixo.\nBearer: {{mobile_access_token}} — sem X-Progem-ID.\nPre-requisito TAMS-530: usuario_app vinculado a usuario Progem (progemLink.linked=true).\n422 OPERATIONAL_LINK_MISSING se vinculo ausente.",
          "item": [
            {
              "name": "Contratos por CPF (mobile token)",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{url_base}}/api/v1/contratos/cpf/{{cliente_cpf}}",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "contratos",
                    "cpf",
                    "{{cliente_cpf}}"
                  ]
                },
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{mobile_access_token}}",
                      "type": "string"
                    }
                  ]
                },
                "description": "Usa scopes do token mobile. Nao inclui X-Progem-ID."
              },
              "response": []
            },
            {
              "name": "Planos (mobile token)",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{url_base}}/api/v1/planos",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "planos"
                  ]
                },
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{mobile_access_token}}",
                      "type": "string"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "01 - GET /cobrancas/v2 (cobrador)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test('Status 200, 204 ou erro auth/vinculo', function () {",
                      "  pm.expect([200, 204, 401, 403, 422]).to.include(pm.response.code);",
                      "});",
                      "if (pm.response.code === 200) {",
                      "  const j = pm.response.json();",
                      "  if (j.content && j.content.length && j.content[0].id) {",
                      "    pm.collectionVariables.set('cobranca_id', String(j.content[0].id));",
                      "    if (j.content[0].caixaId) {",
                      "      pm.collectionVariables.set('caixa_id', String(j.content[0].caixaId));",
                      "    }",
                      "  }",
                      "}"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{mobile_access_token}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{url_base}}/api/v1/cobrancas/v2?page=0&max=20",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "cobrancas",
                    "v2"
                  ],
                  "query": [
                    {
                      "key": "page",
                      "value": "0",
                      "description": "Pagina 0-based"
                    },
                    {
                      "key": "max",
                      "value": "20",
                      "description": "Maximo 50"
                    }
                  ]
                },
                "description": "TSK-291 TAMS-532. Lista cobrancas do cobrador vinculado (usuario_app → usuario Progem).\n\nScope: read:duplicatas\nRequer mobile_access_token + progemLink ativo.\n422 OPERATIONAL_LINK_MISSING se vinculo ausente."
              },
              "response": []
            },
            {
              "name": "02 - GET /caixas (boca caixa)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test('Status 200, 204 ou erro auth/vinculo', function () {",
                      "  pm.expect([200, 204, 401, 403, 422]).to.include(pm.response.code);",
                      "});",
                      "if (pm.response.code === 200) {",
                      "  const j = pm.response.json();",
                      "  if (j.content && j.content.length && j.content[0].id) {",
                      "    pm.collectionVariables.set('caixa_id', String(j.content[0].id));",
                      "  }",
                      "}"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{mobile_access_token}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{url_base}}/api/v1/caixas?page=0&max=20",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "caixas"
                  ],
                  "query": [
                    {
                      "key": "page",
                      "value": "0"
                    },
                    {
                      "key": "max",
                      "value": "20"
                    }
                  ]
                },
                "description": "TSK-292 TAMS-532. Caixas do usuario operacional (boca caixa + vinculo usuario Progem).\n\nScope: read:duplicatas"
              },
              "response": []
            },
            {
              "name": "03 - GET /vendedor/contratos",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test('Status 200, 204 ou erro auth/vinculo', function () {",
                      "  pm.expect([200, 204, 401, 403, 422]).to.include(pm.response.code);",
                      "});",
                      "if (pm.response.code === 200) {",
                      "  pm.test('Resposta JSON', function () { pm.response.to.be.json; });",
                      "}"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{mobile_access_token}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{url_base}}/api/v1/vendedor/contratos?page=0&max=20",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "vendedor",
                    "contratos"
                  ],
                  "query": [
                    {
                      "key": "page",
                      "value": "0"
                    },
                    {
                      "key": "max",
                      "value": "20"
                    }
                  ]
                },
                "description": "TSK-295 TAMS-532. Contratos filtrados por vendedor_id = usuario Progem vinculado.\n\nScope: read:contratos"
              },
              "response": []
            },
            {
              "name": "04 - POST /cobrancas/{id}/reagendar",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test('Status 200, 204 ou erro auth/vinculo', function () {",
                      "  pm.expect([200, 204, 401, 403, 422]).to.include(pm.response.code);",
                      "});",
                      "if (pm.response.code === 200) {",
                      "  pm.test('Resposta JSON', function () { pm.response.to.be.json; });",
                      "}"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{mobile_access_token}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"dataReagendamento\": \"2026-08-01\",\n  \"observacao\": \"Cliente solicitou reagendamento via app\",\n  \"checkin\": {\n    \"dataHora\": \"2026-07-30T12:00:00\",\n    \"latitude\": \"-23.550520\",\n    \"longitude\": \"-46.633308\"\n  }\n}"
                },
                "url": {
                  "raw": "{{url_base}}/api/v1/cobrancas/{{cobranca_id}}/reagendar",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "cobrancas",
                    "{{cobranca_id}}",
                    "reagendar"
                  ]
                },
                "description": "TSK-294 TAMS-532. Reagenda cobranca com check-in GPS.\n\nScope: write:duplicatas\nUse cobranca_id da listagem ou preencha manualmente."
              },
              "response": []
            },
            {
              "name": "05 - POST /cobrancas/{id}/receber",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test('Status 200, 204 ou erro auth/vinculo', function () {",
                      "  pm.expect([200, 204, 401, 403, 422]).to.include(pm.response.code);",
                      "});",
                      "if (pm.response.code === 200) {",
                      "  pm.test('Resposta JSON', function () { pm.response.to.be.json; });",
                      "}"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{mobile_access_token}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"caixa\": { \"id\": {{caixa_id}} },\n  \"valorPago\": 79.90,\n  \"formaPagamento\": \"DINHEIRO\",\n  \"dataPagamento\": \"2026-07-30\",\n  \"juros\": 0,\n  \"multa\": 0,\n  \"checkin\": {\n    \"dataHora\": \"2026-07-30T12:00:00\",\n    \"latitude\": \"-23.550520\",\n    \"longitude\": \"-46.633308\"\n  }\n}"
                },
                "url": {
                  "raw": "{{url_base}}/api/v1/cobrancas/{{cobranca_id}}/receber",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "cobrancas",
                    "{{cobranca_id}}",
                    "receber"
                  ]
                },
                "description": "TSK-293 TAMS-532. Recebe cobranca (baixa manual app).\n\nScope: write:duplicatas\nCaixa deve estar ABERTO. Execute GET /caixas antes."
              },
              "response": []
            }
          ]
        }
      ]
    },
    {
      "name": "Contratos",
      "item": [
        {
          "name": "Buscar Contratos por CPF",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200 ou 401/403 sem token', function () {",
                  "  pm.expect([200, 401, 403]).to.include(pm.response.code);",
                  "});",
                  "if (pm.response.code === 200) {",
                  "  pm.test('Resposta JSON', function () {",
                  "    pm.response.to.be.json;",
                  "  });",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{url_base}}/api/v1/contratos/cpf/{{cliente_cpf}}",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "contratos",
                "cpf",
                "{{cliente_cpf}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Buscar Dependentes",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/contratos/175643/dependentes",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "contratos",
                "175643",
                "dependentes"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Criar Contrato",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"titularId\": 293833,\r\n  \"planoId\": 1615,\r\n  \"vendedorId\": 717,\r\n  \"dataContrato\": \"2025-07-29\",\r\n  \"diaD\": 11,\r\n  \"valorAdesao\": 100.90,\r\n  \"valorMensalidade\": 79.90,\r\n  \"dataEfetivacao\": \"2025-11-01\",\r\n  \"cupomDesconto\": \"BEMVINDO10\"\r\n}\r\n\r\n",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{url_base}}/api/v1/contratos",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "contratos"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Cobrancas",
      "item": [
        {
          "name": "Buscar Pagamentos",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/contratos/205379/pagamentos",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "contratos",
                "205379",
                "pagamentos"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Debitos",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/contratos/205379/debitos",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "contratos",
                "205379",
                "debitos"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Pagamento do Mês",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/contratos/205379/pagamentos/mes",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "contratos",
                "205379",
                "pagamentos",
                "mes"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Titular",
      "item": [
        {
          "name": "Criar Titular",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"nome\": \"Noah Gustavo Leandro Melo\",\r\n  \"cpf\": \"759.994.759-02\",\r\n  \"rg\": \"21.449.009-9\",\r\n  \"dataNascimento\": \"1980-05-20\",\r\n  \"sexo\": \"HOMEM\",\r\n  \"profissao\": \"Professor\",\r\n  \"estadoCivil\": \"CASADO\",\r\n  \"apelido\": \"Jony\",\r\n  \"contatos\": {\r\n    \"email\": \"joao.silva@email.com\",\r\n    \"celular\": \"(34) 99999-0000\",\r\n    \"telefone\": \"(34) 3222-0000\"\r\n  },\r\n  \"endereco\": {\r\n    \"cep\": \"38700-000\",\r\n    \"cidade\": \"Patos de Minas\",\r\n    \"uf\": \"MG\",\r\n    \"bairro\": \"Centro\",\r\n    \"logradouro\": \"Rua dos Andradas\",\r\n    \"numero\": \"123\",\r\n    \"complemento\": \"Apto 201\"\r\n  }\r\n\r\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{url_base}}/api/v1/pessoas",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "pessoas"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Buscar Titular por CPF",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/pessoas/cpf/302.676.506-63",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "pessoas",
                "cpf",
                "302.676.506-63"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Buscar Titular por ID",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/pessoas/290132",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "pessoas",
                "290132"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Dependentes",
      "item": [
        {
          "name": "Criar Dependente",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"cpf\": \"501.504.528-02\",\r\n  \"nome\": \"Caleb Luís da Conceição\",\r\n  \"email\": \"calebluisdaconceicao@gastrolight.com.br\",\r\n  \"fone\": \"(34) 3232-1000\",\r\n  \"celular\": \"(34) 99999-8888\",\r\n  \"parentesco\": \"FILHO\",\r\n  \"sexo\": \"HOMEM\",\r\n  \"dataNascimento\": \"2001-05-20\",\r\n  \"titularId\": 294728,\r\n  \"apelido\": \"Leb\",\r\n  \"estadoCivil\": \"SOLTEIRO\"\r\n}\r\n",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{url_base}}/api/v1/dependentes",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "dependentes"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Buscar Dependente por CPF",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/dependentes/cpf/302.676.506-63",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "dependentes",
                "cpf",
                "302.676.506-63"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Buscar Dependente por ID",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/dependentes/1645500",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "dependentes",
                "1645500"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Buscar Dependentes por Titular",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/dependentes/pessoa/294728",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "dependentes",
                "pessoa",
                "294728"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Empresa",
      "item": [
        {
          "name": "Buscar Empresa Logada",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/unidades/me",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "unidades",
                "me"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Listar Unidades por Empresa",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/unidades/all",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "unidades",
                "all"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Planos",
      "item": [
        {
          "name": "Buscar Planos",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/planos",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "planos"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Buscar Plano por ID",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/planos/1917",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "planos",
                "1917"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Vendedores",
      "item": [
        {
          "name": "Buscar Vendedor por Email",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/vendedores/email/andre.mazzardo@gmail.com",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "vendedores",
                "email",
                "andre.mazzardo@gmail.com"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Cupom",
      "item": [
        {
          "name": "Buscar Cupom",
          "request": {
            "method": "GET",
            "header": []
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Metricas",
      "item": [
        {
          "name": "Overview",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/admin/metrics/api/overview?start=2025-08-01&end=2025-08-19",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "admin",
                "metrics",
                "api",
                "overview"
              ],
              "query": [
                {
                  "key": "start",
                  "value": "2025-08-01"
                },
                {
                  "key": "end",
                  "value": "2025-08-19"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Time Series (Daily)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/admin/metrics/api/timeseries?start=2025-08-01&end=2025-08-19&bucket=DAY",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "admin",
                "metrics",
                "api",
                "timeseries"
              ],
              "query": [
                {
                  "key": "start",
                  "value": "2025-08-01"
                },
                {
                  "key": "end",
                  "value": "2025-08-19"
                },
                {
                  "key": "bucket",
                  "value": "DAY"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Time Series (Hourly)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/admin/metrics/api/timeseries?start=2025-08-01&end=2025-08-19&bucket=HOUR",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "admin",
                "metrics",
                "api",
                "timeseries"
              ],
              "query": [
                {
                  "key": "start",
                  "value": "2025-08-01"
                },
                {
                  "key": "end",
                  "value": "2025-08-19"
                },
                {
                  "key": "bucket",
                  "value": "HOUR"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Status",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/admin/metrics/api/status?start=2025-08-01&end=2025-08-19",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "admin",
                "metrics",
                "api",
                "status"
              ],
              "query": [
                {
                  "key": "start",
                  "value": "2025-08-01"
                },
                {
                  "key": "end",
                  "value": "2025-08-19"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Methods",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/admin/metrics/api/methods?start=2025-08-01&end=2025-08-19",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "admin",
                "metrics",
                "api",
                "methods"
              ],
              "query": [
                {
                  "key": "start",
                  "value": "2025-08-01"
                },
                {
                  "key": "end",
                  "value": "2025-08-19"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Top Endpoints",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/admin/metrics/api/endpoints/top?start=2025-08-01&end=2025-08-19",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "admin",
                "metrics",
                "api",
                "endpoints",
                "top"
              ],
              "query": [
                {
                  "key": "start",
                  "value": "2025-08-01"
                },
                {
                  "key": "end",
                  "value": "2025-08-19"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Endpoints Latency",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/admin/metrics/api/endpoints/latency?start=2025-08-01&end=2025-08-19",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "admin",
                "metrics",
                "api",
                "endpoints",
                "latency"
              ],
              "query": [
                {
                  "key": "start",
                  "value": "2025-08-01"
                },
                {
                  "key": "end",
                  "value": "2025-08-19"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "By Tenant",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/admin/metrics/api/tenants?start=2025-08-01&end=2025-08-19",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "admin",
                "metrics",
                "api",
                "tenants"
              ],
              "query": [
                {
                  "key": "start",
                  "value": "2025-08-01"
                },
                {
                  "key": "end",
                  "value": "2025-08-19"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Logs",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/admin/metrics/api/logs?start=2025-08-01&end=2025-08-19",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "admin",
                "metrics",
                "api",
                "logs"
              ],
              "query": [
                {
                  "key": "start",
                  "value": "2025-08-01"
                },
                {
                  "key": "end",
                  "value": "2025-08-19"
                }
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Parcerias",
      "item": [
        {
          "name": "Buscar Parceiros",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/locais/parceiros",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "locais",
                "parceiros"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Webhook",
      "item": [
        {
          "name": "1) Listar Endpoints Ativos",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "128"
              }
            ],
            "url": {
              "raw": "{{url_base}}/api/v1/webhooks/endpoints",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "endpoints"
              ]
            }
          },
          "response": []
        },
        {
          "name": "2) Criar Endpoint",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://webhook.site/SEU_ID_AQUI\",\n  \"eventos\": [\"invoice.paid\"],\n  \"descricao\": \"Endpoint de teste\"\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/webhooks/endpoints",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "endpoints"
              ]
            }
          },
          "response": []
        },
        {
          "name": "3) Atualizar Endpoint (PUT)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://webhook.site/SEU_ID_AQUI\",\n  \"eventos\": [\"invoice.paid\", \"invoice.upcoming\"],\n  \"descricao\": \"Endpoint atualizado\",\n  \"ativo\": true\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/webhooks/endpoints/1",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "endpoints",
                "1"
              ]
            }
          },
          "response": []
        },
        {
          "name": "4) Desativar Endpoint",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ativo\": false\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/webhooks/endpoints/1",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "endpoints",
                "1"
              ]
            }
          },
          "response": []
        },
        {
          "name": "5) Enviar Evento (Webhook Ingest)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"eventType\": \"invoice.paid\",\n  \"payload\": {\n    \"id\": \"dup_777\",\n    \"evento\": \"invoice.paid\",\n    \"empresaId\": 407,\n    \"contrato\": {\n      \"id\": 123,\n      \"numero\": \"C-2025-000123\"\n    },\n    \"parcela\": {\n      \"id\": 456,\n      \"numero\": 5,\n      \"valor\": \"59.90\",\n      \"dataVencimento\": \"2025-10-05\",\n      \"status\": \"PAGO\",\n      \"pagaEm\": \"2025-10-05T09:15:00\",\n      \"meio\": \"PIX\"\n    },\n    \"cliente\": {\n      \"id\": 321,\n      \"nome\": \"Fulano da Silva\",\n      \"cpf\": \"120.647.326-67\"\n    }\n  }\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/webhooks/events",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "events"
              ]
            }
          },
          "response": []
        },
        {
          "name": "6) Listar Deliveries",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              }
            ],
            "url": {
              "raw": "{{url_base}}/api/v1/webhooks/deliveries",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "deliveries"
              ]
            }
          },
          "response": []
        },
        {
          "name": "7) Buscar Delivery por ID",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              }
            ],
            "url": {
              "raw": "{{url_base}}/api/v1/webhooks/deliveries/1",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "deliveries",
                "1"
              ]
            }
          },
          "response": []
        },
        {
          "name": "8) Reprocessar Deliveries Pendentes",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              }
            ],
            "url": {
              "raw": "{{url_base}}/api/v1/webhooks/deliveries/retry",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "deliveries",
                "retry"
              ]
            }
          },
          "response": []
        },
        {
          "name": "9) Verificar Assinatura Interna",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              },
              {
                "key": "X-Internal-Key",
                "value": "SUA_CHAVE_INTERNA_AQUI"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"eventType\": \"invoice.test\",\n  \"payload\": {\n    \"teste\": true\n  }\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/webhooks/events",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "events"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Testes FCM & Webhook",
      "item": [
        {
          "name": "01 - Registrar Device (FCM Token)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{oauth_access_token}}"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"usuarioAppId\":10,\n  \"fcmToken\": \"dDBgK0Tz_n8BtWx1lDAMv8:APA91bEI5YBr9DeqdP3uinYYzLeXo8_kQ51kvntBf_YIMyIkKqNyXUM9yRpCNDsrf2qOr7wz4cTMFRjpwfmPWwFvs4NosaxAiAnh000stNZNiSXQ7vkeFCs\",\n  \"plataforma\": \"WEB\",\n  \"appTipo\": \"ASSOCIADO\",\n  \"modelo\": \"Chrome\",\n  \"soVersao\": \"Win10\"\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/app/me/devices",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "app",
                "me",
                "devices"
              ]
            }
          },
          "response": []
        },
        {
          "name": "03 - Enviar PUSH manual (via /dev/push)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Teste manual\",\n  \"body\": \"Progem enviando push diretamente (dev)\",\n  \"data\": {\"eventType\": \"test.push\"}\n}"
            },
            "url": {
              "raw": "{{url_base}}/dev/push/{{empresa_id}}/{{usuario_app_id}}",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "dev",
                "push",
                "{{empresa_id}}",
                "{{usuario_app_id}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "04 - Testar Webhook invoice.paid → Push",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"evento\": \"invoice.paid\",\n  \"empresaId\": {{empresa_id}},\n  \"cliente\": {\n    \"cpf\": \"{{cliente_cpf}}\",\n    \"nome\": \"{{cliente_nome}}\",\n    \"id\": {{cliente_id}}\n  },\n  \"contrato\": {\n    \"numero\": 9024,\n    \"id\": {{contrato_id}}\n  },\n  \"parcela\": {\n    \"numero\": \"40\",\n    \"dataVencimento\": \"2025-11-05\",\n    \"valor\": 75,\n    \"status\": \"PAGA\",\n    \"id\": 2331419\n  }\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/webhooks/events",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "webhooks",
                "events"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Usuários",
      "item": [
        {
          "name": "Vinculo Progem (TAMS-530)",
          "description": "Admin AWIS/ADM: vincular usuario_app ao usuario Progem antes dos endpoints TAMS-532.",
          "item": [
            {
              "name": "GET progem-vinculo (admin)",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{app_access_token}}"
                  },
                  {
                    "key": "X-Progem-ID",
                    "value": "{{empresa_id}}"
                  }
                ],
                "url": {
                  "raw": "{{url_base}}/api/v1/app/admin/users/{{usuario_app_id}}/progem-vinculo",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "app",
                    "admin",
                    "users",
                    "{{usuario_app_id}}",
                    "progem-vinculo"
                  ]
                },
                "description": "TAMS-530. Consulta vinculo usuario_app ↔ usuario Progem. Requer role AWIS/ADM."
              },
              "response": []
            },
            {
              "name": "PUT progem-vinculo (admin)",
              "request": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Authorization",
                    "value": "Bearer {{app_access_token}}"
                  },
                  {
                    "key": "X-Progem-ID",
                    "value": "{{empresa_id}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"usuarioId\": {{usuario_progem_id}},\n  \"ativo\": true\n}"
                },
                "url": {
                  "raw": "{{url_base}}/api/v1/app/admin/users/{{usuario_app_id}}/progem-vinculo",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "app",
                    "admin",
                    "users",
                    "{{usuario_app_id}}",
                    "progem-vinculo"
                  ]
                },
                "description": "TAMS-530. Cria/atualiza vinculo. Preencha usuario_progem_id e usuario_app_id."
              },
              "response": []
            },
            {
              "name": "DELETE progem-vinculo (admin)",
              "request": {
                "method": "DELETE",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{app_access_token}}"
                  },
                  {
                    "key": "X-Progem-ID",
                    "value": "{{empresa_id}}"
                  }
                ],
                "url": {
                  "raw": "{{url_base}}/api/v1/app/admin/users/{{usuario_app_id}}/progem-vinculo",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "app",
                    "admin",
                    "users",
                    "{{usuario_app_id}}",
                    "progem-vinculo"
                  ]
                },
                "description": "TAMS-530. Desativa vinculo operacional."
              },
              "response": []
            }
          ]
        },
        {
          "name": "Recuperacao",
          "item": [
            {
              "name": "Forgot Password (envia código)",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Progem-ID",
                    "value": "{{empresa_id}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"identifier\": \"04791325931\",\n  \"channel\": \"EMAIL\"\n}"
                },
                "url": {
                  "raw": "{{url_base}}/api/v1/app/password/forgot",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "app",
                    "password",
                    "forgot"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Reset Password (com código)",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Progem-ID",
                    "value": "{{empresa_id}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"identifier\": \"email@gmail.com\",\n  \"codigo\": \"413589\",\n  \"novaSenha\": \"@Mudasss123\"\n}"
                },
                "url": {
                  "raw": "{{url_base}}/api/v1/app/password/reset",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "app",
                    "password",
                    "reset"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Change Password (autenticado)",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Progem-ID",
                    "value": "{{empresa_id}}"
                  },
                  {
                    "key": "Authorization",
                    "value": "Bearer {{app_access_token}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"email\": \"email@gmail.com\",\n  \"senhaAtual\": \"NovaSenha12345\",\n  \"novaSenha\": \"NovaSenha1234\"\n}"
                },
                "url": {
                  "raw": "{{url_base}}/api/v1/app/password/change",
                  "host": [
                    "{{url_base}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "app",
                    "password",
                    "change"
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "Registrar Usuário",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              },
              {
                "key": "X-Device-ID",
                "value": "{{app_device_id}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"Leonardo Roberto Candido\",\n  \"email\": \"leonardo@exemplo.com\",\n  \"senha\": \"asdfg\",\n  \"cpf\": \"097.791.049-09\",\n  \"celular\": \"5546999004341\",\n  \"dataNascimento\": \"1999-03-28\",\n  \"aceiteTermos\": true,\n  \"aceitePrivacidade\": true\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/app/auth/register",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "app",
                "auth",
                "register"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Login Usuário",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Login whitelabel 200 ou 401', function () {",
                  "  pm.expect([200, 401]).to.include(pm.response.code);",
                  "});",
                  "let jsonData = {};",
                  "try { jsonData = pm.response.json(); } catch (e) {}",
                  "if (jsonData.access_token) {",
                  "  pm.collectionVariables.set('access_token', jsonData.access_token);",
                  "  pm.collectionVariables.set('app_access_token', jsonData.access_token);",
                  "}",
                  "if (jsonData.refresh_token) {",
                  "  pm.collectionVariables.set('refresh_token', jsonData.refresh_token);",
                  "  pm.collectionVariables.set('app_refresh_token', jsonData.refresh_token);",
                  "}",
                  "if (jsonData.userId) pm.collectionVariables.set('usuario_app_id', String(jsonData.userId));"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              },
              {
                "key": "X-Device-ID",
                "value": "{{app_device_id}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"identificador\": \"{{app_login_identificador}}\",\n  \"senha\": \"{{app_login_senha}}\"\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/app/auth/login",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "app",
                "auth",
                "login"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Logout",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test('Logout whitelabel', function () {",
                  "  pm.expect([204, 401, 400]).to.include(pm.response.code);",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{app_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}"
              },
              {
                "key": "X-Device-ID",
                "value": "{{app_device_id}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"deviceId\": \"{{app_device_id}}\"\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/app/auth/logout",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "app",
                "auth",
                "logout"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Refresh Token",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "var jsonData = pm.response.json();",
                  "if (jsonData.accessToken) {",
                  "    pm.collectionVariables.set('access_token', jsonData.accessToken);",
                  "    pm.collectionVariables.set('app_access_token', jsonData.accessToken);",
                  "}",
                  "if (jsonData.refreshToken) {",
                  "    pm.collectionVariables.set('refresh_token', jsonData.refreshToken);",
                  "    pm.collectionVariables.set('app_refresh_token', jsonData.refreshToken);",
                  "}"
                ],
                "type": "text/javascript",
                "packages": {}
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Device-ID",
                "value": "{{app_device_id}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refreshToken\": \"{{refresh_token}}\",\n  \"deviceId\": \"{{app_device_id}}\"\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/app/auth/refresh",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "app",
                "auth",
                "refresh"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Meu Perfil",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{app_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{url_base}}/api/v1/app/me",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "app",
                "me"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Buscar Avatar",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{app_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "image/jpeg",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{url_base}}/api/v1/app/me/avatar",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "app",
                "me",
                "avatar"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Remover Avatar",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{app_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "DELETE",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "image/jpeg",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{url_base}}/api/v1/app/me/avatar",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "app",
                "me",
                "avatar"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Atualizar Avatar",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  ""
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{app_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": "/D:/assets/Imagens/pessoas/drew-hays-agGIKYs4mYs-unsplash.jpg"
                }
              ]
            },
            "url": {
              "raw": "{{url_base}}/api/v1/app/me/avatar",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "app",
                "me",
                "avatar"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Atualizar Perfil",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{app_access_token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"Maria Souza Atualizada\",\n  \"celular\": \"55988887777\",\n  \"dataNascimento\": \"1996-04-15\"\n}"
            },
            "url": {
              "raw": "{{url_base}}/api/v1/app/me",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "app",
                "me"
              ]
            }
          },
          "response": []
        }
      ],
      "description": "Fluxo whitelabel `/api/v1/app/*`. Execute **Login Usuario** primeiro. Bearer: `app_access_token` + `X-Progem-ID` + `X-Device-ID` onde aplicavel.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[Whitelabel] empresa_id vazio — ID numerico do tenant (ex: 274)');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Depoimentos",
      "item": [
        {
          "name": "Adicionar depoimento",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\r\n    \"nome\": \"Carlos\",\r\n    \"depoimento\": \"Poderia ser melhor !!\",\r\n    \"avaliacao\": 3\r\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{url_base}}/api/v1/depoimentos",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "depoimentos"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Publicar depoimento",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\r\n    \"nome\": \"Carlos\",\r\n    \"depoimento\": \"Poderia ser melhor !!\",\r\n    \"avaliacao\": 3\r\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{url_base}}/api/v1/depoimentos/6/publicar",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "depoimentos",
                "6",
                "publicar"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Listar depoimentos",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/depoimentos",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "depoimentos"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Listar depoimentos públicos",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/depoimentos/publicos",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "depoimentos",
                "publicos"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Avaliação média",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/api/v1/depoimentos/avaliacao",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "depoimentos",
                "avaliacao"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "CelCash",
      "item": [
        {
          "name": "Healthcheck",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "  pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test(\"Body has status UP\", function () {",
                  "  var json = pm.response.json();",
                  "  pm.expect(json.status).to.eql(\"UP\");",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{url_base}}/actuator/health",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "actuator",
                "health"
              ]
            }
          },
          "response": []
        },
        {
          "name": "CelCash – Cliente",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "  pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test(\"Retorna JSON com id da duplicata\", function () {",
                  "  var json = pm.response.json();",
                  "  pm.expect(json).to.have.property('id');",
                  "});",
                  "",
                  "pm.test(\"Duplicata marcada como ABERTA\", function () {",
                  "  var json = pm.response.json();",
                  "  if (json.status) {",
                  "    pm.expect(json.status).to.eql('ABERTA');",
                  "  }",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{url_base}}/api/celcash/clientes/contratos/{{contratoId}}",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "celcash",
                "clientes",
                "contratos",
                "{{contratoId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "CelCash – Contrato",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "  pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test(\"Retorna JSON com id da duplicata\", function () {",
                  "  var json = pm.response.json();",
                  "  pm.expect(json).to.have.property('id');",
                  "});",
                  "",
                  "pm.test(\"Duplicata marcada como ABERTA\", function () {",
                  "  var json = pm.response.json();",
                  "  if (json.status) {",
                  "    pm.expect(json.status).to.eql('ABERTA');",
                  "  }",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"mainPaymentMethodId\": \"boleto\",\r\n  \"cobrancas\": [\r\n    {\r\n      \"numeroParcela\": 1,\r\n      \"valor\": 100.00,\r\n      \"dataVencimento\": \"2026-01-10\"\r\n    },\r\n    {\r\n      \"numeroParcela\": 2,\r\n      \"valor\": 75.00,\r\n      \"dataVencimento\": \"2026-02-10\"\r\n    },\r\n    {\r\n      \"numeroParcela\": 3,\r\n      \"valor\": 73.00,\r\n      \"dataVencimento\": \"2026-03-10\"\r\n    }\r\n  ]\r\n}\r\n",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{url_base}}/api/v1/celcash/contratos/{{contratoId}}/carne/manual",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "celcash",
                "contratos",
                "{{contratoId}}",
                "carne",
                "manual"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Contratos – Buscar duplicatas do contrato",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "  pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test(\"Retorna lista de duplicatas\", function () {",
                  "  var json = pm.response.json();",
                  "  pm.expect(json).to.be.an('array');",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{oauth_access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{url_base}}/api/v1/contratos/{{contratoId}}/pagamentos",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "contratos",
                "{{contratoId}}",
                "pagamentos"
              ]
            }
          },
          "response": []
        }
      ],
      "auth": {
        "type": "bearer",
        "bearer": [
          {
            "key": "token",
            "value": "{{oauth_access_token}}",
            "type": "string"
          }
        ]
      },
      "description": "Requer token OAuth M2M. Execute **Autenticacao > Obter token** antes. Bearer: `oauth_access_token` + header `X-Progem-ID`.",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (!pm.collectionVariables.get('oauth_access_token')) {",
              "  console.warn('[OAuth] oauth_access_token vazio — execute Autenticacao > Obter token');",
              "}",
              "if (!pm.collectionVariables.get('empresa_id')) {",
              "  console.warn('[OAuth] empresa_id vazio — preencha o ID numerico do tenant');",
              "}"
            ]
          }
        }
      ]
    },
    {
      "name": "Sync",
      "item": [
        {
          "name": "APP Vendedor – Sync",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "  pm.response.to.have.status(200);",
                  "});",
                  "",
                  "pm.test(\"Retorna JSON com id da duplicata\", function () {",
                  "  var json = pm.response.json();",
                  "  pm.expect(json).to.have.property('id');",
                  "});",
                  "",
                  "pm.test(\"Duplicata marcada como ABERTA\", function () {",
                  "  var json = pm.response.json();",
                  "  if (json.status) {",
                  "    pm.expect(json.status).to.eql('ABERTA');",
                  "  }",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{access_token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "X-Progem-ID",
                "value": "{{empresa_id}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "[\r\n  {\r\n    \"planoId\": 1484,\r\n    \"offlineUuid\": \"6a1d8a20-0f7a-4f7b-9a01-1b1f00000002\",\r\n    \"idVendedor\": 717,\r\n    \"tipoCobranca\": \"DUPLICATA\",\r\n    \"numeroMensalidades\": 12,\r\n    \"diaVencimento\": 5,\r\n    \"pessoa\": {\r\n      \"nome\": \"João Carlos Ferreira\",\r\n      \"dataNascimento\": \"1984-02-18\",\r\n      \"cpf\": \"752.213.746-25\",\r\n      \"sexo\": \"HOMEM\",\r\n      \"tipo\": \"FISICA\",\r\n      \"contato\": {\r\n        \"email\": \"joao.ferreira@email.com\",\r\n        \"celular\": \"44999991001\"\r\n      },\r\n      \"rg\": \"41.694.531-4\"\r\n    },\r\n    \"dependentes\": [\r\n      {\r\n        \"nome\": \"Ana Paula Ferreira\",\r\n        \"grauParentesco\": \"CONJUGE\",\r\n        \"dataNascimento\": \"1986-07-09\",\r\n        \"sexo\": \"MULHER\",\r\n        \"cpf\": \"684.219.370-90\",\r\n        \"contato\": {\r\n          \"telefone\": \"44988881001\"\r\n        }\r\n      }\r\n    ],\r\n    \"endereco\": {\r\n      \"cep\": \"87050-000\",\r\n      \"logradouro\": \"Rua das Flores\",\r\n      \"numero\": \"123\",\r\n      \"complemento\": \"Casa\",\r\n      \"bairro\": \"Centro\",\r\n      \"cidade\": \"Maringá\",\r\n      \"uf\": \"PR\"\r\n    }\r\n  },\r\n  {\r\n    \"planoId\": 1484,\r\n    \"offlineUuid\": \"6a1d8a20-0f7a-4f7b-9a01-1b1f00000101\",\r\n    \"idVendedor\": 717,\r\n    \"tipoCobranca\": \"BOLETO\",\r\n    \"numeroMensalidades\": 6,\r\n    \"diaVencimento\": 10,\r\n    \"pessoa\": {\r\n      \"nome\": \"Carla Mendes Rocha\",\r\n      \"dataNascimento\": \"1991-11-03\",\r\n      \"cpf\": \"390.533.447-05\",\r\n      \"sexo\": \"MULHER\",\r\n      \"tipo\": \"FISICA\",\r\n      \"contato\": {\r\n        \"email\": \"carla.rocha@email.com\",\r\n        \"celular\": \"44999991002\"\r\n      },\r\n      \"rg\": \"22.333.444-5\"\r\n    },\r\n    \"dependentes\": [],\r\n    \"endereco\": {\r\n      \"cep\": \"80010-000\",\r\n      \"logradouro\": \"Av. Brasil\",\r\n      \"numero\": \"1000\",\r\n      \"complemento\": \"Apto 202\",\r\n      \"bairro\": \"Centro\",\r\n      \"cidade\": \"Curitiba\",\r\n      \"uf\": \"PR\"\r\n    }\r\n  },\r\n  {\r\n    \"planoId\": 1484,\r\n    \"offlineUuid\": \"6a1d8a20-0f7a-4f7b-9a01-1b1f00000003\",\r\n    \"idVendedor\": 717,\r\n    \"tipoCobranca\": \"PIX\",\r\n    \"numeroMensalidades\": 1,\r\n    \"diaVencimento\": 15,\r\n    \"pessoa\": {\r\n      \"nome\": \"Marcos Vinícius Almeida\",\r\n      \"dataNascimento\": \"1978-06-22\",\r\n      \"cpf\": \"964.305.480-30\",\r\n      \"sexo\": \"HOMEM\",\r\n      \"tipo\": \"FISICA\",\r\n      \"contato\": {\r\n        \"email\": \"marcos.almeida@email.com\",\r\n        \"celular\": \"44999991003\"\r\n      },\r\n      \"rg\": \"11.222.333-4\"\r\n    },\r\n    \"dependentes\": [],\r\n    \"endereco\": {\r\n      \"cep\": \"86010-000\",\r\n      \"logradouro\": \"Av. Higienópolis\",\r\n      \"numero\": \"890\",\r\n      \"complemento\": \"Sala 3\",\r\n      \"bairro\": \"Centro\",\r\n      \"cidade\": \"Londrina\",\r\n      \"uf\": \"PR\"\r\n    }\r\n  },\r\n  {\r\n    \"planoId\": 1484,\r\n    \"offlineUuid\": \"6a1d8a20-0f7a-4f7b-9a01-1b1f00000005\",\r\n    \"idVendedor\": 717,\r\n    \"tipoCobranca\": \"DUPLICATA\",\r\n    \"numeroMensalidades\": 10,\r\n    \"diaVencimento\": 20,\r\n    \"pessoa\": {\r\n      \"nome\": \"Patrícia Souza Lima\",\r\n      \"dataNascimento\": \"1982-04-19\",\r\n      \"cpf\": \"548.721.960-50\",\r\n      \"sexo\": \"MULHER\",\r\n      \"tipo\": \"FISICA\",\r\n      \"contato\": {\r\n        \"email\": \"patricia.lima@email.com\",\r\n        \"celular\": \"44999991004\"\r\n      },\r\n      \"rg\": \"99.888.777-6\"\r\n    },\r\n    \"dependentes\": [\r\n      {\r\n        \"nome\": \"Pedro Souza Lima\",\r\n        \"grauParentesco\": \"FILHO\",\r\n        \"dataNascimento\": \"2010-08-11\",\r\n        \"sexo\": \"HOMEM\",\r\n        \"cpf\": \"\",\r\n        \"contato\": {\r\n          \"telefone\": \"\"\r\n        }\r\n      }\r\n    ],\r\n    \"endereco\": {\r\n      \"cep\": \"85501-000\",\r\n      \"logradouro\": \"Rua Paraná\",\r\n      \"numero\": \"77\",\r\n      \"complemento\": \"\",\r\n      \"bairro\": \"Centro\",\r\n      \"cidade\": \"Pato Branco\",\r\n      \"uf\": \"PR\"\r\n    }\r\n  },\r\n  {\r\n    \"planoId\": 1484,\r\n    \"offlineUuid\": \"6a1d8a20-0f7a-4f7b-9a01-1b1f00000005\",\r\n    \"idVendedor\": 717,\r\n    \"tipoCobranca\": \"BOLETO\",\r\n    \"numeroMensalidades\": 8,\r\n    \"diaVencimento\": 25,\r\n    \"pessoa\": {\r\n      \"nome\": \"Eduardo Nogueira Santos\",\r\n      \"dataNascimento\": \"1969-09-30\",\r\n      \"cpf\": \"287.945.610-08\",\r\n      \"sexo\": \"HOMEM\",\r\n      \"tipo\": \"FISICA\",\r\n      \"contato\": {\r\n        \"email\": \"eduardo.santos@email.com\",\r\n        \"celular\": \"44999991005\"\r\n      },\r\n      \"rg\": \"55.444.333-2\"\r\n    },\r\n    \"dependentes\": [],\r\n    \"endereco\": {\r\n      \"cep\": \"87030-000\",\r\n      \"logradouro\": \"Rua Independência\",\r\n      \"numero\": \"900\",\r\n      \"complemento\": \"\",\r\n      \"bairro\": \"Zona 7\",\r\n      \"cidade\": \"Maringá\",\r\n      \"uf\": \"PR\"\r\n    }\r\n  }\r\n]\r\n",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{url_base}}/api/v1/contratos/offline/sync",
              "host": [
                "{{url_base}}"
              ],
              "path": [
                "api",
                "v1",
                "contratos",
                "offline",
                "sync"
              ]
            }
          },
          "response": []
        }
      ]
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "const base = pm.collectionVariables.get('url_base');",
          "if (base && !/^https?:\\/\\//.test(base)) {",
          "  throw new Error('url_base deve incluir http:// ou https://');",
          "}"
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "access_token",
      "value": "",
      "description": "Ultimo token gravado (OAuth, app ou mobile) — prefira tokens especificos"
    },
    {
      "key": "url_base",
      "value": "http://localhost:8082",
      "description": "URL base da API (local: http://localhost:8082, sandbox: https://sandbox-api.progem.com.br)"
    },
    {
      "key": "empresa_id",
      "value": "",
      "description": "ID numerico do tenant — header X-Progem-ID (OAuth e whitelabel)"
    },
    {
      "key": "usuario_app_id",
      "value": "",
      "description": "ID usuario_app — auto apos login"
    },
    {
      "key": "mobile_pre_auth_token",
      "value": "",
      "description": "JWT pre_auth (~5 min) — auto apos login mobile"
    },
    {
      "key": "mobile_access_token",
      "value": "",
      "description": "JWT access mobile (~15 min) — auto apos select-tenant"
    },
    {
      "key": "mobile_refresh_token",
      "value": "",
      "description": "Refresh mobile (~30 dias) — auto apos select-tenant"
    },
    {
      "key": "mobile_device_id",
      "value": "postman-device-001",
      "description": "X-Device-ID estavel para sessao mobile"
    },
    {
      "key": "mobile_identificador",
      "value": "",
      "description": "Email ou CPF do usuario_app (fluxo mobile)"
    },
    {
      "key": "mobile_senha",
      "value": "",
      "description": "Senha do usuario mobile"
    },
    {
      "key": "mobile_empresa_id",
      "value": "",
      "description": "empresaId escolhido no fluxo mobile — auto apos login"
    },
    {
      "key": "cliente_cpf",
      "value": "122.479.876-72",
      "description": "CPF de exemplo para buscas (contratos, titular)"
    },
    {
      "key": "refresh_token",
      "value": "",
      "description": "Ultimo refresh whitelabel gravado"
    },
    {
      "key": "app_device_id",
      "value": "postman-whitelabel-001",
      "description": "X-Device-ID whitelabel (login/refresh/logout app)"
    },
    {
      "key": "oauth_access_token",
      "value": "",
      "description": "Token M2M OAuth2 — use em pastas operacionais com X-Progem-ID"
    },
    {
      "key": "app_access_token",
      "value": "",
      "description": "Token whitelabel associado — auto apos Login Usuario"
    },
    {
      "key": "app_refresh_token",
      "value": "",
      "description": "Refresh whitelabel — auto apos Login Usuario"
    },
    {
      "key": "oauth_client_id",
      "value": "patense",
      "description": "client_id do ApiClient (Console AWIS > Tenant > Api Clients)"
    },
    {
      "key": "oauth_client_secret",
      "value": "e9a4c3fdd7b923f0f5a6a5b15e4c3a5a9f8c3fbb9b6e2d2f9f2c6b1e8d7a4c9",
      "description": "client_secret do ApiClient (exibido uma vez na criacao/rotacao)"
    },
    {
      "key": "app_login_identificador",
      "value": "",
      "description": "Email ou CPF para Login Usuario (whitelabel)"
    },
    {
      "key": "app_login_senha",
      "value": "",
      "description": "Senha para Login Usuario (whitelabel)"
    },
    {
      "key": "cobranca_id",
      "value": "",
      "description": "ID item_duplicata — auto apos GET /cobrancas/v2"
    },
    {
      "key": "caixa_id",
      "value": "",
      "description": "ID caixa operacional — auto apos GET /caixas"
    },
    {
      "key": "usuario_progem_id",
      "value": "",
      "description": "ID usuario Progem para vinculo admin (TAMS-530)"
    }
  ]
}
